Method DistanceTo
- Namespace
- GeometryHelper.Geometry
- Assembly
- GeometryHelper.dll
DistanceTo(GeoPoint3)
Gets the distance from this spline to a point, using the default tolerance.
public double DistanceTo(GeoPoint3 point)
Parameters
pointGeoPoint3The point.
Returns
- double
The distance from the point to the nearest point of the curve. Nought only where the point truly lies on it, otherwise the gap, measured exactly; exact to rounding, however the curve bends.
DistanceTo(GeoPoint3, Tolerance)
Gets the distance from this spline to a point, within a tolerance.
public double DistanceTo(GeoPoint3 point, Tolerance tolerance)
Parameters
pointGeoPoint3The point.
toleranceToleranceThe tolerance; not read, since the nearest point takes none.
Returns
- double
The distance from the point to the nearest point of the curve, measured exactly. The circle of radius 100 about the origin in the floor, as FromCircle(GeoCircle3) makes it, is 60 from (160, 0, 0), 100 from its own centre and 104.4 from (0, 0, 30), which is 100 across and 30 up from every point of the rim.
Remarks
The nearest point is found as GetKnotAtPoint(GeoPoint3) finds it: on each span the parameters where the curve stops coming nearer, all of them, from the roots of a polynomial in Bernstein form, and the ends; whichever span cannot be nearer than the best found, by the box of its control points, is not solved. The boxes are kept in a tree, built once, so the spans near the point are reached without looking at the rest: a query costs time in the logarithm of the number of spans and the number whose boxes are near the point, as in the plane.
DistanceTo(GeoLine3)
Calculates the shortest distance from this spline to a line segment, using the default tolerance.
public double DistanceTo(GeoLine3 line)
Parameters
lineGeoLine3
Returns
- double
Nought only where they truly meet, otherwise the gap, measured exactly.
DistanceTo(GeoLine3, Tolerance)
Calculates the shortest distance from this spline to a line segment, within a tolerance.
public double DistanceTo(GeoLine3 line, Tolerance tolerance)
Parameters
lineGeoLine3The line segment.
toleranceToleranceThe tolerance: a line segment no longer than its point tolerance is read as its start where it does not truly meet the spline.
Returns
- double
Nought only where they truly meet, a crossing or a touch found to rounding, otherwise the gap, measured exactly.
DistanceTo(GeoRay3)
Calculates the shortest distance from this spline to a ray, using the default tolerance.
public double DistanceTo(GeoRay3 ray)
Parameters
rayGeoRay3
Returns
- double
Nought only where they truly meet, otherwise the gap, measured exactly.
DistanceTo(GeoRay3, Tolerance)
Calculates the shortest distance from this spline to a ray, within a tolerance.
public double DistanceTo(GeoRay3 ray, Tolerance tolerance)
Parameters
rayGeoRay3The ray.
toleranceToleranceThe tolerance; not read, since a distance is measured rather than judged.
Returns
- double
Nought only where they truly meet, a crossing or a touch found to rounding, otherwise the gap, measured exactly.
DistanceTo(GeoXLine3)
Calculates the shortest distance from this spline to an infinite line, using the default tolerance.
public double DistanceTo(GeoXLine3 xline)
Parameters
xlineGeoXLine3
Returns
- double
Nought only where they truly meet, otherwise the gap, measured exactly.
DistanceTo(GeoXLine3, Tolerance)
Calculates the shortest distance from this spline to an infinite line, within a tolerance.
public double DistanceTo(GeoXLine3 xline, Tolerance tolerance)
Parameters
xlineGeoXLine3The infinite line.
toleranceToleranceThe tolerance; not read, since a distance is measured rather than judged.
Returns
- double
Nought only where they truly meet, a crossing or a touch found to rounding, otherwise the gap, measured exactly.
DistanceTo(GeoPlane3)
Calculates the shortest distance from this spline to a plane, using the default tolerance.
public double DistanceTo(GeoPlane3 plane)
Parameters
planeGeoPlane3
Returns
- double
Nought only where they truly meet, otherwise the gap, measured exactly.
DistanceTo(GeoPlane3, Tolerance)
Calculates the shortest distance from this spline to a plane, within a tolerance.
public double DistanceTo(GeoPlane3 plane, Tolerance tolerance)
Parameters
planeGeoPlane3The plane.
toleranceToleranceThe tolerance; not read, since a distance is measured rather than judged.
Returns
- double
Nought only where they truly meet, a crossing or a touch found to rounding, otherwise the gap, measured exactly.
Remarks
A plane is a surface without ends, not a half of space: a spline that lies off it on one side is as far from it as its nearest point.
DistanceTo(GeoPolyline3)
Calculates the shortest distance from this spline to a polyline, using the default tolerance.
public double DistanceTo(GeoPolyline3 polyline)
Parameters
polylineGeoPolyline3
Returns
- double
Nought only where they truly meet, otherwise the gap, measured exactly.
Exceptions
- ArgumentNullException
Thrown when the polyline is null.
DistanceTo(GeoPolyline3, Tolerance)
Calculates the shortest distance from this spline to a polyline, within a tolerance.
public double DistanceTo(GeoPolyline3 polyline, Tolerance tolerance)
Parameters
polylineGeoPolyline3The polyline.
toleranceToleranceThe tolerance; not read, since a distance is measured rather than judged.
Returns
- double
Nought only where they truly meet, a crossing or a touch found to rounding, otherwise the gap, measured exactly.
Exceptions
- ArgumentNullException
Thrown when the polyline is null.
DistanceTo(GeoPolygon3)
Calculates the shortest distance from this spline to a polygon, using the default tolerance.
public double DistanceTo(GeoPolygon3 polygon)
Parameters
polygonGeoPolygon3
Returns
- double
Nought only where they truly meet, otherwise the gap, measured exactly.
Exceptions
- ArgumentNullException
Thrown when the polygon is null.
DistanceTo(GeoPolygon3, Tolerance)
Calculates the shortest distance from this spline to a polygon, within a tolerance.
public double DistanceTo(GeoPolygon3 polygon, Tolerance tolerance)
Parameters
polygonGeoPolygon3The polygon.
toleranceToleranceThe tolerance; not read, since a distance is measured rather than judged.
Returns
- double
Nought only where they truly meet, a crossing or a touch found to rounding, otherwise the gap, measured exactly.
Remarks
A polygon is a flat region here, as every curve reads it: a spline that pierces it, or lies in it, is nought from it.
Exceptions
- ArgumentNullException
Thrown when the polygon is null.
DistanceTo(GeoTriangle3)
Calculates the shortest distance from this spline to a triangle, using the default tolerance.
public double DistanceTo(GeoTriangle3 triangle)
Parameters
triangleGeoTriangle3
Returns
- double
Nought only where they truly meet, otherwise the gap, measured exactly.
DistanceTo(GeoTriangle3, Tolerance)
Calculates the shortest distance from this spline to a triangle, within a tolerance.
public double DistanceTo(GeoTriangle3 triangle, Tolerance tolerance)
Parameters
triangleGeoTriangle3The triangle.
toleranceToleranceThe tolerance; not read, since a distance is measured rather than judged.
Returns
- double
Nought only where they truly meet, a crossing or a touch found to rounding, otherwise the gap, measured exactly.
Remarks
A triangle is a flat region here, as every curve reads it: a spline that pierces it, or lies in it, is nought from it.
DistanceTo(GeoFace3)
Calculates the shortest distance from this spline to a face, using the default tolerance.
public double DistanceTo(GeoFace3 face)
Parameters
faceGeoFace3
Returns
- double
Nought only where they truly meet, otherwise the gap, measured exactly.
Exceptions
- ArgumentNullException
Thrown when the face is null.
DistanceTo(GeoFace3, Tolerance)
Calculates the shortest distance from this spline to a face, within a tolerance.
public double DistanceTo(GeoFace3 face, Tolerance tolerance)
Parameters
faceGeoFace3The face.
toleranceToleranceThe tolerance; not read, since a distance is measured rather than judged.
Returns
- double
Nought only where they truly meet, a crossing or a touch found to rounding, otherwise the gap, measured exactly.
Remarks
A face is a flat region here, as every curve reads it: a spline that pierces it, or lies in it, is nought from it.
Exceptions
- ArgumentNullException
Thrown when the face is null.
DistanceTo(GeoAabb3)
Calculates the shortest distance from this spline to an axis-aligned box, using the default tolerance.
public double DistanceTo(GeoAabb3 box)
Parameters
boxGeoAabb3
Returns
- double
Nought only where they truly meet, otherwise the gap, measured exactly.
DistanceTo(GeoAabb3, Tolerance)
Calculates the shortest distance from this spline to an axis-aligned box, within a tolerance.
public double DistanceTo(GeoAabb3 box, Tolerance tolerance)
Parameters
boxGeoAabb3The box.
toleranceToleranceThe tolerance; not read, since a distance is measured rather than judged.
Returns
- double
Nought only where they truly meet, a crossing or a touch found to rounding, otherwise the gap, measured exactly.
Remarks
An axis-aligned box is material here, as every curve reads a body: a spline inside it is nought from it, though it crosses nothing.
DistanceTo(GeoObb3)
Calculates the shortest distance from this spline to an oriented box, using the default tolerance.
public double DistanceTo(GeoObb3 box)
Parameters
boxGeoObb3
Returns
- double
Nought only where they truly meet, otherwise the gap, measured exactly.
Exceptions
- ArgumentNullException
Thrown when the box is null.
DistanceTo(GeoObb3, Tolerance)
Calculates the shortest distance from this spline to an oriented box, within a tolerance.
public double DistanceTo(GeoObb3 box, Tolerance tolerance)
Parameters
boxGeoObb3The box.
toleranceToleranceThe tolerance; not read, since a distance is measured rather than judged.
Returns
- double
Nought only where they truly meet, a crossing or a touch found to rounding, otherwise the gap, measured exactly.
Remarks
An oriented box is material here, as every curve reads a body: a spline inside it is nought from it, though it crosses nothing.
Exceptions
- ArgumentNullException
Thrown when the box is null.
DistanceTo(GeoSolid3)
Calculates the shortest distance from this spline to a solid, using the default tolerance.
public double DistanceTo(GeoSolid3 solid)
Parameters
solidGeoSolid3
Returns
- double
Nought only where they truly meet, otherwise the gap, measured exactly.
Exceptions
- ArgumentNullException
Thrown when the solid is null.
DistanceTo(GeoSolid3, Tolerance)
Calculates the shortest distance from this spline to a solid, within a tolerance.
public double DistanceTo(GeoSolid3 solid, Tolerance tolerance)
Parameters
solidGeoSolid3The solid.
toleranceToleranceThe tolerance; read only to cut the solid's openings in, since a distance is measured rather than judged.
Returns
- double
Nought only where they truly meet, a crossing or a touch found to rounding, otherwise the gap, measured exactly.
Remarks
A solid is material here, as every curve reads a body: a spline inside it is nought from it, though it crosses nothing.
Exceptions
- ArgumentNullException
Thrown when the solid is null.
DistanceTo(GeoSphere3)
Calculates the shortest distance from this spline to a ball, using the default tolerance.
public double DistanceTo(GeoSphere3 sphere)
Parameters
sphereGeoSphere3
Returns
- double
Nought only where they truly meet, otherwise the gap, measured exactly.
DistanceTo(GeoSphere3, Tolerance)
Calculates the shortest distance from this spline to a ball, within a tolerance.
public double DistanceTo(GeoSphere3 sphere, Tolerance tolerance)
Parameters
sphereGeoSphere3The ball.
toleranceToleranceThe tolerance; not read, since a distance is measured rather than judged.
Returns
- double
Nought only where they truly meet, a crossing or a touch found to rounding, otherwise the gap, measured exactly.
Remarks
A ball is material here, as every curve reads a body: a spline inside it is nought from it, though it crosses nothing.
DistanceTo(GeoArc3)
Calculates the shortest distance from this spline to an arc, using the default tolerance.
public double DistanceTo(GeoArc3 arc)
Parameters
arcGeoArc3
Returns
- double
Nought only where they truly meet, otherwise the gap, measured exactly.
DistanceTo(GeoArc3, Tolerance)
Calculates the shortest distance from this spline to an arc, within a tolerance.
public double DistanceTo(GeoArc3 arc, Tolerance tolerance)
Parameters
arcGeoArc3The arc.
toleranceToleranceThe tolerance; not read, since a distance is measured rather than judged.
Returns
- double
Nought only where they truly meet, a crossing or a touch found to rounding, otherwise the gap, measured exactly.
DistanceTo(GeoCircle3)
Calculates the shortest distance from this spline to a circle, using the default tolerance.
public double DistanceTo(GeoCircle3 circle)
Parameters
circleGeoCircle3
Returns
- double
Nought only where they truly meet, otherwise the gap, measured exactly.
DistanceTo(GeoCircle3, Tolerance)
Calculates the shortest distance from this spline to a circle, within a tolerance.
public double DistanceTo(GeoCircle3 circle, Tolerance tolerance)
Parameters
circleGeoCircle3The circle.
toleranceToleranceThe tolerance; not read, since a distance is measured rather than judged.
Returns
- double
Nought only where they truly meet, a crossing or a touch found to rounding, otherwise the gap, measured exactly.
Remarks
A circle is read as the disc it is for the distance, as its own distance to a point reads it: a spline that pierces the disc, or lies in it, is nought from it, though it meets no rim.
DistanceTo(GeoEllipse3)
Calculates the shortest distance from this spline to an ellipse, using the default tolerance.
public double DistanceTo(GeoEllipse3 ellipse)
Parameters
ellipseGeoEllipse3
Returns
- double
Nought only where they truly meet, otherwise the gap, measured exactly.
DistanceTo(GeoEllipse3, Tolerance)
Calculates the shortest distance from this spline to an ellipse, within a tolerance.
public double DistanceTo(GeoEllipse3 ellipse, Tolerance tolerance)
Parameters
ellipseGeoEllipse3The ellipse.
toleranceToleranceThe tolerance; not read, since a distance is measured rather than judged.
Returns
- double
Nought only where they truly meet, a crossing or a touch found to rounding, otherwise the gap, measured exactly.
Remarks
An ellipse is read as the disc it is for the distance, as its own distance to a point reads it: a spline that pierces the disc, or lies in it, is nought from it, though it meets no rim.
DistanceTo(GeoEdge3)
Calculates the shortest distance from this spline to an edge, using the default tolerance.
public double DistanceTo(GeoEdge3 edge)
Parameters
edgeGeoEdge3
Returns
- double
Nought only where they truly meet, otherwise the gap, measured exactly.
DistanceTo(GeoEdge3, Tolerance)
Calculates the shortest distance from this spline to an edge, within a tolerance.
public double DistanceTo(GeoEdge3 edge, Tolerance tolerance)
Parameters
edgeGeoEdge3The edge.
toleranceToleranceThe tolerance: a straight edge no longer than its point tolerance is read as its start where it does not truly meet the spline.
Returns
- double
Nought only where they truly meet, a crossing or a touch found to rounding, otherwise the gap, measured exactly.
DistanceTo(GeoPolylineArc3)
Calculates the shortest distance from this spline to a curved chain, using the default tolerance.
public double DistanceTo(GeoPolylineArc3 chain)
Parameters
chainGeoPolylineArc3
Returns
- double
Nought only where they truly meet, otherwise the gap, measured exactly.
Exceptions
- ArgumentNullException
Thrown when the chain is null.
DistanceTo(GeoPolylineArc3, Tolerance)
Calculates the shortest distance from this spline to a curved chain, within a tolerance.
public double DistanceTo(GeoPolylineArc3 chain, Tolerance tolerance)
Parameters
chainGeoPolylineArc3The curved chain.
toleranceToleranceThe tolerance; not read, since a distance is measured rather than judged.
Returns
- double
Nought only where they truly meet, a crossing or a touch found to rounding, otherwise the gap, measured exactly.
Exceptions
- ArgumentNullException
Thrown when the chain is null.
DistanceTo(GeoPolygonArc3)
Calculates the shortest distance from this spline to a curved loop, using the default tolerance.
public double DistanceTo(GeoPolygonArc3 loop)
Parameters
loopGeoPolygonArc3
Returns
- double
Nought only where they truly meet, otherwise the gap, measured exactly.
Exceptions
- ArgumentNullException
Thrown when the loop is null.
DistanceTo(GeoPolygonArc3, Tolerance)
Calculates the shortest distance from this spline to a curved loop, within a tolerance.
public double DistanceTo(GeoPolygonArc3 loop, Tolerance tolerance)
Parameters
loopGeoPolygonArc3The curved loop.
toleranceToleranceThe tolerance; not read, since a distance is measured rather than judged.
Returns
- double
Nought only where they truly meet, a crossing or a touch found to rounding, otherwise the gap, measured exactly.
Remarks
A curved loop is measured to its outline, as its own distance to a point is: a spline inside it is not nought from it.
Exceptions
- ArgumentNullException
Thrown when the loop is null.
DistanceTo(GeoSpline3)
Calculates the shortest distance from this spline to another, using the default tolerance.
public double DistanceTo(GeoSpline3 other)
Parameters
otherGeoSpline3
Returns
- double
Nought only where they truly meet, otherwise the gap, measured exactly.
Exceptions
- ArgumentNullException
Thrown when the other spline is null.
DistanceTo(GeoSpline3, Tolerance)
Calculates the shortest distance from this spline to another, within a tolerance.
public double DistanceTo(GeoSpline3 other, Tolerance tolerance)
Parameters
otherGeoSpline3The other spline.
toleranceToleranceThe tolerance; not read, since a distance is measured rather than judged.
Returns
- double
Nought only where they truly meet, a crossing or a touch found to rounding, otherwise the gap, measured exactly.
Exceptions
- ArgumentNullException
Thrown when the other spline is null.