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
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.
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
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
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
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
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
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
The shortest distance between circle and rectangle.
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
The shortest distance between circle and polygon.
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
The shortest boundary distance.
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
The shortest boundary distance.
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
The shortest boundary distance.
DistanceTo(GeoPolygon2, GeoPoint2)
Calculates the shortest distance from a polygon boundary to a point.
public static double DistanceTo(GeoPolygon2 poly, GeoPoint2 point)
Parameters
polyGeoPolygon2The polygon.
pointGeoPoint2The target point.
Returns
- double
The shortest distance to the polygon boundary.
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
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
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
The shortest distance.
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
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
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
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
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.
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
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
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
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
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
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
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.
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
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
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
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
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
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
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
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
Exceptions
- ArgumentNullException
Thrown when the loop is null.
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, otherwise the distance to the nearest edge of the face.
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.