Class RotUtil

java.lang.Object
maxharold.matrix.RotUtil

public class RotUtil extends Object
Class used for rotating vectors
  • Constructor Details

    • RotUtil

      public RotUtil()
  • Method Details

    • rotationMatrix2D

      public static Matrix rotationMatrix2D(double theta)
      Method that generates 2D Rotation Matrix
      Parameters:
      theta - the angle of the rotation (in radians)
      Returns:
      The 2D rotation matrix
    • rotate2DVector

      public static Vector rotate2DVector(Vector v, double theta)
      Method that rotates a vector by some angle
      Parameters:
      v - the vector to rotate
      theta - the angle to rotate the vector by (in radians)
      Returns:
      the rotated vector (returns null if invalid)
    • yaw

      public static Vector yaw(Vector v, double yaw)
      Method that performs yaw rotation to a 3D vector
      Parameters:
      v - the vector to rotate
      yaw - the angle to yaw vector by (in radians)
      Returns:
      the rotated vector (returns null if invalid)
    • pitch

      public static Vector pitch(Vector v, double pitch)
      Method that performs pitch rotation to a 3D vector
      Parameters:
      v - the vector to rotate
      pitch - the angle to pitch vector by (in radians)
      Returns:
      the rotated vector (returns null if invalid)
    • roll

      public static Vector roll(Vector v, double roll)
      Method that performs roll rotation to a 3D vector
      Parameters:
      v - the vector to rotate
      roll - the angle to roll vector by (in radians)
      Returns:
      the rotated vector (returns null if invalid)