Class SphericalTrigonometry

This class contains methods for spherical trigonometry operations. See theSphericalTrigonometry for the one and only one instance of this class

Source : file core/lib/SphericalTrigonometry.js at line 34

Constructor

new SphericalTrigonometry ( )

The constructor

Source : file core/lib/SphericalTrigonometry.js at line 50

Public methods

arcFromSummitArcArc ( summit, arc1, arc2 )

This method gives an arc of a spherical triangle when the 2 others arcs and the opposite summit are know. It's the well know cosinus law:

Source : file core/lib/SphericalTrigonometry.js at line 69

Parameters

Name Type Description
summit Number

The opposite summit

arc1 Number

The first arc

arc2 Number

The second arc

pointsDistance ( latLngStartPoint, latLngEndPoint )

This method returns the distance between two points Since v1.7.0 we use the simple spherical law of cosines formula (cos c = cos a cos b + sin a sin b cos C). The delta with the Leaflet method is always < 10e-3 m. The error due to the earth radius is a lot bigger. Notice: leaflet uses the haversine formula.

Source : file core/lib/SphericalTrigonometry.js at line 105

Parameters

Name Type Description
latLngStartPoint Array of Number

The coordinates of the start point

latLngEndPoint Array of Number

The coordinates of the end point

summitFromArcArcArc ( arc1, arc2, oppositeArc )

This method is also the well know cosinus law written in an other way....

cos C = ( cos c - cos a cos b ) / sin a sin b

Source : file core/lib/SphericalTrigonometry.js at line 88

Parameters

Name Type Description
arc1 Number

The first arc

arc2 Number

The second arc

oppositeArc Number

The opposite arc

Private methods

#normalizeLng ( Lng )

This method normalize a longitude (always between -180° and 180°)

Source : file core/lib/SphericalTrigonometry.js at line 42

Parameters

Name Type Description
Lng Number

The longitude to normalize

Returns

The normalized longitude
Type : Number