Table of Contents

Method DistanceTo

Namespace
GeometryHelper.Core
Assembly
GeometryHelper.dll

DistanceTo(GeoArc2, GeoPoint2)

Gets the distance from an arc to a point, using the default tolerance.

public static double DistanceTo(GeoArc2 arc, GeoPoint2 point)

Parameters

arc GeoArc2
point GeoPoint2

Returns

double

DistanceTo(GeoArc2, GeoPoint2, Tolerance)

Gets the distance from an arc to a point, within a tolerance.

public static double DistanceTo(GeoArc2 arc, GeoPoint2 point, Tolerance tolerance)

Parameters

arc GeoArc2
point GeoPoint2
tolerance Tolerance

Returns

double

Remarks

The distance is the exact one, and the tolerance changes nothing in it: a point at the centre of the arc is as far from it as any other, and a point near the centre is not carried to the arc's start. The arc of radius 50 from (-50, 0) to (50, 0) through (0, 50) is 49.9991 from (0, -0.0009), at a tolerance of a thousandth. The projection ProjectToArc(GeoArc2, GeoPoint2, Tolerance) keeps that snap.

DistanceTo(GeoArc2, GeoLine2)

Gets the distance between an arc and a segment, using the default tolerance.

public static double DistanceTo(GeoArc2 arc, GeoLine2 line)

Parameters

arc GeoArc2
line GeoLine2

Returns

double

DistanceTo(GeoArc2, GeoLine2, Tolerance)

Gets the distance between an arc and a segment, within a tolerance.

public static double DistanceTo(GeoArc2 arc, GeoLine2 line, Tolerance tolerance)

Parameters

arc GeoArc2

The arc.

line GeoLine2

The segment.

tolerance Tolerance

The tolerance.

Returns

double

Nought only where they truly meet, otherwise the gap, measured exactly.

Remarks

The nearest pair is either at an end of one of them, or where the segment runs straight at the centre of the arc. Both are checked, so the answer is exact rather than sampled. A segment ending 0.0005 above the top of the arc of radius 50 about the origin is 0.0005 from it, whatever the tolerance; the tolerance only reads a segment no longer than itself as its start point, and an arc bowing less than its own rounding as its chord. The place facing the centre counts however near the centre the segment passes: at a hundredth, the half circle of radius 0.004 below the origin is 0.004 from the segment along y = -0.008, not the 0.008 of its ends.

DistanceTo(GeoArc2, GeoArc2)

Gets the distance between two arcs, using the default tolerance.

public static double DistanceTo(GeoArc2 first, GeoArc2 second)

Parameters

first GeoArc2
second GeoArc2

Returns

double

DistanceTo(GeoArc2, GeoArc2, Tolerance)

Gets the distance between two arcs, within a tolerance.

public static double DistanceTo(GeoArc2 first, GeoArc2 second, Tolerance tolerance)

Parameters

first GeoArc2

The first arc.

second GeoArc2

The second arc.

tolerance Tolerance

The tolerance, taken so that this reads like every other pair; it changes nothing here.

Returns

double

Nought only where they truly meet, otherwise the gap, measured exactly.

Remarks

The nearest pair is either at an end of one of them, or on the line joining the two centres, where two full circles are nearest. Both are checked. The upper half of the circle of radius 50 about the origin, with its top at (0, 50), and the lower half of the circle of radius 50 about (0, 100.0005), with its bottom at (0, 50.0005), are 0.0005 apart whatever the tolerance; two arcs of one radius that cross 5E-6 of a radian inside both their ends are nought apart.

DistanceTo(GeoArc2, GeoCircle2)

Gets the distance between an arc and a circle.

public static double DistanceTo(GeoArc2 arc, GeoCircle2 circle)

Parameters

arc GeoArc2
circle GeoCircle2

Returns

double

DistanceTo(GeoArc2, GeoCircle2, Tolerance)

Gets the distance between an arc and a circle, within a tolerance.

public static double DistanceTo(GeoArc2 arc, GeoCircle2 circle, Tolerance tolerance)

Parameters

arc GeoArc2
circle GeoCircle2
tolerance Tolerance

Returns

double

Remarks

The circle is read as the disc it bounds, as every closed shape is by DistanceTo: an arc lying inside it, or crossing its rim, is nought away. Beyond it the nearest point of the disc lies on the rim straight towards the centre, so the distance is how near the arc comes to the centre, less the radius. It was measured to the rim as one arc to another, so an arc inside a disc of radius a hundred was seventy away while CollidesWith said the two touched. GetShortestLineTo(GeoArc2, GeoCircle2, Tolerance) still runs rim to rim.

DistanceTo(GeoArc2, GeoRay2)

Gets the distance between an arc and a ray, using the default tolerance.

public static double DistanceTo(GeoArc2 arc, GeoRay2 ray)

Parameters

arc GeoArc2
ray GeoRay2

Returns

double

DistanceTo(GeoArc2, GeoRay2, Tolerance)

Gets the distance between an arc and a ray, within a tolerance.

public static double DistanceTo(GeoArc2 arc, GeoRay2 ray, Tolerance tolerance)

Parameters

arc GeoArc2
ray GeoRay2
tolerance Tolerance

Returns

double

Zero when they cross, otherwise the shortest gap between them.