Skip to content

Commit faef9ab

Browse files
battlecookmcordingley
authored andcommitted
add magnitude function in Vector class (#34)
Add `magnitude` function in `Vector` class
1 parent 884b21c commit faef9ab

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/Vector.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,14 @@ public function length(): float
7474
return $this->l2norm();
7575
}
7676

77+
/**
78+
* @return float
79+
*/
80+
public function magnitude()
81+
{
82+
return $this->length();
83+
}
84+
7785
/**
7886
* @param self $other
7987
* @return float

0 commit comments

Comments
 (0)