Struct RhumbLine

Reuse a constant-bearing route to find positions at several distances.

struct RhumbLine(T)
  
if (isGeodesyScalar!T);

Choose RhumbLine when you have one start position and bearing and need many points along the same route. Prepare it once instead of solving the setup anew for every distance. An unprepared .init line is invalid.

Properties

NameTypeDescription
bearing[get] Angle!TConstant canonical bearing.
isValid[get] boolTrue when this line has reusable finite prepared state.
start[get] GeographicCoordinate!TPrepared start coordinate.

Methods

NameDescription
fromRhumb (solver, start, bearing) Prepare from an existing solver or throw.
position (distance) Return the destination a given distance along this constant-bearing route.
tryFromRhumb (solver, start, bearing, result) Prepare from an existing solver without throwing.
tryPosition (distance, result) Find a point a given distance along this constant-bearing route.

Example

Example using RhumbLine.

import geodesy;
const solver = Rhumb!double.fromEllipsoid(wgs84!double());
const start = GeographicCoordinate!double.fromComponents(
    Latitude!double.fromDegrees(48.0),
    Longitude!double.fromDegrees(16.0));
assert(solver.line(
    start,
    Angle!double.fromDegrees(45.0)).isValid);