java.lang.Object
provided.utils.valueGenerator.impl.VectorUtil
- All Implemented Interfaces:
IVectorUtil
Implementation of IVectorUtil
- Author:
- swong
-
Field Summary
Fields -
Constructor Summary
Constructors -
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.
-
Field Details
-
Singleton
Singleton instance
-
-
Constructor Details
-
VectorUtil
private VectorUtil()Private constructor for singleton.
-
-
Method Details
-
rotate
Description copied from interface:IVectorUtil
Utility method to rotate the given vector by the given angle the input vector is mutated. Works with both Points and Point2D.Doubles.- Specified by:
rotate
in interfaceIVectorUtil
- Parameters:
v
- A 2-D vectorangle
- Angle to rotate by in radians
-
angleBetween
Description copied from interface:IVectorUtil
Utility method to get the signed angle between the two 2-D vectors. Works with both Points and Point2D.Doubles.- Specified by:
angleBetween
in interfaceIVectorUtil
- Parameters:
v1
- vector #1v2
- vector #2- Returns:
- the angle from v1 to v2
-