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 TypeMethodDescriptiondoubleangleBetween(Point2D v1, Point2D v2)Utility method to get the signed angle between the two 2-D vectors.voidUtility 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:IVectorUtilUtility method to rotate the given vector by the given angle the input vector is mutated. Works with both Points and Point2D.Doubles.- Specified by:
rotatein interfaceIVectorUtil- Parameters:
v- A 2-D vectorangle- Angle to rotate by in radians
-
angleBetween
Description copied from interface:IVectorUtilUtility method to get the signed angle between the two 2-D vectors. Works with both Points and Point2D.Doubles.- Specified by:
angleBetweenin interfaceIVectorUtil- Parameters:
v1- vector #1v2- vector #2- Returns:
- the angle from v1 to v2
-