Table of Contents

Method DistanceTo

Namespace
GeometryHelper.Core
Assembly
GeometryHelper.dll

DistanceTo(GeoPolygon2, GeoArc2)

Calculates the shortest distance from a polygon to an arc.

public static double DistanceTo(GeoPolygon2 poly, GeoArc2 arc)

Parameters

poly GeoPolygon2
arc GeoArc2

Returns

double

DistanceTo(GeoPolygon2, GeoArc2, Tolerance)

Calculates the shortest distance from a polygon to an arc, within a tolerance.

public static double DistanceTo(GeoPolygon2 poly, GeoArc2 arc, Tolerance tolerance)

Parameters

poly GeoPolygon2
arc GeoArc2
tolerance Tolerance

Returns

double

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

Remarks

A polygon is a filled region here, as everywhere else in this class, so an arc lying wholly inside one is at no distance from it. An arc starting 0.0005 off the square 100 by 100 with a corner at the origin, and running away from it, is 0.0005 from it.

DistanceTo(GeoPolyline2, GeoArc2)

Calculates the shortest distance from a polyline to an arc.

public static double DistanceTo(GeoPolyline2 polyline, GeoArc2 arc)

Parameters

polyline GeoPolyline2
arc GeoArc2

Returns

double

DistanceTo(GeoPolyline2, GeoArc2, Tolerance)

Calculates the shortest distance from a polyline to an arc, within a tolerance.

public static double DistanceTo(GeoPolyline2 polyline, GeoArc2 arc, Tolerance tolerance)

Parameters

polyline GeoPolyline2
arc GeoArc2
tolerance Tolerance

Returns

double

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

DistanceTo(GeoRectangle2, GeoArc2)

Calculates the shortest distance from a rectangle to an arc.

public static double DistanceTo(GeoRectangle2 rect, GeoArc2 arc)

Parameters

rect GeoRectangle2
arc GeoArc2

Returns

double

DistanceTo(GeoRectangle2, GeoArc2, Tolerance)

Calculates the shortest distance from a rectangle to an arc, within a tolerance.

public static double DistanceTo(GeoRectangle2 rect, GeoArc2 arc, Tolerance tolerance)

Parameters

rect GeoRectangle2
arc GeoArc2
tolerance Tolerance

Returns

double

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

DistanceTo(GeoRectangle2, GeoPolygonArc2)

Calculates the shortest distance from a rectangle to a loop that may curve.

public static double DistanceTo(GeoRectangle2 rect, GeoPolygonArc2 loop)

Parameters

rect GeoRectangle2
loop GeoPolygonArc2

Returns

double

DistanceTo(GeoRectangle2, GeoPolygonArc2, Tolerance)

Calculates the shortest distance from a rectangle to a loop that may curve, within a tolerance.

public static double DistanceTo(GeoRectangle2 rect, GeoPolygonArc2 loop, Tolerance tolerance)

Parameters

rect GeoRectangle2
loop GeoPolygonArc2
tolerance Tolerance

Returns

double

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

DistanceTo(GeoRectangle2, GeoPolylineArc2)

Calculates the shortest distance from a rectangle to a chain that may curve.

public static double DistanceTo(GeoRectangle2 rect, GeoPolylineArc2 chain)

Parameters

rect GeoRectangle2
chain GeoPolylineArc2

Returns

double

DistanceTo(GeoRectangle2, GeoPolylineArc2, Tolerance)

Calculates the shortest distance from a rectangle to a chain that may curve, within a tolerance.

public static double DistanceTo(GeoRectangle2 rect, GeoPolylineArc2 chain, Tolerance tolerance)

Parameters

rect GeoRectangle2
chain GeoPolylineArc2
tolerance Tolerance

Returns

double

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

DistanceTo(GeoPoint2, GeoPoint2)

Calculates the Euclidean distance between two points.

public static double DistanceTo(GeoPoint2 p1, GeoPoint2 p2)

Parameters

p1 GeoPoint2

The first point.

p2 GeoPoint2

The second point.

Returns

double

The Euclidean distance between the two points.

DistanceTo(GeoLine2, GeoPoint2)

Calculates the shortest distance from a line segment to a point.

public static double DistanceTo(GeoLine2 line, GeoPoint2 point)

Parameters

line GeoLine2

The line segment.

point GeoPoint2

The target point.

Returns

double

The shortest Euclidean distance.

DistanceTo(GeoLine2, GeoLine2)

Calculates the shortest distance between two line segments using default tolerance.

public static double DistanceTo(GeoLine2 line1, GeoLine2 line2)

Parameters

line1 GeoLine2
line2 GeoLine2

