latlon-to-xyz

1.0.1 • Public • Published

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

  • lat: Number, latitude
  • lon: Number, longitude
  • out: vec3

Returns out or new vec3 point on a unit sphere

License

MIT, see LICENSE.md for details.

Readme

Keywords

Package Sidebar

Install

npm i latlon-to-xyz

Weekly Downloads

5

Version

1.0.1

License

MIT

Last publish

Collaborators

  • vorg