Longitude latitude (and z) to Cartesian XYZ

ll2cart(llh, rad = 6378137, exag = 1)

Arguments

llh

matrix of longitude, latitude, and optionally z (height above surface)

rad

radius of sphere, assumed Earthish

exag

exaggeration factor for height values

Value

matrix of XYZ coordinates (3 columns)

Examples

ll2cart(cbind(c(-180, 0, 90, 180), c(-90, -42, 0, 45, 90)))
#> Warning: number of rows of result is not a multiple of vector length (arg 1)
#> x y z #> [1,] -3.905483e-10 -4.782837e-26 -6378137 #> [2,] 4.739880e+06 0.000000e+00 -4267807 #> [3,] 3.905483e-10 6.378137e+06 0 #> [4,] -4.510024e+06 5.523186e-10 4510024 #> [5,] -3.905483e-10 -4.782837e-26 6378137