Returns

double

DistanceTo(GeoLine2, GeoLine2, Tolerance)

Calculates the shortest distance between two line segments within tolerance.

public static double DistanceTo(GeoLine2 line1, GeoLine2 line2, Tolerance tolerance)

Parameters

line1 GeoLine2
line2 GeoLine2
tolerance Tolerance

Returns

double

Remarks

Nought exactly where the two truly cross or overlap, read with no slack past their ends; otherwise the least of the distances from an end of one to the other. The segment from the origin to (10, 0) and the one leaving (10.00135, 0.00078) at 60 degrees, whose lines cross 0.0009 past the first one's end, are 0.00156 apart at every tolerance. A segment no longer than the point tolerance is read as its start where it does not truly meet the other: at a thousandth, the one from (5, 0.0015) to (5, 0.0006) is 0.0015 from the segment from the origin to (10, 0), and the one from (5, 0.0004) to (5, -0.0005), crossing it, is nought from it.

DistanceTo(GeoCircle2, GeoPoint2)

Calculates the shortest boundary distance from a circle to a point. Returns 0 if the point is inside the circle.

public static double DistanceTo(GeoCircle2 circle, GeoPoint2 point)

Parameters

circle GeoCircle2

The circle.

point GeoPoint2

The point.

Returns

double

The shortest distance to the circle boundary.

DistanceTo(GeoCircle2, GeoLine2)

Calculates the shortest boundary distance from a circle to a line segment. Returns 0 if the line segment intersects or is inside the circle.

public static double DistanceTo(GeoCircle2 circle, GeoLine2 line)

Parameters

circle GeoCircle2

The circle.

line GeoLine2

The line segment.

Returns

double

The shortest distance between circle and line segment.

DistanceTo(GeoCircle2, GeoCircle2)

Calculates the shortest boundary distance between two circles. Returns 0 if the two circles intersect or overlap.

public static double DistanceTo(GeoCircle2 c1, GeoCircle2 c2)

Parameters

c1 GeoCircle2

The first circle.

c2 GeoCircle2

The second circle.

Returns

double

The shortest boundary distance.

DistanceTo(GeoCircle2, GeoRectangle2)

Calculates the shortest boundary distance from a circle to a rectangle. Returns 0 if they intersect or overlap.

public static double DistanceTo(GeoCircle2 circle, GeoRectangle2 rect)

Parameters

circle GeoCircle2

The circle.

rect GeoRectangle2

The rectangle.

Returns

double

Nought only where they truly meet, otherwise the gap, measured exactly: how far the rectangle is from the centre, less the radius. A circle of radius 0.0001 about (100.00085, 100.00085) is 0.0011 from the square from the origin to (100, 100).

DistanceTo(GeoCircle2, GeoPolygon2)

Calculates the shortest boundary distance from a circle to a polygon. Returns 0 if they intersect or overlap.

public static double DistanceTo(GeoCircle2 circle, GeoPolygon2 poly)

Parameters

circle GeoCircle2

The circle.

poly GeoPolygon2

The polygon.

Returns

double

Nought only where they truly meet, otherwise the gap, measured exactly: how far the polygon is from the centre, less the radius.

DistanceTo(GeoRectangle2, GeoPoint2)

Calculates the shortest Euclidean distance from a rectangle to a point. Returns 0 if the point is inside the rectangle.

public static double DistanceTo(GeoRectangle2 rect, GeoPoint2 point)

Parameters

rect GeoRectangle2

The rectangle.

point GeoPoint2

The target point.

Returns

double

The shortest distance to the rectangle.

DistanceTo(GeoRectangle2, GeoLine2)

Calculates the shortest boundary distance from a rectangle to a line segment. Returns 0 if the line segment intersects or lies inside the rectangle.

public static double DistanceTo(GeoRectangle2 rect, GeoLine2 line)

Parameters

rect GeoRectangle2

The rectangle.

line GeoLine2

The line segment.

Returns

double

Nought only where they truly meet, otherwise the gap, measured exactly. The segment from (100.00085, 100.00085) to (150, 150) is 0.0012 from the square from the origin to (100, 100), and the same segment run the other way is the same.

DistanceTo(GeoRectangle2, GeoRectangle2)

Calculates the shortest boundary distance between two rectangles. Returns 0 if they intersect or overlap.

public static double DistanceTo(GeoRectangle2 rect1, GeoRectangle2 rect2)

Parameters

rect1 GeoRectangle2

The first rectangle.

rect2 GeoRectangle2

The second rectangle.

Returns

double

Nought only where they truly meet, otherwise the gap, measured exactly. Two squares 100 by 100 with their corners 0.00085 apart in x and in y are 0.0012 apart.

