Table of Contents

Method DistanceTo

Namespace
GeometryHelper.Geometry
Assembly
GeometryHelper.dll

DistanceTo(GeoPoint3)

Gets the distance from the chain to a point.

public double DistanceTo(GeoPoint3 point)

Parameters

point GeoPoint3

Returns

double

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

Remarks

The distance to a bend is the exact one, for a point near the centre of its arc too; see DistanceTo(GeoPoint3, Tolerance).

DistanceTo(GeoPoint3, Tolerance)

Gets the distance from the chain to a point, within a tolerance.

public double DistanceTo(GeoPoint3 point, Tolerance tolerance)

Parameters

point GeoPoint3
tolerance Tolerance

Returns

double

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

Remarks

The tolerance changes nothing in the distance: a point near the centre of a bend's arc is not carried to the bend's start, as DistanceTo(GeoPoint3, Tolerance) measures a bend. At a tolerance of a thousandth, the chain from (0.01, 0, 0) to (0.001, 0, 0), round the half circle of radius 0.001 about the origin through (0, 0.001, 0) to (-0.001, 0, 0), and on to (-0.01, 0, 0), is 0.0003 from (0, 0.0007, 0), and the point is on it; the projection GetClosestPointOnBoundary(GeoPoint3, Tolerance) keeps carrying it to the bend's start, 0.00122 away. A straight edge shorter than the tolerance is the edge it is, where an edge on its own is read as its start: the chain built of the straight edges from (0, 0, 0) to (10, 0, 0) and on to (10, 0.0006, 0) is 0.0009 from (10.0009, 0.0006, 0), and the point is on it, where the start of that last edge is 0.00108 away.

DistanceTo(GeoSphere3)

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

public double DistanceTo(GeoSphere3 sphere)

Parameters

sphere GeoSphere3

Returns

double

Nought where the curved chain reaches the ball, otherwise the gap, measured exactly.

DistanceTo(GeoSphere3, Tolerance)

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

public double DistanceTo(GeoSphere3 sphere, Tolerance tolerance)

Parameters

sphere GeoSphere3
tolerance Tolerance

Returns

double

Nought where the curved chain reaches the ball, otherwise the gap, measured exactly.

DistanceTo(GeoSpline3)

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

public double DistanceTo(GeoSpline3 spline)

Parameters

spline GeoSpline3

Returns

double

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

Exceptions

ArgumentNullException

Thrown when the spline is null.

DistanceTo(GeoSpline3, Tolerance)

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

public double DistanceTo(GeoSpline3 spline, Tolerance tolerance)

Parameters

spline GeoSpline3
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.