convert geodetic coordinates ([lat,lon]) to ecef (cartesian [x,y,z])
var ecef = require('geodetic-to-ecef');
var xyz = ecef(37.8043722, -122.2708026);
console.log(xyz);
output:
$ node ecef.js
[ -2694044.4111565403, -4266368.805493665, 3888310.602276871 ]
var ecef = require('geodetic-to-ecef')
Return an array xyz
of [x,y,z]
coordinates in meters from lat
and lon
.
Optionally supply an elevation
in meters.
With npm do:
npm install geodetic-to-ecef
MIT