Interface Rotations


@NullMarked public interface Rotations
Rotations is an immutable object that stores rotations in degrees on each axis (X, Y, Z).
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final Rotations
    Rotations instance with every axis set to 0
  • Method Summary

    Modifier and Type
    Method
    Description
    add(double x, double y, double z)
    Returns a new Rotations instance which is the result of adding the x, y, z components to this Rotations
    static Rotations
    ofDegrees(double x, double y, double z)
    Creates a new Rotations instance holding the provided rotations
    default Rotations
    subtract(double x, double y, double z)
    Returns a new Rotations instance which is the result of subtracting the x, y, z components from this Rotations
    withX(double x)
    Returns a new Rotations instance which is the result of changing the X axis to the passed angle
    withY(double y)
    Returns a new Rotations instance which is the result of changing the Y axis to the passed angle
    withZ(double z)
    Returns a new Rotations instance which is the result of changing the Z axis to the passed angle
    double
    x()
    Returns the angle on the X axis in degrees
    double
    y()
    Returns the angle on the Y axis in degrees
    double
    z()
    Returns the angle on the Z axis in degrees
  • Field Details

    • ZERO

      static final Rotations ZERO
      Rotations instance with every axis set to 0
  • Method Details

    • ofDegrees

      static Rotations ofDegrees(double x, double y, double z)
      Creates a new Rotations instance holding the provided rotations
      Parameters:
      x - the angle for the X axis in degrees
      y - the angle for the Y axis in degrees
      z - the angle for the Z axis in degrees
      Returns:
      Rotations instance holding the provided rotations
    • x

      double x()
      Returns the angle on the X axis in degrees
      Returns:
      the angle in degrees
    • y

      double y()
      Returns the angle on the Y axis in degrees
      Returns:
      the angle in degrees
    • z

      double z()
      Returns the angle on the Z axis in degrees
      Returns:
      the angle in degrees
    • withX

      Rotations withX(double x)
      Returns a new Rotations instance which is the result of changing the X axis to the passed angle
      Parameters:
      x - the angle in degrees
      Returns:
      the resultant Rotations
    • withY

      Rotations withY(double y)
      Returns a new Rotations instance which is the result of changing the Y axis to the passed angle
      Parameters:
      y - the angle in degrees
      Returns:
      the resultant Rotations
    • withZ

      Rotations withZ(double z)
      Returns a new Rotations instance which is the result of changing the Z axis to the passed angle
      Parameters:
      z - the angle in degrees
      Returns:
      the resultant Rotations
    • add

      Rotations add(double x, double y, double z)
      Returns a new Rotations instance which is the result of adding the x, y, z components to this Rotations
      Parameters:
      x - the angle to add to the X axis in degrees
      y - the angle to add to the Y axis in degrees
      z - the angle to add to the Z axis in degrees
      Returns:
      the resultant Rotations
    • subtract

      default Rotations subtract(double x, double y, double z)
      Returns a new Rotations instance which is the result of subtracting the x, y, z components from this Rotations
      Parameters:
      x - the angle to subtract from the X axis in degrees
      y - the angle to subtract from the Y axis in degrees
      z - the angle to subtract from the Z axis in degrees
      Returns:
      the resultant Rotations