Class Rotation

java.lang.Object
eu.svjatoslav.sixth.e3d.math.Rotation
All Implemented Interfaces:
Cloneable

public class Rotation extends Object implements Cloneable
Represents a rotation in 3D space using two Euler angles (XZ and YZ).

Angles are stored with precomputed sine and cosine values for efficient repeated rotation operations without recalculating trigonometric functions.

See Also:
  • Constructor Summary

    Constructors
    Constructor
    Description
     
    Rotation(double angleXZ, double angleYZ)
    Creates a rotation with the specified Euler angles.
  • Method Summary

    Modifier and Type
    Method
    Description
     
    void
    rotate(double angleXZ, double angleYZ)
    Adds the specified angles to this rotation and updates the trigonometric values.
    void
    rotate(Point3D point3d)
    Rotates a point around the origin using this rotation's angles.

    Methods inherited from class java.lang.Object

    equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • Rotation

      public Rotation()
    • Rotation

      public Rotation(double angleXZ, double angleYZ)
      Creates a rotation with the specified Euler angles.
      Parameters:
      angleXZ - the angle around the XZ axis (yaw) in radians
      angleYZ - the angle around the YZ axis (pitch) in radians
  • Method Details

    • clone

      public Rotation clone()
      Overrides:
      clone in class Object
    • rotate

      public void rotate(Point3D point3d)
      Rotates a point around the origin using this rotation's angles.
      Parameters:
      point3d - the point to rotate (modified in place)
    • rotate

      public void rotate(double angleXZ, double angleYZ)
      Adds the specified angles to this rotation and updates the trigonometric values.
      Parameters:
      angleXZ - the angle to add around the XZ axis in radians
      angleYZ - the angle to add around the YZ axis in radians