Function intersectGeodesicSegments
Intersect two bounded shortest ellipsoidal geodesic segments.
GeodesicSegmentIntersectionResult!T intersectGeodesicSegments(T)(
const Geodesic!T solver,
const GeographicCoordinate!T firstStart,
const GeographicCoordinate!T firstEnd,
const GeographicCoordinate!T secondStart,
const GeographicCoordinate!T secondEnd
) @safe
if (isGeodesyScalar!T);
This is the throwing counterpart of tryIntersectGeodesicSegments.
Throws
GeodesyValueException for invalid/degenerate/ambiguous segment input
or numerical non-convergence. A valid disjoint pair does not throw and
returns kind == none.
Example
Example returning a valid no-intersection result without throwing.
const solver =
Geodesic!double .fromEllipsoid(
wgs84!double());
const firstStart =
GeographicCoordinate!double .fromComponents(
Latitude!double .fromDegrees(0.0),
Longitude!double .fromDegrees(-10.0));
const firstEnd =
GeographicCoordinate!double .fromComponents(
Latitude!double .fromDegrees(0.0),
Longitude!double .fromDegrees(-5.0));
const secondStart =
GeographicCoordinate!double .fromComponents(
Latitude!double .fromDegrees(10.0),
Longitude!double .fromDegrees(5.0));
const secondEnd =
GeographicCoordinate!double .fromComponents(
Latitude!double .fromDegrees(10.0),
Longitude!double .fromDegrees(10.0));
const result =
intersectGeodesicSegments(
solver,
firstStart,
firstEnd,
secondStart,
secondEnd);
assert(result .kind
== GeodesicSegmentIntersectionKind .none);