Table of Contents

Method DistanceTo

Namespace
GeometryHelper.Geometry
Assembly
GeometryHelper.dll

DistanceTo(GeoPoint2)

Gets the distance from this spline to a point, using the default tolerance.

public double DistanceTo(GeoPoint2 point)

Parameters

point GeoPoint2

The point.

Returns

double

The distance from the point to the nearest point of the curve, which is a line and not a region: a point inside a closed spline is as far from it as from the nearest of its points. Nought only where the point truly lies on it, otherwise the gap, measured exactly; exact to rounding, however the curve bends.

DistanceTo(GeoPoint2, Tolerance)

Gets the distance from this spline to a point, within a tolerance.

public double DistanceTo(GeoPoint2 point, Tolerance tolerance)

Parameters

point GeoPoint2

The point.

tolerance Tolerance

The 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, as FromCircle(GeoCircle2) makes it, is 60 from (160, 0) and 100 from its own centre.

Remarks

The nearest point is found as GetKnotAtPoint(GeoPoint2) 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, about 10 microseconds on a spiral of 100 000 spans where it was 0.5 ms before the tree, and a span solved costs about a microsecond. A spline of up to 24 spans looks at its boxes one by one, which is faster for so few.

DistanceTo(GeoLine2)

Calculates the shortest distance from this spline to a line segment, using the default tolerance.

public double DistanceTo(GeoLine2 line)

Parameters

line GeoLine2

Returns

double

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

DistanceTo(GeoLine2, Tolerance)

Calculates the shortest distance from this spline to a line segment, within a tolerance.

public double DistanceTo(GeoLine2 line, Tolerance tolerance)

Parameters

line GeoLine2

The line segment.

tolerance Tolerance

The 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(GeoRay2)

Calculates the shortest distance from this spline to a ray, using the default tolerance.

public double DistanceTo(GeoRay2 ray)

Parameters

ray GeoRay2

Returns

double

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

DistanceTo(GeoRay2, Tolerance)

Calculates the shortest distance from this spline to a ray, within a tolerance.

public double DistanceTo(GeoRay2 ray, Tolerance tolerance)

Parameters

ray GeoRay2

The ray.

tolerance Tolerance

The 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(GeoXLine2)

Calculates the shortest distance from this spline to an infinite line, using the default tolerance.

public double DistanceTo(GeoXLine2 xline)

Parameters

xline GeoXLine2

Returns

double

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

DistanceTo(GeoXLine2, Tolerance)

Calculates the shortest distance from this spline to an infinite line, within a tolerance.

public double DistanceTo(GeoXLine2 xline, Tolerance tolerance)

Parameters

xline GeoXLine2

The infinite line.

tolerance Tolerance

The 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(GeoPolyline2)

Calculates the shortest distance from this spline to a polyline, using the default tolerance.

public double DistanceTo(GeoPolyline2 polyline)

Parameters

polyline GeoPolyline2

Returns

double

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

Exceptions

ArgumentNullException

Thrown when the polyline is null.

DistanceTo(GeoPolyline2, Tolerance)

Calculates the shortest distance from this spline to a polyline, within a tolerance.

public double DistanceTo(GeoPolyline2 polyline, Tolerance tolerance)

Parameters

polyline GeoPolyline2

The polyline.

tolerance Tolerance

The 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(GeoPolygon2)

Calculates the shortest distance from this spline to a polygon, using the default tolerance.

public double DistanceTo(GeoPolygon2 polygon)

Parameters

polygon GeoPolygon2

Returns

double

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

Exceptions

ArgumentNullException

Thrown when the polygon is null.

DistanceTo(GeoPolygon2, Tolerance)

Calculates the shortest distance from this spline to a polygon, within a tolerance.

public double DistanceTo(GeoPolygon2 polygon, Tolerance tolerance)

Parameters

polygon GeoPolygon2

The polygon.

tolerance Tolerance

The 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 region here, as every curve reads it: a spline lying inside it is nought from it, though it crosses nothing.

Exceptions

ArgumentNullException

Thrown when the polygon is null.

DistanceTo(GeoRectangle2)

Calculates the shortest distance from this spline to a rectangle, using the default tolerance.

public double DistanceTo(GeoRectangle2 rect)

Parameters

rect GeoRectangle2

Returns

double

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

DistanceTo(GeoRectangle2, Tolerance)

Calculates the shortest distance from this spline to a rectangle, within a tolerance.

public double DistanceTo(GeoRectangle2 rect, Tolerance tolerance)

Parameters

rect GeoRectangle2

The rectangle.

tolerance Tolerance

The 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 rectangle is a region here, as every curve reads it: a spline lying inside it is nought from it, though it crosses nothing.

DistanceTo(GeoTriangle2)

Calculates the shortest distance from this spline to a triangle, using the default tolerance.

public double DistanceTo(GeoTriangle2 triangle)

Parameters

triangle GeoTriangle2

Returns

double

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

DistanceTo(GeoTriangle2, Tolerance)

Calculates the shortest distance from this spline to a triangle, within a tolerance.

