Constructor
new NvectorSpherical(x, y, z)
Creates a 3d n-vector normal to the Earth’s surface.
Parameters:
Name | Type | Description |
---|---|---|
x |
number | X component of n-vector (towards 0°N, 0°E). |
y |
number | Y component of n-vector (towards 0°N, 90°E). |
z |
number | Z component of n-vector (towards 90°N). |
- Source:
Example
import { Nvector } from '/js/geodesy/latlon-nvector-spherical.js';
const n = new Nvector(0.5000, 0.5000, 0.7071);
Extends
- Vector3d
Methods
toLatLon() → {LatLon}
Converts ‘this’ n-vector to latitude/longitude point.
- Source:
Returns:
Latitude/longitude point vector points to.
- Type
- LatLon
Example
const n = new Nvector(0.5000, 0.5000, 0.7071);
const p = n.toLatLon(); // 45.0°N, 045.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
Example
const v = new Nvector(0.5000, 0.5000, 0.7071).toString(); // [0.500,0.500,0.707]