Added a Graph datastructure and refactored the Line/Vertex classes

This commit is contained in:
Quinn
2023-05-02 09:49:38 -05:00
parent 9b0acbe34c
commit 3321e77061
18 changed files with 859 additions and 68 deletions

View File

@@ -1,5 +1,5 @@
import Vector.Vector;
import org.junit.jupiter.api.Test;
import processing.core.PApplet;
import static java.lang.Math.*;
import static org.junit.jupiter.api.Assertions.*;
@@ -28,8 +28,8 @@ class VectorTest{
assertFloatEquals((float)sqrt(x2*x2 + y2*y2), v2.mag());
// test dot product
assertFloatEquals((float)(x1*x2+y1*y2), v1.dot(v2));
assertFloatEquals((float)(x1*x2+y1*y2), v2.dot(v1));
assertFloatEquals((x1*x2+y1*y2), v1.dot(v2));
assertFloatEquals((x1*x2+y1*y2), v2.dot(v1));
// test addition
Vector vSum = v1.add(v2);