DistanceTo(GeoRectangle2, GeoPolygon2)

Calculates the shortest boundary distance from a rectangle to a polygon. Returns 0 if they intersect or overlap.

public static double DistanceTo(GeoRectangle2 rect, GeoPolygon2 poly)

Parameters

rect GeoRectangle2

The rectangle.

poly GeoPolygon2

The polygon.

Returns

double

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

DistanceTo(GeoPolygon2, GeoPoint2)

Calculates the shortest distance from a polygon to a point: nought only where the point lies in the polygon or on its rim, otherwise the gap, measured exactly, the polygon's sides as the sides they are however short. A point 0.0005 off the square 100 by 100 is 0.0005 from it.

public static double DistanceTo(GeoPolygon2 poly, GeoPoint2 point)

Parameters

poly GeoPolygon2

The polygon.

point GeoPoint2

The target point.

Returns

double

Nought for a point in the polygon or on its rim, otherwise the distance to the nearest side.

DistanceTo(GeoPolygon2, GeoLine2)

Calculates the shortest boundary distance from a polygon to a line segment.

public static double DistanceTo(GeoPolygon2 poly, GeoLine2 line)

Parameters

poly GeoPolygon2
line GeoLine2

Returns

double

Nought only where they truly meet, otherwise the gap, measured exactly. The segment from (100.0005, 50) to (150, 50) is 0.0005 from the square 100 by 100 with a corner at the origin, and so is the same segment run the other way.

DistanceTo(GeoPolygon2, GeoPolygon2)

Calculates the shortest boundary distance between two polygons. Returns 0 if they intersect or overlap.

public static double DistanceTo(GeoPolygon2 poly1, GeoPolygon2 poly2)

Parameters

poly1 GeoPolygon2
poly2 GeoPolygon2

Returns

double

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

DistanceTo(GeoPolyline2, GeoPoint2)

Calculates the shortest Euclidean distance from a polyline to a point.

public static double DistanceTo(GeoPolyline2 polyline, GeoPoint2 point)

Parameters

polyline GeoPolyline2

The polyline.

point GeoPoint2

The target point.

Returns

double

The shortest distance to the polyline.

DistanceTo(GeoPolyline2, GeoLine2)

Calculates the shortest distance between a polyline and a line segment. Returns 0 if they intersect.

public static double DistanceTo(GeoPolyline2 polyline, GeoLine2 line)

Parameters

polyline GeoPolyline2

The polyline.

line GeoLine2

The line segment.

Returns

double

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

DistanceTo(GeoPolyline2, GeoRectangle2)

Calculates the shortest distance between a polyline and a rectangle. Returns 0 if they intersect.

public static double DistanceTo(GeoPolyline2 polyline, GeoRectangle2 rect)

Parameters

polyline GeoPolyline2
rect GeoRectangle2

Returns

double

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

DistanceTo(GeoPolyline2, GeoPolygon2)

Calculates the shortest distance between a polyline and a polygon. Returns 0 if they intersect.

public static double DistanceTo(GeoPolyline2 polyline, GeoPolygon2 poly)

Parameters

polyline GeoPolyline2
poly GeoPolygon2

Returns

double

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

DistanceTo(GeoPolyline2, GeoCircle2)

Calculates the shortest distance between a polyline and a circle. Returns 0 if they intersect.

public static double DistanceTo(GeoPolyline2 polyline, GeoCircle2 circle)

Parameters

polyline GeoPolyline2
circle GeoCircle2

Returns

double

Nought only where they truly meet, otherwise the gap, measured exactly. The chain from (0, 40.0005) to (50, 40.0005) is 0.0005 from the circle of radius 40 about the origin.

DistanceTo(GeoPolyline2, GeoPolyline2)

Calculates the shortest distance between two polylines. Returns 0 if they intersect.

public static double DistanceTo(GeoPolyline2 pl1, GeoPolyline2 pl2)

Parameters

pl1 GeoPolyline2
pl2 GeoPolyline2

Returns

double

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

DistanceTo(GeoPolylineArc2, GeoPoint2)

Gets the distance from a chain that may curve to a point.

public static double DistanceTo(GeoPolylineArc2 chain, GeoPoint2 point)

Parameters

chain GeoPolylineArc2
point GeoPoint2

Returns

double

Exceptions

ArgumentNullException

Thrown when the chain is null.

DistanceTo(GeoPolylineArc2, GeoPoint2, Tolerance)

Gets the distance from a chain that may curve to a point, within a tolerance.