public double DistanceTo(GeoTriangle2 triangle, Tolerance tolerance)

Parameters

triangle GeoTriangle2

The triangle.

tolerance Tolerance

The 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 region here, as every curve reads it: a spline lying inside it is nought from it, though it crosses nothing.

DistanceTo(GeoFace2)

Calculates the shortest distance from this spline to a face, using the default tolerance.

public double DistanceTo(GeoFace2 face)

Parameters

face GeoFace2

Returns

double

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

Exceptions

ArgumentNullException

Thrown when the face is null.

DistanceTo(GeoFace2, Tolerance)

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

public double DistanceTo(GeoFace2 face, Tolerance tolerance)

Parameters

face GeoFace2

The face.

tolerance Tolerance

The 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 region here, as every curve reads it: a spline lying inside it is nought from it, though it crosses nothing.

Exceptions

ArgumentNullException

Thrown when the face is null.

DistanceTo(GeoArc2)

Calculates the shortest distance from this spline to an arc, using the default tolerance.

public double DistanceTo(GeoArc2 arc)

Parameters

arc GeoArc2

Returns

double

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

DistanceTo(GeoArc2, Tolerance)

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

public double DistanceTo(GeoArc2 arc, Tolerance tolerance)

Parameters

arc GeoArc2

The arc.

tolerance Tolerance

The 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(GeoCircle2)

Calculates the shortest distance from this spline to a circle, using the default tolerance.

public double DistanceTo(GeoCircle2 circle)

Parameters

circle GeoCircle2

Returns

double

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

DistanceTo(GeoCircle2, Tolerance)

Calculates the shortest distance from this spline to a circle, within a tolerance.

public double DistanceTo(GeoCircle2 circle, Tolerance tolerance)

Parameters

circle GeoCircle2

The circle.

tolerance Tolerance

The 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 a region here, as every curve reads it: a spline lying inside it is nought from it, though it crosses nothing.

DistanceTo(GeoEllipse2)

Calculates the shortest distance from this spline to an ellipse, using the default tolerance.

public double DistanceTo(GeoEllipse2 ellipse)

Parameters

ellipse GeoEllipse2

Returns

double

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

DistanceTo(GeoEllipse2, Tolerance)

Calculates the shortest distance from this spline to an ellipse, within a tolerance.

public double DistanceTo(GeoEllipse2 ellipse, Tolerance tolerance)

Parameters

ellipse GeoEllipse2

The ellipse.

tolerance Tolerance

The 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 a region here, as every curve reads it: a spline lying inside it is nought from it, though it crosses nothing.

DistanceTo(GeoEdge2)

Calculates the shortest distance from this spline to an edge, using the default tolerance.

public double DistanceTo(GeoEdge2 edge)

Parameters

edge GeoEdge2

Returns

double

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

DistanceTo(GeoEdge2, Tolerance)

Calculates the shortest distance from this spline to an edge, within a tolerance.

public double DistanceTo(GeoEdge2 edge, Tolerance tolerance)

Parameters

edge GeoEdge2

The edge.

tolerance Tolerance

The 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(GeoPolylineArc2)

Calculates the shortest distance from this spline to a curved chain, using the default tolerance.

public double DistanceTo(GeoPolylineArc2 chain)

Parameters

chain GeoPolylineArc2

Returns

double

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

Exceptions

ArgumentNullException

Thrown when the curved chain is null.

DistanceTo(GeoPolylineArc2, Tolerance)

Calculates the shortest distance from this spline to a curved chain, within a tolerance.

public double DistanceTo(GeoPolylineArc2 chain, Tolerance tolerance)

Parameters

chain GeoPolylineArc2

The curved chain.

tolerance Tolerance

The 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 curved chain is null.

DistanceTo(GeoPolygonArc2)

Calculates the shortest distance from this spline to a curved loop, using the default tolerance.

public double DistanceTo(GeoPolygonArc2 loop)

Parameters

loop GeoPolygonArc2

Returns

double

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

Exceptions

ArgumentNullException

Thrown when the curved loop is null.

DistanceTo(GeoPolygonArc2, Tolerance)

Calculates the shortest distance from this spline to a curved loop, within a tolerance.

public double DistanceTo(GeoPolygonArc2 loop, Tolerance tolerance)

Parameters

loop GeoPolygonArc2

The curved loop.

tolerance Tolerance

The 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 a region here, as every curve reads it: a spline lying inside it is nought from it, though it crosses nothing.

Exceptions

ArgumentNullException

Thrown when the curved loop is null.

DistanceTo(GeoSpline2)

Calculates the shortest distance from this spline to another, using the default tolerance.

public double DistanceTo(GeoSpline2 other)

Parameters

other GeoSpline2

Returns

double

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

Exceptions

ArgumentNullException

Thrown when the other spline is null.

DistanceTo(GeoSpline2, Tolerance)

Calculates the shortest distance from this spline to another, within a tolerance.

public double DistanceTo(GeoSpline2 other, Tolerance tolerance)

Parameters

other GeoSpline2

The other spline.

tolerance Tolerance

The 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.