- All Known Implementing Classes:
VectorUtil
public interface IVectorUtil
Utilities for working with 2-D vectors.
- Author:
- swong
-
Method Summary
Modifier and TypeMethodDescriptiondouble
angleBetween(Point2D v1, Point2D v2)
Utility method to get the signed angle between the two 2-D vectors.void
Utility method to rotate the given vector by the given angle the input vector is mutated.
-
Method Details
-
rotate
Utility method to rotate the given vector by the given angle the input vector is mutated. Works with both Points and Point2D.Doubles.- Parameters:
v
- A 2-D vectorangle
- Angle to rotate by in radians
-
angleBetween
Utility method to get the signed angle between the two 2-D vectors. Works with both Points and Point2D.Doubles.- Parameters:
v1
- vector #1v2
- vector #2- Returns:
- the angle from v1 to v2
-