Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,15 @@ public Vector2d scale(double scalar) {
return new Vector2d(m_x * scalar, m_y * scalar);
}

/**
* Takes the vector and changes the length while maintaining the direction
*
* @return a normalized vector
*/
public Vector2d normalize() {
return scale(1 / magnitude());
}

/**
* Projects this vector onto another vector
*
Expand Down