public static double DistanceTo(GeoPolylineArc2 chain, GeoPoint2 point, Tolerance tolerance)

Parameters

chain GeoPolylineArc2
point GeoPoint2
tolerance Tolerance

Returns

double

Remarks

Measured to the arcs themselves rather than to the chords that stand in for them elsewhere, so a point beyond a round end is as far away as it looks. The edges are the edges they are, however short, and a point at the centre of an arc is as far from it as any other: the tolerance changes nothing here.

Exceptions

ArgumentNullException

Thrown when the chain is null.

DistanceTo(GeoPolylineArc2, GeoLine2)

Gets the distance from a chain that may curve to a straight segment.

public static double DistanceTo(GeoPolylineArc2 chain, GeoLine2 line)

Parameters

chain GeoPolylineArc2
line GeoLine2

Returns

double

Exceptions

ArgumentNullException

Thrown when the chain is null.

DistanceTo(GeoPolylineArc2, GeoLine2, Tolerance)

Gets the distance from a chain that may curve to a straight segment, within a tolerance.

public static double DistanceTo(GeoPolylineArc2 chain, GeoLine2 line, Tolerance tolerance)

Parameters

chain GeoPolylineArc2
line GeoLine2
tolerance Tolerance

Returns

double

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

Exceptions

ArgumentNullException

Thrown when the chain is null.

DistanceTo(GeoPolylineArc2, GeoArc2)

Gets the distance from a chain that may curve to an arc.

public static double DistanceTo(GeoPolylineArc2 chain, GeoArc2 arc)

Parameters

chain GeoPolylineArc2
arc GeoArc2

Returns

double

Exceptions

ArgumentNullException

Thrown when the chain is null.

DistanceTo(GeoPolylineArc2, GeoArc2, Tolerance)

Gets the distance from a chain that may curve to an arc, within a tolerance.

public static double DistanceTo(GeoPolylineArc2 chain, GeoArc2 arc, Tolerance tolerance)

Parameters

chain GeoPolylineArc2
arc GeoArc2
tolerance Tolerance

Returns

double

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

Exceptions

ArgumentNullException

Thrown when the chain is null.

DistanceTo(GeoPolylineArc2, GeoPolyline2)

Gets the distance from a chain that may curve to a straight chain.

public static double DistanceTo(GeoPolylineArc2 chain, GeoPolyline2 polyline)

Parameters

chain GeoPolylineArc2
polyline GeoPolyline2

Returns

double

Exceptions

ArgumentNullException

Thrown when the chain is null.

DistanceTo(GeoPolylineArc2, GeoPolyline2, Tolerance)

Gets the distance from a chain that may curve to a straight chain, within a tolerance.

public static double DistanceTo(GeoPolylineArc2 chain, GeoPolyline2 polyline, Tolerance tolerance)

Parameters

chain GeoPolylineArc2
polyline GeoPolyline2
tolerance Tolerance

Returns

double

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

Exceptions

ArgumentNullException

Thrown when the chain is null.

ArgumentNullException

Thrown when the polyline is null.

DistanceTo(GeoPolylineArc2, GeoPolygon2)

Gets the distance from a chain that may curve to a straight loop.

public static double DistanceTo(GeoPolylineArc2 chain, GeoPolygon2 polygon)

Parameters

chain GeoPolylineArc2
polygon GeoPolygon2

Returns

double

Exceptions

ArgumentNullException

Thrown when the chain is null.

DistanceTo(GeoPolylineArc2, GeoPolygon2, Tolerance)

Gets the distance from a chain that may curve to a straight loop, within a tolerance.

public static double DistanceTo(GeoPolylineArc2 chain, GeoPolygon2 polygon, Tolerance tolerance)

Parameters

chain GeoPolylineArc2
polygon GeoPolygon2
tolerance Tolerance

Returns

double

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

Exceptions

ArgumentNullException

Thrown when the chain is null.

ArgumentNullException

Thrown when the polygon is null.

DistanceTo(GeoPolylineArc2, GeoPolylineArc2)

Gets the distance from a chain that may curve to a chain that may curve.

public static double DistanceTo(GeoPolylineArc2 chain, GeoPolylineArc2 other)

Parameters

chain GeoPolylineArc2
other GeoPolylineArc2

Returns

double

Exceptions

ArgumentNullException

Thrown when the chain is null.

DistanceTo(GeoPolylineArc2, GeoPolylineArc2, Tolerance)

Gets the distance from a chain that may curve to a chain that may curve, within a tolerance.

public static double DistanceTo(GeoPolylineArc2 chain, GeoPolylineArc2 other, Tolerance tolerance)

Parameters

