This class contains methods for spherical trigonometry operations. See theSphericalTrigonometry for the one and only one instance of this class
The constructor
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:
Name | Type | Description |
---|---|---|
summit | Number | The opposite summit |
arc1 | Number | The first arc |
arc2 | Number | The second arc |
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.
Name | Type | Description |
---|---|---|
latLngStartPoint | Array of Number | The coordinates of the start point |
latLngEndPoint | Array of Number | The coordinates of the end point |
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
Name | Type | Description |
---|---|---|
arc1 | Number | The first arc |
arc2 | Number | The second arc |
oppositeArc | Number | The opposite arc |