Skip to content

Commit f2d90d0

Browse files
committed
Add magnitude test.
1 parent faef9ab commit f2d90d0

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

tests/VectorTest.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,13 @@ public function testLength()
9090
$this->assertEquals(5, $vector->length());
9191
}
9292

93+
public function testMagnitude()
94+
{
95+
$vector = new Vector([3, 4]);
96+
97+
$this->assertEquals(5, $vector->magnitude());
98+
}
99+
93100
public function testDotProduct()
94101
{
95102
$vector1 = new Vector([1, 2, 3, 4]);

0 commit comments

Comments
 (0)