Learn R Programming

oce (version 0.2-1)

geodXy: Convert lat/lon to x/y on earth

Description

Convert lat/lon to x/y on earth

Usage

geodXy(lat, lon, lat.ref, lon.ref, rotate=0)

Arguments

lat
vector of latitudes
lon
vector of longitudes
lat.ref
numeric, reference latitude
lon.ref
numeric, reference longitude
rotate
numeric, counterclockwise angle, in degrees, by which to rotate the (x, y) coordinates about the reference point. This is useful in rotating the coordinate system to align with a coastline, a mean current, etc.

Value

  • Data frame of x and y, measured in metres.

Details

This is based on the same geodesic calculations used in geodDist, the documentation of which explains the method and provides literature citations.

See Also

geodDist

Examples

Run this code
library(oce)
lat <- c(0, 1/60,    0, 1/60)
lon <- c(0,    0, 1/60, 1/60)
plot(geodXy(lat, lon, 0, 0, 0) / 1852)
points(geodXy(lat, lon, 0, 0, 1) / 1852, col='red')

Run the code above in your browser using DataLab