chain GeoPolylineArc2
other GeoPolylineArc2
tolerance Tolerance

Returns

double

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

Exceptions

ArgumentNullException

Thrown when the chain is null.

ArgumentNullException

Thrown when the other is null.

DistanceTo(GeoPolylineArc2, GeoPolygonArc2)

Gets the distance from a chain that may curve to a loop that may curve.

public static double DistanceTo(GeoPolylineArc2 chain, GeoPolygonArc2 loop)

Parameters

chain GeoPolylineArc2
loop GeoPolygonArc2

Returns

double

Exceptions

ArgumentNullException

Thrown when the chain is null.

DistanceTo(GeoPolylineArc2, GeoPolygonArc2, Tolerance)

Gets the distance from a chain that may curve to a loop that may curve, within a tolerance.

public static double DistanceTo(GeoPolylineArc2 chain, GeoPolygonArc2 loop, Tolerance tolerance)

Parameters

chain GeoPolylineArc2
loop GeoPolygonArc2
tolerance Tolerance

Returns

double

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

Exceptions

ArgumentNullException

Thrown when the chain is null.

ArgumentNullException

Thrown when the loop is null.

DistanceTo(GeoPolygonArc2, GeoPoint2)

Gets the distance from a loop that may curve to a point.

public static double DistanceTo(GeoPolygonArc2 loop, GeoPoint2 point)

Parameters

loop GeoPolygonArc2
point GeoPoint2

Returns

double

Exceptions

ArgumentNullException

Thrown when the loop is null.

DistanceTo(GeoPolygonArc2, GeoPoint2, Tolerance)

Gets the distance from a loop that may curve to a point, within a tolerance.

public static double DistanceTo(GeoPolygonArc2 loop, GeoPoint2 point, Tolerance tolerance)

Parameters

loop GeoPolygonArc2
point GeoPoint2
tolerance Tolerance

Returns

double

Remarks

Measured to the arcs themselves rather than to the chords that stand in for them elsewhere, so a point beyond a round end is as far away as it looks. Nought only where the point lies in the loop or on its rim: a point 0.0005 off the square 100 by 100 with straight edges is 0.0005 from it. The edges are the edges they are, however short.

Exceptions

ArgumentNullException

Thrown when the loop is null.

DistanceTo(GeoPolygonArc2, GeoLine2)

Gets the distance from a loop that may curve to a straight segment.

public static double DistanceTo(GeoPolygonArc2 loop, GeoLine2 line)

Parameters

loop GeoPolygonArc2
line GeoLine2

Returns

double

Exceptions

ArgumentNullException

Thrown when the loop is null.

DistanceTo(GeoPolygonArc2, GeoLine2, Tolerance)

Gets the distance from a loop that may curve to a straight segment, within a tolerance.

public static double DistanceTo(GeoPolygonArc2 loop, GeoLine2 line, Tolerance tolerance)

Parameters

loop GeoPolygonArc2
line GeoLine2
tolerance Tolerance

Returns

double

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

Exceptions

ArgumentNullException

Thrown when the loop is null.

DistanceTo(GeoPolygonArc2, GeoArc2)

Gets the distance from a loop that may curve to an arc.

public static double DistanceTo(GeoPolygonArc2 loop, GeoArc2 arc)

Parameters

loop GeoPolygonArc2
arc GeoArc2

Returns

double

Exceptions

ArgumentNullException

Thrown when the loop is null.

DistanceTo(GeoPolygonArc2, GeoArc2, Tolerance)

Gets the distance from a loop that may curve to an arc, within a tolerance.

public static double DistanceTo(GeoPolygonArc2 loop, GeoArc2 arc, Tolerance tolerance)

Parameters

loop GeoPolygonArc2
arc GeoArc2
tolerance Tolerance

Returns

double

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

Exceptions

ArgumentNullException

Thrown when the loop is null.

DistanceTo(GeoPolygonArc2, GeoPolyline2)

Gets the distance from a loop that may curve to a straight chain.

public static double DistanceTo(GeoPolygonArc2 loop, GeoPolyline2 polyline)

Parameters

loop GeoPolygonArc2
polyline GeoPolyline2

Returns

double

Exceptions

ArgumentNullException

Thrown when the loop is null.

DistanceTo(GeoPolygonArc2, GeoPolyline2, Tolerance)

Gets the distance from a loop that may curve to a straight chain, within a tolerance.

public static double DistanceTo(GeoPolygonArc2 loop, GeoPolyline2 polyline, Tolerance tolerance)

Parameters

loop GeoPolygonArc2
polyline GeoPolyline2
tolerance Tolerance

Returns

double

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

Exceptions

ArgumentNullException

