org.gicentre.utils.spatial

## Class Ellipsoid

- java.lang.Object
- - org.gicentre.utils.spatial.Ellipsoid

- All Implemented Interfaces:
    java.io.Serializable

      public class Ellipsoid
      extends java.lang.Object
      implements java.io.Serializable

  Stores an ellipsoid representation for global map projections.
  Version:
    3.4, 5th February, 2016.
  Author:
    Jo Wood, giCentre, City University London.
  See Also:
    Serialized Form

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static int` | `AIRY_1830` Airy 1830 ellipsoid (used by OSGB National Grid).
    `static int` | `AUSTRALIAN_NATIONAL` Australian National ellipsoid.
    `static int` | `BESSEL_1841` Bessel 1841 ellipsoid (used by Swiss 1903 datum).
    `static int` | `BESSEL_1841_NAMIBIA` Bessel 1841 (Namibia) ellipsoid.
    `static int` | `CLARKE_1866` Clarke 1866 ellipsoid (used by NAD 1927 datum).
    `static int` | `CLARKE_1880` Clarke 1880 ellipsoid.
    `static int` | `EVEREST` Everest ellipsoid.
    `static int` | `FISCHER_1960` Fischer 1960 (Mercury) ellipsoid.
    `static int` | `FISCHER_1968` Fischer 1968 ellipsoid.
    `static int` | `GRS_1967` GRS 1967 ellipsoid.
    `static int` | `GRS_1980` GRS 1980 ellipsoid (used by NAD 1983 datum).
    `static int` | `HELMERT_1906` Helmert 1906 ellipsoid.
    `static int` | `HOUGH` Hough ellipsoid.
    `static int` | `INTERNATIONAL` International ellipsoid.
    `static int` | `KRASSOVSKY` Krassovsky ellipsoid.
    `static int` | `MODIFIED_AIRY` Modified Airy ellipsoid.
    `static int` | `MODIFIED_EVEREST` Modified Everest ellipsoid.
    `static int` | `MODIFIED_FISCHER_1960` Modified Fischer 1960 ellipsoid.
    `static int` | `SOUTH_AMERICAN` South American ellipsoid.
    `static int` | `SPHERE` Standard sphere.
    `static int` | `UNDEFINED` Undefined ellipsoid.
    `static int` | `WGS_60` WGS 60 ellipsoid.
    `static int` | `WGS_66` WGS 66 ellipsoid.
    `static int` | `WGS_72` WGS 72 ellipsoid.
    `static int` | `WGS_84` WGS 84 ellipsoid.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `Ellipsoid(int id)` Creates an ellipsoid using the given ID.

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `double` | `getEquatorialRadius()` Reports the equatorial radius represented by this ellipsoid.
    `int` | `getID()` Reports the ID of this ellipsoid.
    `double` | `getN()` Reports the degree of flattening as the ratio (a-b)/(a+b).
    `java.lang.String` | `getName()` Reports the name associated with this ellipsoid.
    `static java.lang.String` | `getName(int id)` Reports the name associated with the given ellipsoid ID.
    `double` | `getPolarRadius()` Reports the polar radius represented by the ellipsoid.
    `double` | `getSquaredEccentricity()` Reports the squared eccentricity of this ellipsoid.
    `processing.core.PVector` | `projectDatum(processing.core.PVector p, int newDatum)` Converts a given lat/long coordinate pair using this ellipsoid datum into a longitude/latitude pair using the given datum.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### UNDEFINED

          public static final int UNDEFINED

      Undefined ellipsoid.
      See Also:
        Constant Field Values

    - #### AIRY_1830

          public static final int AIRY_1830

      Airy 1830 ellipsoid (used by OSGB National Grid).
      See Also:
        Constant Field Values

    - #### AUSTRALIAN_NATIONAL

          public static final int AUSTRALIAN_NATIONAL

      Australian National ellipsoid.
      See Also:
        Constant Field Values

    - #### BESSEL_1841

          public static final int BESSEL_1841

      Bessel 1841 ellipsoid (used by Swiss 1903 datum).
      See Also:
        Constant Field Values

    - #### BESSEL_1841_NAMIBIA

          public static final int BESSEL_1841_NAMIBIA

      Bessel 1841 (Namibia) ellipsoid.
      See Also:
        Constant Field Values

    - #### CLARKE_1866

          public static final int CLARKE_1866

      Clarke 1866 ellipsoid (used by NAD 1927 datum).
      See Also:
        Constant Field Values

    - #### CLARKE_1880

          public static final int CLARKE_1880

      Clarke 1880 ellipsoid.
      See Also:
        Constant Field Values

    - #### EVEREST

          public static final int EVEREST

      Everest ellipsoid.
      See Also:
        Constant Field Values

    - #### FISCHER_1960

          public static final int FISCHER_1960

      Fischer 1960 (Mercury) ellipsoid.
      See Also:
        Constant Field Values

    - #### FISCHER_1968

          public static final int FISCHER_1968

      Fischer 1968 ellipsoid.
      See Also:
        Constant Field Values

    - #### GRS_1967

          public static final int GRS_1967

      GRS 1967 ellipsoid.
      See Also:
        Constant Field Values

    - #### GRS_1980

          public static final int GRS_1980

      GRS 1980 ellipsoid (used by NAD 1983 datum).
      See Also:
        Constant Field Values

    - #### HELMERT_1906

          public static final int HELMERT_1906

      Helmert 1906 ellipsoid.
      See Also:
        Constant Field Values

    - #### HOUGH

          public static final int HOUGH

      Hough ellipsoid.
      See Also:
        Constant Field Values

    - #### INTERNATIONAL

          public static final int INTERNATIONAL

      International ellipsoid.
      See Also:
        Constant Field Values

    - #### KRASSOVSKY

          public static final int KRASSOVSKY

      Krassovsky ellipsoid.
      See Also:
        Constant Field Values

    - #### MODIFIED_AIRY

          public static final int MODIFIED_AIRY

      Modified Airy ellipsoid.
      See Also:
        Constant Field Values

    - #### MODIFIED_EVEREST

          public static final int MODIFIED_EVEREST

      Modified Everest ellipsoid.
      See Also:
        Constant Field Values

    - #### MODIFIED_FISCHER_1960

          public static final int MODIFIED_FISCHER_1960

      Modified Fischer 1960 ellipsoid.
      See Also:
        Constant Field Values

    - #### SOUTH_AMERICAN

          public static final int SOUTH_AMERICAN

      South American ellipsoid.
      See Also:
        Constant Field Values

    - #### WGS_60

          public static final int WGS_60

      WGS 60 ellipsoid.
      See Also:
        Constant Field Values

    - #### WGS_66

          public static final int WGS_66

      WGS 66 ellipsoid.
      See Also:
        Constant Field Values

    - #### WGS_72

          public static final int WGS_72

      WGS 72 ellipsoid.
      See Also:
        Constant Field Values

    - #### WGS_84

          public static final int WGS_84

      WGS 84 ellipsoid.
      See Also:
        Constant Field Values

    - #### SPHERE

          public static final int SPHERE

      Standard sphere.
      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### Ellipsoid

          public Ellipsoid(int id)

      Creates an ellipsoid using the given ID.
      Parameters:
        `id` - Ellipsoid ID.

  - ### Method Detail

    - #### getID

          public int getID()

      Reports the ID of this ellipsoid. For example, `Ellipsoid.WGS84`.
      Returns:
        ID of this ellipsoid.

    - #### getEquatorialRadius

          public double getEquatorialRadius()

      Reports the equatorial radius represented by this ellipsoid. In projection terms, this is the ellipsoid's semi-major axis.
      Returns:
        Equatorial radius of this ellipsoid.

    - #### getPolarRadius

          public double getPolarRadius()

      Reports the polar radius represented by the ellipsoid. In projection terms this is the ellipsoid's semi-minor axis.
      Returns:
        Polar radius of the ellipsoid.

    - #### getSquaredEccentricity

          public double getSquaredEccentricity()

      Reports the squared eccentricity of this ellipsoid.
      Returns:
        eccentricity Squared eccentricity of this ellipsoid.

    - #### getN

          public double getN()

      Reports the degree of flattening as the ratio (a-b)/(a+b).
      Returns:
        Degree of flattening.

    - #### getName

          public java.lang.String getName()

      Reports the name associated with this ellipsoid.
      Returns:
        Name of this ellipsoid.

    - #### projectDatum

          public processing.core.PVector projectDatum(processing.core.PVector p,
                                                      int newDatum)

      Converts a given lat/long coordinate pair using this ellipsoid datum into a longitude/latitude pair using the given datum. Note: Currently, the only conversion supported are between WGS84 (GRS80), Airy 1830 (used by Ordnance Survey National Grid) Clarke 1880 (used by IGN France) and Bessel 1841 (used by Swiss National Grid).
      Parameters:
        `p` - Longitude/latitude point. Longitude varies within +-180 degrees, latitude within +-90 degrees.
        `newDatum` - New datum used in conversion.
      Returns:
        Converted latitude/longitude coordinates.

    - #### getName

          public static java.lang.String getName(int id)

      Reports the name associated with the given ellipsoid ID.
      Parameters:
        `id` - Ellipsoid ID.
      Returns:
        Name of given ellipsoid.