spatialpos {globe} | R Documentation |
Converts latitudes and longitudes on the sphere into 3D Cartesian coordinates.
spatialpos(lon, lat)
lon |
A vector, matrix column, or list of longitudes |
lat |
A vector, matrix column, or list of longitudes |
The longitudes and latitudes can be input as a single entity (i.e. a 2 column matrix, or pair of lists) rather than as separate entities.
A matrix with one row per set of Cartesian coordinates
Adrian Baddeley and Tom Lawrence
ensure3d ensures that the given data is a vector 3D coordinates, and where possible converts the data if they are not in this format. ensurelonlat ensures that the given data are a pair of lists, one list of for longitude, one for latitude, and where possible converts the data if they are not in this format.
spatialpos(30, 60)
spatialpos(place("nedlands"))