Class: NvectorSpherical

latlon-nvector-spherical~NvectorSpherical

An n-vector is a vector normal to the Earth's surface (a non-singular position representation). For many applications, n-vectors are more convenient to work with than other position representations such as latitude/longitude, UTM coordinates, etc. On a spherical model earth, an n-vector is equivalent to an earth-centred earth-fixed (ECEF) vector.

Constructor

new NvectorSpherical(x, y, z, hopt)

Creates a 3d n-vector normal to the Earth's surface.
Parameters:
Name Type Attributes Default Description
x number x component.
y number y component.
z number z component.
h number <optional>
0 height above ellipsoid surface in metres.
Source:

Extends

  • vector3d

Methods

toLatLon() → {LatLon}

Converts ‘this’ n-vector to latitude/longitude point.
Source:
Returns:
Latitude/longitude point vector points to.
Type
LatLon
Example
var v = new Nvector(0.5000, 0.5000, 0.7071);
  var p = v.toLatLon(); // 45.0°N, 45.0°E

toString(dpopt) → {string}

Returns a string representation of ‘this’ n-vector.
Parameters:
Name Type Attributes Default Description
dp number <optional>
3 Number of decimal places to display.
Source:
Returns:
Comma-separated x, y, z, h values.
Type
string