Package maxharold.matrix
Class RotUtil
java.lang.Object
maxharold.matrix.RotUtil
Class used for rotating vectors
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic VectorMethod that performs pitch rotation to a 3D vectorstatic VectorMethod that performs roll rotation to a 3D vectorstatic Vectorrotate2DVector(Vector v, double theta) Method that rotates a vector by some anglestatic MatrixrotationMatrix2D(double theta) Method that generates 2D Rotation Matrixstatic VectorMethod that performs yaw rotation to a 3D vector
-
Constructor Details
-
RotUtil
public RotUtil()
-
-
Method Details
-
rotationMatrix2D
Method that generates 2D Rotation Matrix- Parameters:
theta- the angle of the rotation (in radians)- Returns:
- The 2D rotation matrix
-
rotate2DVector
Method that rotates a vector by some angle- Parameters:
v- the vector to rotatetheta- the angle to rotate the vector by (in radians)- Returns:
- the rotated vector (returns null if invalid)
-
yaw
Method that performs yaw rotation to a 3D vector- Parameters:
v- the vector to rotateyaw- the angle to yaw vector by (in radians)- Returns:
- the rotated vector (returns null if invalid)
-
pitch
Method that performs pitch rotation to a 3D vector- Parameters:
v- the vector to rotatepitch- the angle to pitch vector by (in radians)- Returns:
- the rotated vector (returns null if invalid)
-
roll
Method that performs roll rotation to a 3D vector- Parameters:
v- the vector to rotateroll- the angle to roll vector by (in radians)- Returns:
- the rotated vector (returns null if invalid)
-