Constructor
new LatLon_NvectorEllipsoidal(lat, lon, heightopt, datumopt)
Creates a LatLon point on an ellipsoidal model earth.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
lat |
number | Latitude in degrees. | ||
lon |
number | Longitude in degrees. | ||
height |
number |
<optional> |
0 | Height above ellipsoid in metres. |
datum |
LatLon.datums |
<optional> |
WGS84 | Datum this point is defined within. |
- Source:
Methods
deltaTo(point) → {Ned}
Calculates delta from ‘this’ point to supplied point.
The delta is given as a north-east-down NED vector. Note that this is a linear delta,
unrelated to a geodesic on the ellipsoid.
Points need not be defined on the same datum.
Parameters:
Name | Type | Description |
---|---|---|
point |
LatLon | Point delta is to be determined to. |
- Source:
Returns:
Delta from ‘this’ point to supplied point in local tangent plane of this point.
- Type
- Ned
Example
var a = new LatLon(49.66618, 3.45063);
var b = new LatLon(48.88667, 2.37472);
var delta = a.deltaTo(b); // [N:-86126,E:-78900,D:1069]
var dist = delta.length; // 116807.681 m
var brng = delta.bearing; // 222.493°
var elev = delta.elevation; // -0.5245°
destinationPoint(delta) → {LatLon}
Calculates destination point using supplied delta from ‘this’ point.
Parameters:
Name | Type | Description |
---|---|---|
delta |
Ned | Delta from ‘this’ point to supplied point in local tangent plane of this point. |
- Source:
Returns:
Destination point.
- Type
- LatLon
Example
var a = new LatLon(49.66618, 3.45063);
var delta = Ned.fromDistanceBearingElevation(116807.681, 222.493, -0.5245); // [N:-86126,E:-78900,D:1069]
var b = a.destinationPoint(delta); // 48.88667°N, 002.37472°E
(private) equals(point) → {bool}
Checks if another point is equal to ‘this’ point.
Parameters:
Name | Type | Description |
---|---|---|
point |
LatLon | Point to be compared against this point. |
- Source:
Returns:
True if points are identical.
- Type
- bool
Example
var p1 = new LatLon(52.205, 0.119);
var p2 = new LatLon(52.205, 0.119);
var equal = p1.equals(p2); // true
toCartesian() → {Cartesian}
Converts ‘this’ point from (geodetic) latitude/longitude coordinates to (geocentric) cartesian
(x/y/z) coordinates.
- Source:
Returns:
Cartesian point equivalent to lat/lon point, with x, y, z in metres from
earth centre.
TODO this simply replicates LatLon.toCartesian() from latlon-ellipsoidal.js but returns
Cartesian_Nvector in place of Cartesian, so that toNvector() is available; there must be a
better way of doing this!
- Type
- Cartesian
toNvector() → {Nvector}
Converts ‘this’ lat/lon point to n-vector (normal to earth's surface).
- Source:
Returns:
N-vector representing lat/lon point.
- Type
- Nvector
Example
var p = new LatLon(45, 45);
var n = p.toNvector(); // [0.5000, 0.5000, 0.7071]