-
Notifications
You must be signed in to change notification settings - Fork 22
/
Copy pathspherical.Rd
43 lines (34 loc) · 994 Bytes
/
spherical.Rd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/small_funs.R
\name{spherical}
\alias{spherical}
\alias{dlon}
\alias{dlat}
\alias{dx}
\alias{dy}
\title{Transform between spherical coordinates and physical coordinates}
\usage{
dlon(dx, lat, a = 6731000)
dlat(dy, a = 6731000)
dx(dlon, lat, a = 6731000)
dy(dlat, a = 6731000)
}
\arguments{
\item{dx, dy}{interval in meters}
\item{lat}{latitude, in degrees}
\item{a}{radius of the Earth}
\item{dlon, dlat}{interval in degrees}
}
\description{
Transform a longitude or latitude interval into the equivalent in meters depending
on latitude.
}
\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
}