spherical: Transform between spherical coordinates and physical...

sphericalR Documentation

Transform between spherical coordinates and physical coordinates

Description

Transform a longitude or latitude interval into the equivalent in meters depending on latitude.

Usage

dlon(dx, lat, a = 6731000)

dlat(dy, a = 6731000)

dx(dlon, lat, a = 6731000)

dy(dlat, a = 6731000)

Arguments

dx, dy

interval in meters

lat

latitude, in degrees

a

radius of the Earth

dlon, dlat

interval in degrees

Examples


library(data.table)
data(geopotential)
geopotential <- geopotential[date == date[1]]

# Geostrophic wind
geopotential[, c("u", "v") := GeostrophicWind(gh, lon, lat)]  # in meters/second
geopotential[, c("dlon", "dlat") := .(dlon(u, lat), dlat(v))] # in degrees/second
geopotential[, c("u2", "v2") := .(dx(dlon, lat), dy(dlat))]   # again in degrees/second


metR documentation built on Oct. 14, 2024, 5:09 p.m.