Class Earth

  • Direct Known Subclasses:
    EarthEllipsoid

    @Immutable
    public class Earth
    extends Object
    Defines the shape of the earth ellipsoid.
    • Field Detail

      • DEFAULT

        public static final Earth DEFAULT
      • WGS84_EARTH_RADIUS_METERS

        public static final double WGS84_EARTH_RADIUS_METERS
        Get canonical radius of the spherical earth in meters from "WGS 84"
        See Also:
        Constant Field Values
      • WGS84_EARTH_RADIUS_KM

        public static final double WGS84_EARTH_RADIUS_KM
        Get canonical radius of the spherical earth in km from "WGS 84"
        See Also:
        Constant Field Values
    • Constructor Detail

      • Earth

        public Earth()
        Spherical earth with canonical radius.
      • Earth

        public Earth​(double radius)
        Assume a spherical cow, I mean earth.
        Parameters:
        radius - radius of spherical earth.
      • Earth

        public Earth​(double equatorRadius,
                     double poleRadius,
                     double reciprocalFlattening)
        Create an ellipsoidal earth. The reciprocalFlattening is used if not zero, else the poleRadius is used.
        Parameters:
        equatorRadius - equatorial radius (semimajor axis) in meters, must be specified
        poleRadius - polar radius (semiminor axis) in meters
        reciprocalFlattening - inverse flattening = 1/flattening = a / (a-b)
      • Earth

        public Earth​(double equatorRadius,
                     double poleRadius,
                     double reciprocalFlattening,
                     String name)
        Create an ellipsoidal earth with a name.
        Parameters:
        equatorRadius - equatorial radius (semimajor axis) in meters, must be specified
        poleRadius - polar radius (semiminor axis) in meters; if reciprocalFlattening != 0 then this is ignored
        reciprocalFlattening - inverse flattening = 1/flattening = a / (a-b); if 0 use the poleRadius to calculate
        name - name of the Earth
    • Method Detail

      • isSpherical

        public boolean isSpherical()
        Is this a spherical earth?
      • getMajor

        public double getMajor()
        Get the equatorial radius (semimajor axis) of the earth, in meters.
      • getMinor

        public double getMinor()
        Get the polar radius (semiminor axis) of the earth, in meters.
      • getName

        public String getName()
        Get the Name.
      • getEccentricity

        public double getEccentricity()
        Get the Eccentricity .
      • getEccentricitySquared

        public double getEccentricitySquared()
        Get the Eccentricity squared.
      • getEquatorRadius

        public double getEquatorRadius()
        Get the Equatorial Radius in meters.
      • getPoleRadius

        public double getPoleRadius()
        Get the Polar Radius in meters.
      • getFlattening

        public double getFlattening()
        Get the Flattening.
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object