Convert lon/lat coordinates to cartesian coordinates by first calculating great circle distance and bearing and then mapping these coordinates into cartesian space. This mapping is relative to the point centre_lat, centre_lon, which should be roughly at the midpoint of the observed data.

lonlat_to_cartesian(centre_lon, centre_lat, data_lon, data_lat)

Arguments

centre_lon

The centre longitude

centre_lat

The centre latitude

data_lon

The data longitude

data_lat

The data latitude

Examples

# Centre at QMUL centre_lon <- -0.040827 centre_lat <- 51.523775 # Data point at Queen Elizabeth Park data_lon <- -0.016546 data_lat <- 51.542473 lonlat_to_cartesian(centre_lon = centre_lon, centre_lat = centre_lat, data_lon = data_lon, data_lat = data_lat)
#> $x #> [1] 1.679175 #> #> $y #> [1] 2.079401 #>