rhumb_direct: Rhumb line (loxodrome) calculations on the WGS84 ellipsoid

View source: R/rhumb.R

rhumb_directR Documentation

Rhumb line (loxodrome) calculations on the WGS84 ellipsoid

Description

Solve rhumb line problems on the WGS84 ellipsoid. A rhumb line (or loxodrome) is a path of constant bearing, which appears as a straight line on a Mercator projection. Unlike geodesics, rhumb lines are not the shortest path between two points, but they are easier to navigate as they maintain a constant compass heading.

Usage

rhumb_direct(x, azi, s)

rhumb_inverse(x, y)

rhumb_path(x, y, n = 100L)

rhumb_line(x, azi, distances)

rhumb_distance(x, y)

rhumb_distance_matrix(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).

distances

Numeric vector of distances from the starting point in meters.

Details

Rhumb lines are paths of constant azimuth (bearing). They are longer than geodesics (up to 50% longer for long distances) but are useful for navigation because they can be followed with a constant compass heading.

The azimuth is measured in degrees from north, with positive values clockwise (east) and negative values counter-clockwise (west). The range is -180 to 180 degrees.

The area S12 represents the area under the rhumb line quadrilateral with corners at (lat1, lon1), (0, lon1), (0, lon2), and (lat2, lon2).

Value

  • rhumb_direct(): Data frame with columns:

    • lon1, lat1: Starting coordinates

    • azi12: Azimuth (constant along rhumb line, degrees)

    • s12: Distance (meters)

    • lon2, lat2: Destination coordinates

    • S12: Area under rhumb line (square meters)

  • rhumb_inverse(): Data frame with columns:

    • lon1, lat1: Starting coordinates

    • lon2, lat2: Ending coordinates

    • s12: Distance (meters)

    • azi12: Azimuth (degrees)

    • S12: Area under rhumb line (square meters)

  • rhumb_path(): Data frame with columns:

    • lon, lat: Coordinates along the path

    • s: Distance from start (meters)

    • azi12: Constant azimuth (degrees)

  • rhumb_line(): Data frame with columns:

    • lon, lat: Coordinates at specified distances

    • azi: Azimuth (degrees)

    • s: Distance from start (meters)

  • rhumb_distance(): Numeric vector of distances in meters (pairwise).

  • rhumb_distance_matrix(): Matrix of distances in meters.

See Also

geodesic_direct() for shortest-path geodesic calculations.

Examples

# Direct problem: Where do you end up starting from London,
# heading east on a rhumb line for 1000 km?
rhumb_direct(c(-0.1, 51.5), azi = 90, s = 1000000)

# Inverse problem: Rhumb distance from London to New York
rhumb_inverse(c(-0.1, 51.5), c(-74, 40.7))

# Compare to geodesic (rhumb is longer!)
geodesic_inverse(c(-0.1, 51.5), c(-74, 40.7))$s12
rhumb_inverse(c(-0.1, 51.5), c(-74, 40.7))$s12

# Generate a rhumb line path
path <- rhumb_path(c(-0.1, 51.5), c(-74, 40.7), n = 10)
path

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