spatialpos {globe} | R Documentation |
Convert Geographical to Cartesian Coordinates
Description
Converts latitudes and longitudes on the sphere into 3D Cartesian coordinates.
Usage
spatialpos(lon, lat)
Arguments
lon |
A vector, matrix column, or list of longitudes |
lat |
A vector, matrix column, or list of longitudes |
Details
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.
Value
A matrix with one row per set of Cartesian coordinates
Author(s)
Adrian Baddeley and Tom Lawrence
See Also
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.
Examples
spatialpos(30, 60)
spatialpos(place("nedlands"))
[Package globe version 1.2-0 Index]