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 line is invalid.
Properties
| Name | Type | Description |
|---|---|---|
bearing[get]
|
Angle!T | Constant canonical bearing. |
isValid[get]
|
bool | True when this line has reusable finite prepared state. |
start[get]
|
GeographicCoordinate!T | Prepared start coordinate. |
Methods
| Name | Description |
|---|---|
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);