Skip to content

Commit b7a82dc

Browse files
committed
Merge pull request processing-js#171 from viamodulo/issue168
Closes processing-js#168 : Added unit tests for PVector.angleBetween
2 parents f6ea530 + 4472bcc commit b7a82dc

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

test/unit/PVector.pde

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,14 @@ PVector v2 = new PVector(60, 80);
3939
float a = PVector.angleBetween(v1, v2);
4040
_checkEqual(degrees(a), 10.304846, round_tolerance);
4141

42+
v1 = new PVector(2, 3);
43+
a = PVector.angleBetween(v1, v1);
44+
_checkEqual(a, 0, round_tolerance);
45+
46+
v1 = new PVector(2, 4);
47+
a = PVector.angleBetween(v1, v1);
48+
_checkEqual(a, 0, round_tolerance);
49+
4250
// CROSS
4351
PVector v1 = new PVector(10, 20, 2);
4452
PVector v2 = new PVector(60, 80, 6);

0 commit comments

Comments
 (0)