Method GetShortestLineTo
- Namespace
- GeometryHelper.Core
- Assembly
- GeometryHelper.dll
GetShortestLineTo(GeoArc2, GeoPoint2)
Gets the shortest segment joining an arc to a point, using the default tolerance.
public static GeoLine2 GetShortestLineTo(GeoArc2 arc, GeoPoint2 point)
Parameters
Returns
GetShortestLineTo(GeoArc2, GeoPoint2, Tolerance)
Gets the shortest segment joining an arc to a point, within a tolerance.
public static GeoLine2 GetShortestLineTo(GeoArc2 arc, GeoPoint2 point, Tolerance tolerance)
Parameters
Returns
- GeoLine2
A segment leaving the arc and ending at
point.
Remarks
A point within the tolerance of the centre of an arc is read as at the centre, which has no direction, and is carried to the arc's start; the distance to the point is the exact one, so the line can be longer than it, by at most twice the point's offset from the centre. At a tolerance of a thousandth, the point (0, -0.0009) and the arc of radius 50 about the origin from (-50, 0) to (50, 0) through (0, -50): the closest point is (-50, 0), 50.00000001 away, where the distance is 49.9991.
GetShortestLineTo(GeoArc2, GeoLine2)
Gets the shortest segment joining an arc to a straight segment, using the default tolerance.
public static GeoLine2 GetShortestLineTo(GeoArc2 arc, GeoLine2 line)
Parameters
Returns
GetShortestLineTo(GeoArc2, GeoLine2, Tolerance)
Gets the shortest segment joining an arc to a straight segment, within a tolerance.
public static GeoLine2 GetShortestLineTo(GeoArc2 arc, GeoLine2 line, Tolerance tolerance)
Parameters
Returns
- GeoLine2
A segment leaving the arc and landing on
line, of no length at all where the two cross.
Remarks
The candidates are the ones DistanceTo(GeoArc2, GeoLine2, Tolerance) already weighs — an end of one against the other, and the place where the segment runs straight at the centre — so this hands back the pair that measurement was of, and its length is that same distance rather than anything sampled. The exception is a touch: where the two come within the point tolerance, this reads them as meeting and hands back a segment of no length, as the line to cut and extend by, where the distance is the gap.
GetShortestLineTo(GeoArc2, GeoArc2)
Gets the shortest segment joining two arcs, using the default tolerance.
public static GeoLine2 GetShortestLineTo(GeoArc2 first, GeoArc2 second)
Parameters
Returns
GetShortestLineTo(GeoArc2, GeoArc2, Tolerance)
Gets the shortest segment joining two arcs, within a tolerance.
public static GeoLine2 GetShortestLineTo(GeoArc2 first, GeoArc2 second, Tolerance tolerance)
Parameters
firstGeoArc2The arc the segment leaves.
secondGeoArc2The arc the segment lands on.
toleranceToleranceThe tolerance.
Returns
- GeoLine2
A segment leaving
firstand landing onsecond, of no length at all where the two cross.
Remarks
As with an arc and a segment, the pair is one of those DistanceTo(GeoArc2, GeoArc2, Tolerance) already weighs: an end of one against the other, or a point of each on the line joining the centres. Where they come within the point tolerance, this reads them as meeting and hands back a segment of no length, where the distance is the gap. Two arcs whose circles cross within the tolerance past the ends of both can be twice as far apart, and are joined by the gap: at a thousandth, the quarter circle of radius 50 from (50, 0) to (0, 50) and an arc of the same radius starting 0.0009 short of where its circle crosses the first's, 0.0009 on past that end at 60 degrees, are joined by the line between the two ends, 0.00156 long.
GetShortestLineTo(GeoArc2, GeoCircle2)
Gets the shortest segment joining an arc to a circle, using the default tolerance.
public static GeoLine2 GetShortestLineTo(GeoArc2 arc, GeoCircle2 circle)
Parameters
arcGeoArc2circleGeoCircle2
Returns
GetShortestLineTo(GeoArc2, GeoCircle2, Tolerance)
Gets the shortest segment joining an arc to a circle, within a tolerance.
public static GeoLine2 GetShortestLineTo(GeoArc2 arc, GeoCircle2 circle, Tolerance tolerance)
Parameters
arcGeoArc2circleGeoCircle2toleranceTolerance
Returns
Remarks
A circle is an arc that sweeps a whole turn, so the two are joined the way two arcs are.
GetShortestLineTo(GeoArc2, GeoRay2)
Gets the shortest segment leaving an arc and landing on a ray, using the default tolerance.
public static GeoLine2 GetShortestLineTo(GeoArc2 arc, GeoRay2 ray)
Parameters
Returns
GetShortestLineTo(GeoArc2, GeoRay2, Tolerance)
Gets the shortest segment leaving an arc and landing on a ray, within a tolerance.
public static GeoLine2 GetShortestLineTo(GeoArc2 arc, GeoRay2 ray, Tolerance tolerance)
Parameters
Returns
- GeoLine2
A segment leaving the arc and landing on the ray, as long as DistanceTo(GeoArc2, GeoRay2, Tolerance).