tryNextGeodesicIntersection - multiple declarations
Function tryNextGeodesicIntersection
Find the next closest intersection after a known common-origin crossing.
bool tryNextGeodesicIntersection(T)(
const Geodesic!T solver,
const GeodesicLine!T firstLine,
const GeodesicLine!T secondLine,
out GeodesicNextIntersectionResult!T result
) pure nothrow @nogc @safe
if (isGeodesyScalar!T);
This one-shot overload preserves the existing API and computes invariant ellipsoid spacing for the call. Repeated callers should use the prepared GeodesicIntersectionSolver overload.
Function tryNextGeodesicIntersection
Find the next intersection using ellipsoid-dependent prepared state.
bool tryNextGeodesicIntersection(T)(
const GeodesicIntersectionSolver!T intersector,
const GeodesicLine!T firstLine,
const GeodesicLine!T secondLine,
out GeodesicNextIntersectionResult!T result
) pure nothrow @nogc @safe
if (isGeodesyScalar!T);
Preparation cost is excluded from the repeated operation while the mathematical result and line-origin validation remain identical to the one-shot overload.
Function tryNextGeodesicIntersection
Construct two common-origin oriented geodesics and find their next crossing.
bool tryNextGeodesicIntersection(T)(
const Geodesic!T solver,
const GeographicCoordinate!T knownIntersection,
const Angle!T firstAzimuth,
const Angle!T secondAzimuth,
out GeodesicNextIntersectionResult!T result
) pure nothrow @nogc @safe
if (isGeodesyScalar!T);
Function tryNextGeodesicIntersection
Construct common-origin lines and find the next crossing using reusable family state.
bool tryNextGeodesicIntersection(T)(
const GeodesicIntersectionSolver!T intersector,
const GeographicCoordinate!T knownIntersection,
const Angle!T firstAzimuth,
const Angle!T secondAzimuth,
out GeodesicNextIntersectionResult!T result
) pure nothrow @nogc @safe
if (isGeodesyScalar!T);
Example
Example finding the next intersection without throwing.
const solver =
Geodesic!double .fromEllipsoid(
wgs84!double());
const known =
GeographicCoordinate!double .fromComponents(
Latitude!double .fromDegrees(0.0),
Longitude!double .fromDegrees(0.0));
GeodesicNextIntersectionResult!double result;
assert(tryNextGeodesicIntersection(
solver,
known,
Angle!double .fromDegrees(30.0),
Angle!double .fromDegrees(120.0),
result));
assert(result .isValid);
assert(result .displacementDistance > 0.0);