Class Longitude

java.lang.Object
java.lang.Number
io.jenetics.jpx.Longitude
All Implemented Interfaces:
Serializable

public final class Longitude extends Number implements Serializable
The longitude of the point. Decimal degrees, WGS84 datum, which must be within the range of [-180..180].
Since:
1.0
Version:
2.0
See Also:
  • Field Details

    • MIN_DEGREES

      public static final double MIN_DEGREES
      A constant holding the maximum value a Latitude value can have, -180 inclusively.
      Since:
      2.0
      See Also:
    • MIN_VALUE

      public static final Longitude MIN_VALUE
      A constant holding the maximum value a Latitude value can have, -180 inclusively.
      Since:
      2.0
    • MAX_DEGREES

      public static final double MAX_DEGREES
      A constant holding the maximum value a Latitude value can have, 180 inclusively.
      Since:
      2.0
      See Also:
    • MAX_VALUE

      public static final Longitude MAX_VALUE
      A constant holding the maximum value a Latitude value can have, 180 inclusively.
      Since:
      2.0
  • Method Details

    • doubleValue

      public double doubleValue()
      Return the longitude value in decimal degrees.
      Specified by:
      doubleValue in class Number
      Returns:
      the longitude value in decimal degrees
    • toRadians

      public double toRadians()
      Return the longitude value in radians.
      Returns:
      the longitude value in radians
    • toDegrees

      public double toDegrees()
      Return the longitude in decimal degree.
      Returns:
      the longitude in decimal degree
    • intValue

      public int intValue()
      Specified by:
      intValue in class Number
    • longValue

      public long longValue()
      Specified by:
      longValue in class Number
    • floatValue

      public float floatValue()
      Specified by:
      floatValue in class Number
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • ofDegrees

      public static Longitude ofDegrees(double degrees)
      Create a new (decimal degrees) Longitude object.
      Parameters:
      degrees - the longitude value in decimal degrees
      Returns:
      a new (decimal degrees) Longitude object
      Throws:
      IllegalArgumentException - if the given value is not within the range of [-180..180)
    • ofRadians

      public static Longitude ofRadians(double radians)
      Create a new Longitude value for the given radians.
      Parameters:
      radians - the longitude value in radians
      Returns:
      a new Longitude value for the given radians
      Throws:
      IllegalArgumentException - if the given radians is not within the range of [-2*Pi..2*Pi]