vincenty_direct

Function vincenty_direct 

Source
pub fn vincenty_direct(
    lat_deg: f64,
    lon_deg: f64,
    range_m: f64,
    bearing_deg: f64,
    atol: f64,
    max_iters: u16,
) -> Result<(f64, f64), DomainError>
Expand description

Calculates the LLA location that is a fixed range and bearing from a reference LLA. This function uses an iterative solution to determine outputs using the WGS84 ellipsoidal Earth model.

See reference: https://en.wikipedia.org/wiki/Vincenty%27s_formulae.

§Arguments

  • lat_deg - Latitude reference [[degrees]].
  • lon_deg - Longitude reference [[degrees]].
  • range_m - Range (i.e., distance) from point A to point B [[meters]].
  • bearing_deg - Bearing (i.e., azimuth) from point A to point B relative to true north [[degrees]].
  • abs_tol - Absolute tolerance used for convergence.
  • max_iters - Maximum possible number of iterations before early termination.

§Returns

A tuple (lat_deg, lon_deg) where:

  • lat_deg - Latitude location [[degrees]].
  • lon_deg - Longitude location [[degrees]].