gnomonic_fwd: Gnomonic projection

View source: R/gnomonic.R

gnomonic_fwdR Documentation

Gnomonic projection

Description

Convert between geographic coordinates and the gnomonic projection. In this projection, geodesics (shortest paths) appear as straight lines, making it useful for navigation and great circle route planning.

Usage

gnomonic_fwd(x, lon0, lat0)

gnomonic_rev(x, y, lon0, lat0)

Arguments

x

For forward conversion: a two-column matrix or data frame of coordinates (longitude, latitude) in decimal degrees. For reverse conversion: numeric vector of x coordinates in meters.

lon0

Longitude of the projection center in decimal degrees.

lat0

Latitude of the projection center in decimal degrees.

y

Numeric vector of y coordinates in meters.

Details

The gnomonic projection has a unique property: all geodesics (great circles on a sphere, shortest paths on an ellipsoid) appear as straight lines. This makes it invaluable for:

  • Planning great circle routes in aviation and shipping

  • Seismic ray path analysis

  • Radio wave propagation studies

Limitations:

  • Can only show less than a hemisphere

  • Extreme distortion away from the center

  • Neither conformal nor equal-area

Value

Data frame with columns:

  • For forward conversion:

    • x: X coordinate in meters

    • y: Y coordinate in meters

    • azi: Azimuth of the geodesic at the center (degrees)

    • rk: Reciprocal of the azimuthal scale

    • lon, lat: Input coordinates (echoed)

  • For reverse conversion:

    • lon: Longitude in decimal degrees

    • lat: Latitude in decimal degrees

    • azi: Azimuth of the geodesic at the center (degrees)

    • rk: Reciprocal of the azimuthal scale

    • x, y: Input coordinates (echoed)

See Also

azeq_fwd() for azimuthal equidistant projection

Examples

# Project cities relative to London
cities <- cbind(
  lon = c(-74, 139.7, 151.2, 2.3),
  lat = c(40.7, 35.7, -33.9, 48.9)
)
gnomonic_fwd(cities, lon0 = -0.1, lat0 = 51.5)

# Great circle route appears as straight line
# London to NYC path
path <- geodesic_path(c(-0.1, 51.5), c(-74, 40.7), n = 10)
projected <- gnomonic_fwd(cbind(path$lon, path$lat), lon0 = -37, lat0 = 46)
# x and y should be approximately linear
plot(projected$x, projected$y, type = "l")

geographiclib documentation built on March 4, 2026, 9:07 a.m.