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
polyGeoPolygon2arcGeoArc2
Returns
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
polyGeoPolygon2arcGeoArc2toleranceTolerance
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
polylineGeoPolyline2arcGeoArc2
Returns
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
polylineGeoPolyline2arcGeoArc2toleranceTolerance
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
rectGeoRectangle2arcGeoArc2
Returns
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
rectGeoRectangle2arcGeoArc2toleranceTolerance
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
rectGeoRectangle2loopGeoPolygonArc2
Returns
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
rectGeoRectangle2loopGeoPolygonArc2toleranceTolerance
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
rectGeoRectangle2chainGeoPolylineArc2
Returns
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
rectGeoRectangle2chainGeoPolylineArc2toleranceTolerance
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
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
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
Returns
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
Returns
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
circleGeoCircle2The circle.
pointGeoPoint2The 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
circleGeoCircle2The circle.
lineGeoLine2The 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
c1GeoCircle2The first circle.
c2GeoCircle2The 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
circleGeoCircle2The circle.
rectGeoRectangle2The 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
circleGeoCircle2The circle.
polyGeoPolygon2The 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
rectGeoRectangle2The rectangle.
pointGeoPoint2The 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
rectGeoRectangle2The rectangle.
lineGeoLine2The 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
rect1GeoRectangle2The first rectangle.
rect2GeoRectangle2The 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
rectGeoRectangle2The rectangle.
polyGeoPolygon2The 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
polyGeoPolygon2The polygon.
pointGeoPoint2The 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
polyGeoPolygon2lineGeoLine2
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
poly1GeoPolygon2poly2GeoPolygon2
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
polylineGeoPolyline2The polyline.
pointGeoPoint2The 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
polylineGeoPolyline2The polyline.
lineGeoLine2The 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
polylineGeoPolyline2rectGeoRectangle2
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
polylineGeoPolyline2polyGeoPolygon2
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
polylineGeoPolyline2circleGeoCircle2
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
pl1GeoPolyline2pl2GeoPolyline2
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
chainGeoPolylineArc2pointGeoPoint2
Returns
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
chainGeoPolylineArc2pointGeoPoint2toleranceTolerance
Returns
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
chainGeoPolylineArc2lineGeoLine2
Returns
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
chainGeoPolylineArc2lineGeoLine2toleranceTolerance
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
chainGeoPolylineArc2arcGeoArc2
Returns
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
chainGeoPolylineArc2arcGeoArc2toleranceTolerance
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
chainGeoPolylineArc2polylineGeoPolyline2
Returns
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
chainGeoPolylineArc2polylineGeoPolyline2toleranceTolerance
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
chainGeoPolylineArc2polygonGeoPolygon2
Returns
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
chainGeoPolylineArc2polygonGeoPolygon2toleranceTolerance
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
chainGeoPolylineArc2otherGeoPolylineArc2
Returns
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
chainGeoPolylineArc2otherGeoPolylineArc2toleranceTolerance
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
chainGeoPolylineArc2loopGeoPolygonArc2
Returns
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
chainGeoPolylineArc2loopGeoPolygonArc2toleranceTolerance
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
loopGeoPolygonArc2pointGeoPoint2
Returns
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
loopGeoPolygonArc2pointGeoPoint2toleranceTolerance
Returns
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
loopGeoPolygonArc2lineGeoLine2
Returns
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
loopGeoPolygonArc2lineGeoLine2toleranceTolerance
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
loopGeoPolygonArc2arcGeoArc2
Returns
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
loopGeoPolygonArc2arcGeoArc2toleranceTolerance
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
loopGeoPolygonArc2polylineGeoPolyline2
Returns
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
loopGeoPolygonArc2polylineGeoPolyline2toleranceTolerance
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
loopGeoPolygonArc2polygonGeoPolygon2
Returns
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
loopGeoPolygonArc2polygonGeoPolygon2toleranceTolerance
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
loopGeoPolygonArc2chainGeoPolylineArc2
Returns
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
loopGeoPolygonArc2chainGeoPolylineArc2toleranceTolerance
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
loopGeoPolygonArc2otherGeoPolygonArc2
Returns
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
loopGeoPolygonArc2otherGeoPolygonArc2toleranceTolerance
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
chainGeoPolylineArc2circleGeoCircle2
Returns
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
chainGeoPolylineArc2circleGeoCircle2toleranceTolerance
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
loopGeoPolygonArc2circleGeoCircle2
Returns
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
loopGeoPolygonArc2circleGeoCircle2toleranceTolerance
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
Returns
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
rayGeoRay2The ray.
pointGeoPoint2The point.
toleranceToleranceThe 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
Returns
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
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
Returns
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
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
circleGeoCircle2rayGeoRay2
Returns
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
circleGeoCircle2rayGeoRay2toleranceTolerance
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
polyGeoPolygon2rayGeoRay2
Returns
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
polyGeoPolygon2rayGeoRay2toleranceTolerance
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
loopGeoPolygonArc2rayGeoRay2
Returns
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
loopGeoPolygonArc2rayGeoRay2toleranceTolerance
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
polylineGeoPolyline2rayGeoRay2
Returns
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
polylineGeoPolyline2rayGeoRay2toleranceTolerance
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
chainGeoPolylineArc2rayGeoRay2
Returns
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
chainGeoPolylineArc2rayGeoRay2toleranceTolerance
Returns
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
rectGeoRectangle2rayGeoRay2
Returns
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
rectGeoRectangle2rayGeoRay2toleranceTolerance
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
Returns
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
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.