Table of Contents

Method DistanceTo

Namespace
GeometryHelper.Geometry
Assembly
GeometryHelper.dll

DistanceTo(GeoPoint2)

Calculates the distance from a point to the closest point on this ray, using the default tolerance.

public double DistanceTo(GeoPoint2 point)

Parameters

point GeoPoint2

Returns

double

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

DistanceTo(GeoPoint2, Tolerance)

Calculates the distance from a point to the closest point on this ray, within a tolerance.

public double DistanceTo(GeoPoint2 point, Tolerance tolerance)

Parameters

point GeoPoint2
tolerance Tolerance

Returns

double

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

Remarks

The point is brought onto the ray and stopped at the origin: from the ray leaving the origin along X, the point (50, 40) is 40 away and the point (-30, 40) is 50 away. The tolerance is taken so that this reads like every other shape; it changes nothing here.

DistanceTo(GeoArc2)

Calculates the shortest distance from this ray to an arc.

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 ray to an arc, within a tolerance.

public double DistanceTo(GeoArc2 arc, Tolerance tolerance)

Parameters

arc GeoArc2
tolerance Tolerance

Returns

double

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

DistanceTo(GeoPolygonArc2)

Calculates the shortest distance from this ray to a curved loop.

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 loop is null.

DistanceTo(GeoPolygonArc2, Tolerance)

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

public double DistanceTo(GeoPolygonArc2 loop, Tolerance tolerance)

Parameters

loop GeoPolygonArc2
tolerance Tolerance

Returns

double

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

Exceptions

ArgumentNullException

Thrown when the loop is null.

DistanceTo(GeoPolylineArc2)

Calculates the shortest distance from this ray to a curved chain.

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

DistanceTo(GeoPolylineArc2, Tolerance)

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

public double DistanceTo(GeoPolylineArc2 chain, Tolerance tolerance)

Parameters

chain GeoPolylineArc2
tolerance Tolerance

Returns

double

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

Exceptions

ArgumentNullException

Thrown when the chain is null.

DistanceTo(GeoLine2)

Calculates the shortest distance from this ray 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. 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 ray to a line segment within a tolerance.

public double DistanceTo(GeoLine2 line, Tolerance tolerance)

Parameters

line GeoLine2
tolerance Tolerance

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

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

public double DistanceTo(GeoRay2 other)

Parameters

other GeoRay2

Returns

double

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

DistanceTo(GeoRay2, Tolerance)

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

public double DistanceTo(GeoRay2 other, Tolerance tolerance)

Parameters

other GeoRay2
tolerance Tolerance

Returns

double

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

Remarks

Nought where the two cross; otherwise the nearer of the two origins to the other ray. 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.

DistanceTo(GeoRectangle2)

Calculates the shortest distance from this ray to a rectangle.

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 ray to a rectangle, within a tolerance.

public double DistanceTo(GeoRectangle2 rect, Tolerance tolerance)

Parameters

rect GeoRectangle2
tolerance Tolerance

Returns

double

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

DistanceTo(GeoPolygon2)

Calculates the shortest distance from this ray to a polygon.

public double DistanceTo(GeoPolygon2 poly)

Parameters

poly 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 ray to a polygon, within a tolerance.

public double DistanceTo(GeoPolygon2 poly, Tolerance tolerance)

Parameters

poly GeoPolygon2
tolerance Tolerance

Returns

double

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

Exceptions

ArgumentNullException

Thrown when the polygon is null.

DistanceTo(GeoCircle2)

Calculates the shortest distance from this ray to a circle.

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 ray to a circle, within a tolerance.

public double DistanceTo(GeoCircle2 circle, Tolerance tolerance)

Parameters

circle GeoCircle2
tolerance Tolerance

Returns

double

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

DistanceTo(GeoPolyline2)

Calculates the shortest distance from this ray to a polyline.

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 ray to a polyline, within a tolerance.

public double DistanceTo(GeoPolyline2 polyline, Tolerance tolerance)

Parameters

polyline GeoPolyline2
tolerance Tolerance

Returns

double

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

Exceptions

ArgumentNullException

Thrown when the polyline is null.

DistanceTo(GeoEdge2)

Gets the distance from this ray to an edge.

public double DistanceTo(GeoEdge2 edge)

Parameters

edge GeoEdge2

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 ray to an edge, within a tolerance.

public double DistanceTo(GeoEdge2 edge, Tolerance tolerance)

Parameters

edge GeoEdge2
tolerance Tolerance

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 ray to a triangle.

public double DistanceTo(GeoTriangle2 triangle)

Parameters

triangle GeoTriangle2

Returns

double

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

DistanceTo(GeoTriangle2, Tolerance)

Gets the distance from this ray to a triangle, within a tolerance.

public double DistanceTo(GeoTriangle2 triangle, Tolerance tolerance)

Parameters

triangle GeoTriangle2
tolerance Tolerance

Returns

double

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

DistanceTo(GeoFace2)

Calculates the shortest distance from this ray to the material of a face: the same answer as DistanceTo(GeoRay2).

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 ray to the material of a face, within a tolerance: the same answer as DistanceTo(GeoRay2, Tolerance).

public double DistanceTo(GeoFace2 face, Tolerance tolerance)

Parameters

face GeoFace2
tolerance Tolerance

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 ray is nought from it where the two meet. The ray from (-50, 150) along X passes 50 above the square 100 by 100 with a corner at the origin and a hole 40 by 40 in its middle; the one from (-50, 50) along X runs into the material and is nought away.

Exceptions

ArgumentNullException

Thrown when the face is null.

DistanceTo(GeoXLine2)

Calculates the shortest distance from this ray 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 ray to an infinite line, within a tolerance.

public double DistanceTo(GeoXLine2 xline, Tolerance tolerance)

Parameters

xline GeoXLine2
tolerance Tolerance

Returns

double

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

DistanceTo(GeoSpline2)

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

public double DistanceTo(GeoSpline2 spline)

Parameters

spline GeoSpline2

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 ray to a spline, within a tolerance.

public double DistanceTo(GeoSpline2 spline, Tolerance tolerance)

Parameters

spline GeoSpline2
tolerance Tolerance

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.