latlon-to-xyz

stable

Convert latitude,longitude to x,y,z position on a unit sphere.

Usage

var latLonToXyz = require('latlon-to-xyz')

var pos = latLonToXyz(51.507222, -0.1275)
//[ 0.6224144446694938, 0.7826866171599899, 0.0013850579111009925 ]

API

latLonToXyz(lat, lon, [out])

Converts latitude,longitude to x,y,z position

Returns out or new vec3 point on a unit sphere

License

MIT, see LICENSE.md for details.