geodesic_direct_fast: Fast geodesic calculations (series approximation)

View source: R/geodesic_fast.R

geodesic_direct_fastR Documentation

Fast geodesic calculations (series approximation)

Description

These functions provide the same geodesic calculations as geodesic_direct(), geodesic_inverse(), etc., but use a series approximation that is slightly faster at the cost of reduced precision (accurate to ~15 nanometers vs full double precision for the exact versions).

For most applications, the difference is negligible and these faster versions are recommended.

Usage

geodesic_direct_fast(x, azi, s)

geodesic_inverse_fast(x, y)

geodesic_path_fast(x, y, n = 100L)

geodesic_distance_fast(x, y)

geodesic_distance_matrix_fast(x, y = NULL)

Arguments

x

A two-column matrix or data frame of starting coordinates (longitude, latitude) in decimal degrees.

azi

Numeric vector of azimuths (bearings) in degrees, measured clockwise from north.

s

Numeric vector of distances in meters.

y

A two-column matrix or data frame of ending coordinates (longitude, latitude) in decimal degrees.

n

Integer number of points to generate along the path (including start and end points).

Value

Same as the corresponding exact geodesic functions.

See Also

geodesic_direct(), geodesic_inverse() for exact versions

Examples

# Fast inverse: London to New York
geodesic_inverse_fast(c(-0.1, 51.5), c(-74, 40.7))

# Compare to exact version
geodesic_inverse(c(-0.1, 51.5), c(-74, 40.7))$s12
geodesic_inverse_fast(c(-0.1, 51.5), c(-74, 40.7))$s12

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