Class Angle

java.lang.Object
com.luciad.cartesian.Angle

public final class Angle extends Object
An angle on a mathematical circle: degrees, counter-clockwise from right/X-axis.
  • Nested Class Summary Link icon

    Nested Classes
    Modifier and Type
    Class
    Description
    static enum 
    Represents the different angular directions.
  • Constructor Summary Link icon

    Constructors
    Constructor
    Description
    Angle(double degrees)
    Creates an angle based on the given angular value in degrees.
    Angle(Angle angle)
    Creates an angle based on another angle.
  • Method Summary Link icon

    Modifier and Type
    Method
    Description
    boolean
    equals(Object other)
     
    static Angle
    fromRadians(double radians)
    Creates an Angle from an angle value in radians.
    double
    Returns the value in degrees constrained between [0, 360].
    double
    Returns the value in radians constrained between [0, 2*PI]
    int
     
    static double
    normalize(double degrees)
    Normalizes the degree value to the range ]-180, +180].
     

    Methods inherited from class java.lang.Object Link icon

    clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details Link icon

    • Angle Link icon

      public Angle(double degrees) throws IllegalArgumentException
      Creates an angle based on the given angular value in degrees.
      Parameters:
      degrees - an angle in degree
      Throws:
      IllegalArgumentException - when degrees is NaN or infinite.
    • Angle Link icon

      public Angle(@NotNull Angle angle)
      Creates an angle based on another angle.
      Parameters:
      angle - an angle.
  • Method Details Link icon

    • normalize Link icon

      public static double normalize(double degrees)
      Normalizes the degree value to the range ]-180, +180].
      Parameters:
      degrees - a value in degrees
      Returns:
      a degrees value, normalized to ]-180, +180].
    • fromRadians Link icon

      @NotNull public static Angle fromRadians(double radians) throws IllegalArgumentException
      Creates an Angle from an angle value in radians.
      Parameters:
      radians - an angle in radians
      Returns:
      a new angle based on the given angle in radians
      Throws:
      IllegalArgumentException - when radians is NaN or infinite.
    • getDegrees Link icon

      public double getDegrees()
      Returns the value in degrees constrained between [0, 360].
      Returns:
      the value in degrees constrained between [0, 360].
    • getRadians Link icon

      public double getRadians()
      Returns the value in radians constrained between [0, 2*PI]
      Returns:
      the value in radians constrained between [0, 2*PI].
    • toAzimuth Link icon

      @NotNull public Azimuth toAzimuth()
    • equals Link icon

      public boolean equals(Object other)
      Overrides:
      equals in class Object
    • hashCode Link icon

      public int hashCode()
      Overrides:
      hashCode in class Object