Learn R Programming

globe (version 1.2-0)

spatialpos:

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

Value

A matrix with one row per set of Cartesian coordinates

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.

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

Run this code
spatialpos(30, 60)
spatialpos(place("nedlands"))

Run the code above in your browser using DataLab