View source: R/conversion_coordinates.R
lonlat2ECEF | R Documentation |
Conversion between lon-lat and ECEF (Earth-centered, Earth-fixed) coordinates.
lonlat2ECEF(lon, lat = NULL, alt = 0, as.matrix = TRUE)
ECEF2lonlat(x, y = NULL, z = NULL)
lon , lat |
coordinates given as two vectors or as a matrix (or a data frame). |
alt |
a vector of altitudes. |
as.matrix |
a logical value specifying whether to return the results in a matrix. The default is to return them in a list. |
x , y , z |
three numeric vectors of the same length, or only
|
This function uses an ellopsoid model of Earth shape with the following parameters: equatorial radius = 6,378,137 m, polar radius = 6,356,752 m.
lonlat2ECEF
returns a matrix with three columns or a list with
three vectors; ECEF2lonlat
returns a matrix with three columns.
Emmanuel Paradis
Blewitt, G. (2024) An improved equation of latitude and a global system of graticule distance coordinates. Journal of Geodesy, 98, 6.
## From Blewitt's Table 1:
DF <- expand.grid(alt = c(1, 4, 10, 40) *1e3,
lat = seq(15, 75, 15),
lon = 0)
DF <- as.matrix(DF[3:1])
x <- lonlat2ECEF(DF[, -3], alt = DF[, 3], as.matrix = TRUE)
DFbis <- ECEF2lonlat(x)
xbis <- lonlat2ECEF(DFbis[, -3], alt = DFbis[, 3], as.matrix = TRUE)
summary(x - xbis)
summary(DF - DFbis)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.