Thrown when the loop is null.

ArgumentNullException

Thrown when the polyline is null.

DistanceTo(GeoPolygonArc2, GeoPolygon2)

Gets the distance from a loop that may curve to a straight loop.

public static double DistanceTo(GeoPolygonArc2 loop, GeoPolygon2 polygon)

Parameters

loop GeoPolygonArc2
polygon GeoPolygon2

Returns

double

Exceptions

ArgumentNullException

Thrown when the loop is null.

DistanceTo(GeoPolygonArc2, GeoPolygon2, Tolerance)

Gets the distance from a loop that may curve to a straight loop, within a tolerance.

public static double DistanceTo(GeoPolygonArc2 loop, GeoPolygon2 polygon, Tolerance tolerance)

Parameters

loop GeoPolygonArc2
polygon GeoPolygon2
tolerance Tolerance

Returns

double

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

Exceptions

ArgumentNullException

Thrown when the loop is null.

ArgumentNullException

Thrown when the polygon is null.

DistanceTo(GeoPolygonArc2, GeoPolylineArc2)

Gets the distance from a loop that may curve to a chain that may curve.

public static double DistanceTo(GeoPolygonArc2 loop, GeoPolylineArc2 chain)

Parameters

loop GeoPolygonArc2
chain GeoPolylineArc2

Returns

double

Exceptions

ArgumentNullException

Thrown when the loop is null.

DistanceTo(GeoPolygonArc2, GeoPolylineArc2, Tolerance)

Gets the distance from a loop that may curve to a chain that may curve, within a tolerance.

public static double DistanceTo(GeoPolygonArc2 loop, GeoPolylineArc2 chain, Tolerance tolerance)

Parameters

loop GeoPolygonArc2
chain GeoPolylineArc2
tolerance Tolerance

Returns

double

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

Exceptions

ArgumentNullException

Thrown when the loop is null.

ArgumentNullException

Thrown when the chain is null.

DistanceTo(GeoPolygonArc2, GeoPolygonArc2)

Gets the distance from a loop that may curve to a loop that may curve.

public static double DistanceTo(GeoPolygonArc2 loop, GeoPolygonArc2 other)

Parameters

loop GeoPolygonArc2
other GeoPolygonArc2

Returns

double

Exceptions

ArgumentNullException

Thrown when the loop is null.

DistanceTo(GeoPolygonArc2, GeoPolygonArc2, Tolerance)

Gets the distance from a loop that may curve to a loop that may curve, within a tolerance.

public static double DistanceTo(GeoPolygonArc2 loop, GeoPolygonArc2 other, Tolerance tolerance)

Parameters

loop GeoPolygonArc2
other GeoPolygonArc2
tolerance Tolerance

Returns

double

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

Exceptions

ArgumentNullException

Thrown when the loop is null.

ArgumentNullException

Thrown when the other is null.

DistanceTo(GeoPolylineArc2, GeoCircle2)

Gets the distance from a chain that may curve to a circle.

public static double DistanceTo(GeoPolylineArc2 chain, GeoCircle2 circle)

Parameters

chain GeoPolylineArc2
circle GeoCircle2

Returns

double

Exceptions

ArgumentNullException

Thrown when the chain is null.

DistanceTo(GeoPolylineArc2, GeoCircle2, Tolerance)

Gets the distance from a chain that may curve to a circle, within a tolerance.

public static double DistanceTo(GeoPolylineArc2 chain, GeoCircle2 circle, Tolerance tolerance)

Parameters

chain GeoPolylineArc2
circle GeoCircle2
tolerance Tolerance

Returns

double

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

Exceptions

ArgumentNullException

Thrown when the chain is null.

DistanceTo(GeoPolygonArc2, GeoCircle2)

Gets the distance from a loop that may curve to a circle.

public static double DistanceTo(GeoPolygonArc2 loop, GeoCircle2 circle)

Parameters

loop GeoPolygonArc2
circle GeoCircle2

Returns

double

Exceptions

ArgumentNullException

Thrown when the loop is null.

DistanceTo(GeoPolygonArc2, GeoCircle2, Tolerance)

Gets the distance from a loop that may curve to a circle, within a tolerance.

public static double DistanceTo(GeoPolygonArc2 loop, GeoCircle2 circle, Tolerance tolerance)

Parameters

loop GeoPolygonArc2
circle GeoCircle2
tolerance Tolerance

Returns

double

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

Exceptions

ArgumentNullException

Thrown when the loop is null.

DistanceTo(GeoRay2, GeoPoint2)

Calculates the distance from a ray to a point, using the default tolerance.

