Class Angle


  • public final class Angle
    extends java.lang.Object
    Represents an angle in the range of 0 (inclusive) to 360 (exclusive) degrees.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      double degrees()
      Gets this angle in degrees.
      boolean equals​(java.lang.Object o)  
      static Angle fromDegrees​(double degrees)
      Creates an Angle based on the provided angle in degrees.
      static Angle fromRadians​(double radians)
      Creates an Angle based on the provided angle in degrees.
      int hashCode()  
      double radians()
      Gets this angle in radians.
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • fromDegrees

        public static Angle fromDegrees​(double degrees)
        Creates an Angle based on the provided angle in degrees.

        Any angle that falls outside of the range 0 (inclusive) to 360 (exclusive) degrees will be mapped to be within this range.

        Parameters:
        degrees - The angle in degrees.
        Returns:
        The Angle
      • fromRadians

        public static Angle fromRadians​(double radians)
        Creates an Angle based on the provided angle in degrees.

        Any angle that falls outside of the range 0 (inclusive) to 2*pi (exclusive) degrees will be mapped to be within this range.

        Parameters:
        radians - The angle in radians.
        Returns:
        The Angle
      • degrees

        public double degrees()
        Gets this angle in degrees.
        Returns:
        The angle in degrees.
      • radians

        public double radians()
        Gets this angle in radians.
        Returns:
        The angle in radians.
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object