Skip to content

vorg/latlon-to-xyz

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

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

Resources

License

Stars

Watchers

Forks

Packages

No packages published