public static double DistanceTo(GeoRay2 ray, GeoPoint2 point)

Parameters

ray GeoRay2
point GeoPoint2

Returns

double

DistanceTo(GeoRay2, GeoPoint2, Tolerance)

Calculates the distance from a ray to a point, within a tolerance.

public static double DistanceTo(GeoRay2 ray, GeoPoint2 point, Tolerance tolerance)

Parameters

ray GeoRay2

The ray.

point GeoPoint2

The point.

tolerance Tolerance

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

Returns

double

The distance from the point to its projection on the ray, stopped at the origin.

DistanceTo(GeoRay2, GeoLine2)

Calculates the shortest distance between a ray and a line segment, using the default tolerance.

public static double DistanceTo(GeoRay2 ray, GeoLine2 line)

Parameters

ray GeoRay2
line GeoLine2

Returns

double

DistanceTo(GeoRay2, GeoLine2, Tolerance)

Calculates the shortest distance between a ray and a line segment, within a tolerance.

public static double DistanceTo(GeoRay2 ray, GeoLine2 line, Tolerance tolerance)

Parameters

ray GeoRay2
line GeoLine2
tolerance Tolerance

Returns

double

Zero where the two cross or touch; otherwise the gap between them.

DistanceTo(GeoRay2, GeoRay2)

Calculates the shortest distance between two rays, using the default tolerance.

public static double DistanceTo(GeoRay2 ray1, GeoRay2 ray2)

Parameters

ray1 GeoRay2
ray2 GeoRay2

Returns

double

DistanceTo(GeoRay2, GeoRay2, Tolerance)

Calculates the shortest distance between two rays, within a tolerance.

public static double DistanceTo(GeoRay2 ray1, GeoRay2 ray2, Tolerance tolerance)

Parameters

ray1 GeoRay2

The first ray.

ray2 GeoRay2

The second ray.

tolerance Tolerance

The tolerance.

Returns

double

Zero where the two truly cross at any angle, at or ahead of both origins; otherwise the distance of the nearer of the two origins to the other ray, kept even where it is within the point tolerance, as two segments keep theirs. The ray from (0.0009, 0) along X and the one leaving 0.0009 along 120 degrees from the origin, whose carriers cross 0.0009 behind each, are 0.00156 apart, origin to origin, at every tolerance. Two rays along the X axis from 0 and from 100, facing each other, are nought apart; two at half a degree that meet a thousand along are nought apart too, though TryIntersectWith(GeoRay2, GeoRay2, out GeoPoint2, Tolerance) calls them parallel. Two parallel but for rounding do not cross where a double cannot place the crossing, as two lines without ends do not: a ray rebuilt through two points a hundred apart of another moved 10 to its side is 10 from it.

Remarks

The ray from the origin along X and the one from (50, 30) along Y are 30 apart, the second origin standing over the first ray; the one from (50, -30) along Y crosses the first at (50, 0) and is nought from it.

DistanceTo(GeoCircle2, GeoRay2)

Calculates the shortest distance between a circle and a ray, using the default tolerance.

public static double DistanceTo(GeoCircle2 circle, GeoRay2 ray)

Parameters

circle GeoCircle2
ray GeoRay2

Returns

double

DistanceTo(GeoCircle2, GeoRay2, Tolerance)

Calculates the shortest distance between a circle and a ray, within a tolerance.

public static double DistanceTo(GeoCircle2 circle, GeoRay2 ray, Tolerance tolerance)

Parameters

circle GeoCircle2
ray GeoRay2
tolerance Tolerance

Returns

double

Zero where the ray starts inside the circle or runs into it; otherwise the gap between them.

DistanceTo(GeoPolygon2, GeoRay2)

Calculates the shortest distance between a polygon and a ray, using the default tolerance.

public static double DistanceTo(GeoPolygon2 poly, GeoRay2 ray)

Parameters

poly GeoPolygon2
ray GeoRay2

Returns

double

Exceptions

ArgumentNullException

Thrown when the polygon is null.

DistanceTo(GeoPolygon2, GeoRay2, Tolerance)

Calculates the shortest distance between a polygon and a ray, within a tolerance.

public static double DistanceTo(GeoPolygon2 poly, GeoRay2 ray, Tolerance tolerance)

Parameters

poly GeoPolygon2
ray GeoRay2
tolerance Tolerance

Returns

double

Nought only where the ray starts in the polygon, on its rim included, or runs into it; otherwise the gap, measured exactly. The ray from (100.0005, 50) along X is 0.0005 from the square 100 by 100 with a corner at the origin.

Exceptions

ArgumentNullException

Thrown when the polygon is null.

