Method DistanceTo
- Namespace
- GeometryHelper.Geometry
- Assembly
- GeometryHelper.dll
DistanceTo(GeoPoint2)
Calculates the distance from a point to the closest point on this line segment.
public double DistanceTo(GeoPoint2 point)
Parameters
pointGeoPoint2
Returns
- double
Nought only where they truly meet, otherwise the gap, measured exactly. A segment or straight edge shorter than the global point tolerance is read as its start point.
DistanceTo(GeoArc2)
Calculates the shortest distance from this segment to an arc.
public double DistanceTo(GeoArc2 arc)
Parameters
arcGeoArc2
Returns
- double
Nought only where they truly meet, otherwise the gap, measured exactly. A segment or straight edge shorter than the global point tolerance is read as its start point, except where it crosses a side or an arc.
DistanceTo(GeoArc2, Tolerance)
Calculates the shortest distance from this segment to an arc, within a tolerance.
public double DistanceTo(GeoArc2 arc, Tolerance tolerance)
Parameters
Returns
- double
Nought only where they truly meet, otherwise the gap, measured exactly. A segment or straight edge shorter than the tolerance given is read as its start point, except where it crosses a side or an arc.
DistanceTo(GeoPolygonArc2)
Calculates the shortest distance from this segment to a curved loop.
public double DistanceTo(GeoPolygonArc2 loop)
Parameters
loopGeoPolygonArc2
Returns
- double
Nought only where they truly meet, otherwise the gap, measured exactly. A segment or straight edge shorter than the global point tolerance is read as its start point, except where it crosses a side or an arc.
DistanceTo(GeoPolygonArc2, Tolerance)
Calculates the shortest distance from this segment to a curved loop, within a tolerance.
public double DistanceTo(GeoPolygonArc2 loop, Tolerance tolerance)
Parameters
loopGeoPolygonArc2toleranceTolerance
Returns
- double
Nought only where they truly meet, otherwise the gap, measured exactly. A segment or straight edge shorter than the tolerance given is read as its start point, except where it crosses a side or an arc.
DistanceTo(GeoPolylineArc2)
Calculates the shortest distance from this segment to a curved chain.
public double DistanceTo(GeoPolylineArc2 chain)
Parameters
chainGeoPolylineArc2
Returns
- double
Nought only where they truly meet, otherwise the gap, measured exactly. A segment or straight edge shorter than the global point tolerance is read as its start point, except where it crosses a side or an arc.
DistanceTo(GeoPolylineArc2, Tolerance)
Calculates the shortest distance from this segment to a curved chain, within a tolerance.
public double DistanceTo(GeoPolylineArc2 chain, Tolerance tolerance)
Parameters
chainGeoPolylineArc2toleranceTolerance
Returns
- double
Nought only where they truly meet, otherwise the gap, measured exactly. A segment or straight edge shorter than the tolerance given is read as its start point, except where it crosses a side or an arc.
DistanceTo(GeoLine2)
Calculates the shortest distance from this line segment to another line segment using default tolerance.
public double DistanceTo(GeoLine2 other)
Parameters
otherGeoLine2
Returns
- double
Nought only where they truly meet, otherwise the gap, measured exactly. A segment or straight edge shorter than the global point tolerance is read as its start point.
DistanceTo(GeoLine2, Tolerance)
Calculates the shortest distance from this line segment to another line segment within tolerance.
public double DistanceTo(GeoLine2 other, Tolerance tolerance)
Parameters
Returns
- double
Nought only where they truly meet, otherwise the gap, measured exactly. A segment or straight edge shorter than the tolerance given is read as its start point.
DistanceTo(GeoRectangle2)
Calculates the shortest distance from this line segment to a rectangle.
public double DistanceTo(GeoRectangle2 rect)
Parameters
rectGeoRectangle2
Returns
- double
Nought only where they truly meet, otherwise the gap, measured exactly. A segment or straight edge shorter than the global point tolerance is read as its start point, except where it crosses a side or an arc.
DistanceTo(GeoPolygon2)
Calculates the shortest distance from this line segment to a polygon.
public double DistanceTo(GeoPolygon2 poly)
Parameters
polyGeoPolygon2
Returns
- double
Nought only where they truly meet, otherwise the gap, measured exactly. A segment or straight edge shorter than the global point tolerance is read as its start point, except where it crosses a side or an arc.
DistanceTo(GeoCircle2)
Calculates the shortest distance from this line segment to a circle.
public double DistanceTo(GeoCircle2 circle)
Parameters
circleGeoCircle2
Returns
- double
Nought only where they truly meet, otherwise the gap, measured exactly. A segment or straight edge shorter than the global point tolerance is read as its start point.
DistanceTo(GeoPolyline2)
Calculates the shortest distance from this line segment to a polyline.
public double DistanceTo(GeoPolyline2 polyline)
Parameters
polylineGeoPolyline2
Returns
- double
Nought only where they truly meet, otherwise the gap, measured exactly. A segment or straight edge shorter than the global point tolerance is read as its start point, except where it crosses a side or an arc.
DistanceTo(GeoEdge2)
Gets the distance from this segment to an edge.
public double DistanceTo(GeoEdge2 edge)
Parameters
edgeGeoEdge2
Returns
- double
Nought only where they truly meet, otherwise the gap, measured exactly. A segment or straight edge shorter than the global point tolerance is read as its start point.
DistanceTo(GeoEdge2, Tolerance)
Gets the distance from this segment to an edge, within a tolerance.
public double DistanceTo(GeoEdge2 edge, Tolerance tolerance)
Parameters
Returns
- double
Nought only where they truly meet, otherwise the gap, measured exactly. A segment or straight edge shorter than the tolerance given is read as its start point.
DistanceTo(GeoTriangle2)
Gets the distance from this segment to a triangle.
public double DistanceTo(GeoTriangle2 triangle)
Parameters
triangleGeoTriangle2
Returns
- double
Nought only where they truly meet, otherwise the gap, measured exactly. A segment or straight edge shorter than the global point tolerance is read as its start point, except where it crosses a side or an arc.
DistanceTo(GeoFace2)
Calculates the shortest distance from this segment to the material of a face: the same answer as DistanceTo(GeoLine2).
public double DistanceTo(GeoFace2 face)
Parameters
faceGeoFace2
Returns
- double
Nought only where they truly meet, otherwise the gap, measured exactly.
Remarks
The face is read by its material, its outline less its holes, so this segment is nought from it where the two meet, and as far as the nearest rim where it lies wholly in a hole. The segment from (40, 50) to (60, 50) lies in the hole of the square 100 by 100 with a corner at the origin and a hole 40 by 40 in its middle and is 10 from its rim; the one from (10, 50) to (20, 50) lies on the material and is nought away.
Exceptions
- ArgumentNullException
Thrown when the face is null.
DistanceTo(GeoFace2, Tolerance)
Calculates the shortest distance from this segment to the material of a face, within a tolerance: the same answer as DistanceTo(GeoLine2, Tolerance).
public double DistanceTo(GeoFace2 face, Tolerance tolerance)
Parameters
Returns
- double
Nought only where they truly meet, otherwise the gap, measured exactly.
Remarks
The face is read by its material, its outline less its holes, so this segment is nought from it where the two meet, and as far as the nearest rim where it lies wholly in a hole. The segment from (40, 50) to (60, 50) lies in the hole of the square 100 by 100 with a corner at the origin and a hole 40 by 40 in its middle and is 10 from its rim; the one from (10, 50) to (20, 50) lies on the material and is nought away.
Exceptions
- ArgumentNullException
Thrown when the face is null.
DistanceTo(GeoRay2)
Calculates the shortest distance from this line segment to a ray, using the default tolerance.
public double DistanceTo(GeoRay2 ray)
Parameters
rayGeoRay2
Returns
- double
Nought only where they truly meet, otherwise the gap, measured exactly. A segment or straight edge shorter than the global point tolerance is read as its start point.
DistanceTo(GeoRay2, Tolerance)
Calculates the shortest distance from this line segment to a ray, within a tolerance.
public double DistanceTo(GeoRay2 ray, Tolerance tolerance)
Parameters
Returns
- double
Nought only where they truly meet, otherwise the gap, measured exactly. A segment or straight edge shorter than the tolerance given is read as its start point.
DistanceTo(GeoXLine2)
Calculates the shortest distance from this line segment to an infinite line, using the default tolerance.
public double DistanceTo(GeoXLine2 xline)
Parameters
xlineGeoXLine2
Returns
- double
Nought only where they truly meet, otherwise the gap, measured exactly.
DistanceTo(GeoXLine2, Tolerance)
Calculates the shortest distance from this line segment to an infinite line, within a tolerance.
public double DistanceTo(GeoXLine2 xline, Tolerance tolerance)
Parameters
Returns
- double
Nought only where they truly meet, otherwise the gap, measured exactly.
DistanceTo(GeoSpline2)
Calculates the shortest distance from this line segment to a spline, using the default tolerance.
public double DistanceTo(GeoSpline2 spline)
Parameters
splineGeoSpline2
Returns
- double
Nought only where they truly meet, otherwise the gap, measured exactly.
Exceptions
- ArgumentNullException
Thrown when the spline is null.
DistanceTo(GeoSpline2, Tolerance)
Calculates the shortest distance from this line segment to a spline, within a tolerance.
public double DistanceTo(GeoSpline2 spline, Tolerance tolerance)
Parameters
splineGeoSpline2toleranceTolerance
Returns
- double
Nought only where they truly meet, otherwise the gap, measured exactly; the tolerance is not read.
Exceptions
- ArgumentNullException
Thrown when the spline is null.