TsGeo - Resources - Ellipsoid

An ellipsoid is a mathematically defined approximation of the earth’s surface. Ellipsoid class is this representation.

An ellipsoid is defined by two parameters:

  • the semi-major axis a (equatorial radius)
  • the semi-minor axis b (polar radius)

a and b together define the flattening of the ellipsoid f: f = (a-b)/a

TsGeo is based on phpgeo so the same algorithm is used. TsGeo's ellipsoids are defined by a and 1/f instead of a and b.

TsGeo supports arbitrary ellipsoids. WGS-84 is used as default when no other ellipsoid is given. For day-to-day calculations it’s not needed to care about ellipsoids in the most cases.

It’s possible to create an instance of the Ellipsoid class either by specifing a name or by providing the three parameters name, a, and 1/f.

Default configuration

A default configuration is defined in Ellipsoid class:

  • WGS-84 : World Geodetic System 1984 with a = 6378137.0 and 1/f = 298.257223563
  • GRS-80 : Geodetic Reference System 1980 with a = 6378137.0 and 1/f = 298.257222100

These configurations can be used to create a default Ellipsoid using createDefault().

Public Methods

constructor (name: string, a: number, f:number)

Build a Ellipsoid object with a and 1/f under the name name.


Return the name of Ellipsoid. (string)


Return the parameter a of Ellipsoid. (number)


Return the parameter b of Ellipsoid. Computed by b = a * (1 - 1/f) (number)


Return the parameter 1/f of Ellipsoid. (number)


Calculates the arithmetic mean radius.

See http://home.online.no/~sigurdhu/WGS84_Eng.html

Static Methods

createDefault(name = 'WGS-84': string)

Return an Ellipsoid using the default configuration by name.

createFromArray(config: Array)

Return an Ellipsoid defined by config array. config shall have the following fields:

  • name
  • a
  • f

Polygon Retour

Ajouter un commentaire