An ellipsoid is a mathematically defined approximation of the earth’s surface. Ellipsoid class is this representation.
An ellipsoid is defined by two parameters:
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.
A default configuration is defined in Ellipsoid class:
These configurations can be used to create a default Ellipsoid using createDefault().
constructor (name: string, a: number, f:number)
Build a Ellipsoid object with a and 1/f under the name name.
getName()
Return the name of Ellipsoid. (string)
getA()
Return the parameter a of Ellipsoid. (number)
getB()
Return the parameter b of Ellipsoid. Computed by b = a * (1 - 1/f) (number)
getF()
Return the parameter 1/f of Ellipsoid. (number)
getArithmeticMeanRadius()
Calculates the arithmetic mean radius.
See http://home.online.no/~sigurdhu/WGS84_Eng.html
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:
Ajouter un commentaire