DistanceTo(GeoPolygonArc2, GeoRay2)

Calculates the shortest distance between a curved loop and a ray, using the default tolerance.

public static double DistanceTo(GeoPolygonArc2 loop, GeoRay2 ray)

Parameters

loop GeoPolygonArc2
ray GeoRay2

Returns

double

Exceptions

ArgumentNullException

Thrown when the loop is null.

DistanceTo(GeoPolygonArc2, GeoRay2, Tolerance)

Calculates the shortest distance between a curved loop and a ray, within a tolerance.

public static double DistanceTo(GeoPolygonArc2 loop, GeoRay2 ray, Tolerance tolerance)

Parameters

loop GeoPolygonArc2
ray GeoRay2
tolerance Tolerance

Returns

double

Nought only where the ray starts in the loop, on its rim included, or runs into it; otherwise the gap, measured exactly, an arc of the loop included. The ray from (150.0005, 50) along X is 0.0005 from the square 100 by 100 with a corner at the origin whose right side is bowed out to x = 150 by a bulge of 1.

Exceptions

ArgumentNullException

Thrown when the loop is null.

DistanceTo(GeoPolyline2, GeoRay2)

Calculates the shortest distance between a polyline and a ray, using the default tolerance.

public static double DistanceTo(GeoPolyline2 polyline, GeoRay2 ray)

Parameters

polyline GeoPolyline2
ray GeoRay2

Returns

double

Exceptions

ArgumentNullException

Thrown when the polyline is null.

DistanceTo(GeoPolyline2, GeoRay2, Tolerance)

Calculates the shortest distance between a polyline and a ray, within a tolerance.

public static double DistanceTo(GeoPolyline2 polyline, GeoRay2 ray, Tolerance tolerance)

Parameters

polyline GeoPolyline2
ray GeoRay2
tolerance Tolerance

Returns

double

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

Exceptions

ArgumentNullException

Thrown when the polyline is null.

DistanceTo(GeoPolylineArc2, GeoRay2)

Calculates the shortest distance between a curved chain and a ray, using the default tolerance.

public static double DistanceTo(GeoPolylineArc2 chain, GeoRay2 ray)

Parameters

chain GeoPolylineArc2
ray GeoRay2

Returns

double

Exceptions

ArgumentNullException

Thrown when the chain is null.

DistanceTo(GeoPolylineArc2, GeoRay2, Tolerance)

Calculates the shortest distance between a curved chain and a ray, within a tolerance.

public static double DistanceTo(GeoPolylineArc2 chain, GeoRay2 ray, Tolerance tolerance)

Parameters

chain GeoPolylineArc2
ray GeoRay2
tolerance Tolerance

Returns

double

Exceptions

ArgumentNullException

Thrown when the chain is null.

DistanceTo(GeoRectangle2, GeoRay2)

Calculates the shortest distance between a rectangle and a ray, using the default tolerance.

public static double DistanceTo(GeoRectangle2 rect, GeoRay2 ray)

Parameters

rect GeoRectangle2
ray GeoRay2

Returns

double

DistanceTo(GeoRectangle2, GeoRay2, Tolerance)

Calculates the shortest distance between a rectangle and a ray, within a tolerance.

public static double DistanceTo(GeoRectangle2 rect, GeoRay2 ray, Tolerance tolerance)

Parameters

rect GeoRectangle2
ray GeoRay2
tolerance Tolerance

Returns

double

Nought only where the ray starts in the rectangle, on its side included, or runs into it; otherwise the gap, measured exactly. The ray from (100.00085, 100.00085) along (1, 2) is 0.0012 from the square from the origin to (100, 100).

DistanceTo(GeoFace2, GeoPoint2)

Calculates the shortest distance from a face to a point.

public static double DistanceTo(GeoFace2 face, GeoPoint2 point)

Parameters

face GeoFace2
point GeoPoint2

Returns

double

DistanceTo(GeoFace2, GeoPoint2, Tolerance)

Calculates the shortest distance from a face to a point, within a tolerance.

public static double DistanceTo(GeoFace2 face, GeoPoint2 point, Tolerance tolerance)

Parameters

face GeoFace2

The face.

point GeoPoint2

The point.

tolerance Tolerance

The tolerance.

Returns

double

Nought for a point on the material or on a rim, otherwise the distance to the nearest edge of the face, measured exactly: a point 0.0005 off the outline, or 0.0005 inside a hole, is 0.0005 away.

Remarks

A face is a filled region with holes in it, so this reads it the way the rest of the class reads a polygon: a point on the material is nought away. A point in a hole is off the material, and is measured to the rim it sits in rather than out to the outline.