Table of Contents

Method GetShortestLineTo

Namespace
GeometryHelper.Core
Assembly
GeometryHelper.dll

GetShortestLineTo(GeoEllipse2, GeoPoint2)

Gets the shortest segment joining the rim of an ellipse to a point, using the default tolerance.

public static GeoLine2 GetShortestLineTo(GeoEllipse2 ellipse, GeoPoint2 point)

Parameters

ellipse GeoEllipse2
point GeoPoint2

Returns

GeoLine2

GetShortestLineTo(GeoEllipse2, GeoPoint2, Tolerance)

Gets the shortest segment joining the rim of an ellipse to a point.

public static GeoLine2 GetShortestLineTo(GeoEllipse2 ellipse, GeoPoint2 point, Tolerance tolerance)

Parameters

ellipse GeoEllipse2

The ellipse.

point GeoPoint2

The point.

tolerance Tolerance

The tolerance; not read, since GetClosestPointOnBoundary(GeoEllipse2, GeoPoint2) takes none.

Returns

GeoLine2

A segment from the point GetClosestPointOnBoundary(GeoEllipse2, GeoPoint2) gives to point, so a point inside gets the gap out to the rim, where DistanceTo(GeoEllipse2, GeoPoint2) reads the region and answers nought. Outside, it is as long as that distance; on the rim it has no length. From the ellipse 300 by 100 centred on the origin, the point (400, 0) gets the segment from (300, 0), 100 long, and the centre gets the one from (0, 100).

GetShortestLineTo(GeoEllipse2, GeoLine2)

Gets the shortest segment joining the rim of an ellipse to a segment, using the default tolerance.

public static GeoLine2 GetShortestLineTo(GeoEllipse2 ellipse, GeoLine2 line)

Parameters

ellipse GeoEllipse2
line GeoLine2

Returns

GeoLine2

GetShortestLineTo(GeoEllipse2, GeoLine2, Tolerance)

Gets the shortest segment joining the rim of an ellipse to a segment, within a tolerance.

public static GeoLine2 GetShortestLineTo(GeoEllipse2 ellipse, GeoLine2 line, Tolerance tolerance)

Parameters

ellipse GeoEllipse2

The ellipse.

line GeoLine2

The segment.

tolerance Tolerance

The tolerance the crossings are found with.

Returns

GeoLine2

A segment starting on the rim and ending on the segment; of no length at the first crossing along the segment where they cross. From the ellipse 300 by 100 centred on the origin to the segment from (-100, 150) to (100, 150), it runs from (0, 100) to (0, 150).

GetShortestLineTo(GeoEllipse2, GeoPolyline2)

Gets the shortest segment joining the rim of an ellipse to a polyline, using the default tolerance.

public static GeoLine2 GetShortestLineTo(GeoEllipse2 ellipse, GeoPolyline2 polyline)

Parameters

ellipse GeoEllipse2
polyline GeoPolyline2

Returns

GeoLine2

Exceptions

ArgumentNullException

Thrown when the polyline is null.

GetShortestLineTo(GeoEllipse2, GeoPolyline2, Tolerance)

Gets the shortest segment joining the rim of an ellipse to a polyline, within a tolerance.

public static GeoLine2 GetShortestLineTo(GeoEllipse2 ellipse, GeoPolyline2 polyline, Tolerance tolerance)

Parameters

ellipse GeoEllipse2

The ellipse.

polyline GeoPolyline2

The polyline.

tolerance Tolerance

The tolerance.

Returns

GeoLine2

A segment starting on the rim and ending on the polyline; the earlier edge wins a tie.

Exceptions

ArgumentNullException

Thrown when the polyline is null.

GetShortestLineTo(GeoEllipse2, GeoPolygon2)

Gets the shortest segment joining the rim of an ellipse to the boundary of a polygon, using the default tolerance.

public static GeoLine2 GetShortestLineTo(GeoEllipse2 ellipse, GeoPolygon2 polygon)

Parameters

ellipse GeoEllipse2
polygon GeoPolygon2

Returns

GeoLine2

Exceptions

ArgumentNullException

Thrown when the polygon is null.

GetShortestLineTo(GeoEllipse2, GeoPolygon2, Tolerance)

Gets the shortest segment joining the rim of an ellipse to the boundary of a polygon, within a tolerance.

public static GeoLine2 GetShortestLineTo(GeoEllipse2 ellipse, GeoPolygon2 polygon, Tolerance tolerance)

Parameters

ellipse GeoEllipse2

The ellipse.

polygon GeoPolygon2

The polygon.

tolerance Tolerance

The tolerance.

Returns

GeoLine2

A segment starting on the rim and ending on an edge of the polygon; the earlier edge wins a tie.

Exceptions

ArgumentNullException

Thrown when the polygon is null.

GetShortestLineTo(GeoEllipse2, GeoRectangle2)

Gets the shortest segment joining the rim of an ellipse to the boundary of a rectangle, using the default tolerance.

public static GeoLine2 GetShortestLineTo(GeoEllipse2 ellipse, GeoRectangle2 rect)

Parameters

ellipse GeoEllipse2
rect GeoRectangle2

Returns

GeoLine2

GetShortestLineTo(GeoEllipse2, GeoRectangle2, Tolerance)

Gets the shortest segment joining the rim of an ellipse to the boundary of a rectangle, within a tolerance.

public static GeoLine2 GetShortestLineTo(GeoEllipse2 ellipse, GeoRectangle2 rect, Tolerance tolerance)

Parameters

ellipse GeoEllipse2

The ellipse.

rect GeoRectangle2

The rectangle.

tolerance Tolerance

The tolerance.

Returns

GeoLine2

A segment starting on the rim and ending on a side of the rectangle; the earlier side wins a tie.

GetShortestLineTo(GeoEllipse2, GeoTriangle2)

Gets the shortest segment joining the rim of an ellipse to a triangle, using the default tolerance.

public static GeoLine2 GetShortestLineTo(GeoEllipse2 ellipse, GeoTriangle2 triangle)

Parameters

ellipse GeoEllipse2
triangle GeoTriangle2

Returns

GeoLine2

GetShortestLineTo(GeoEllipse2, GeoTriangle2, Tolerance)

Gets the shortest segment joining the rim of an ellipse to a triangle, within a tolerance.

public static GeoLine2 GetShortestLineTo(GeoEllipse2 ellipse, GeoTriangle2 triangle, Tolerance tolerance)

Parameters

ellipse GeoEllipse2

The ellipse.

triangle GeoTriangle2

The triangle; one whose corners coincide exactly is read as its longest edge, a short side being the side it is.

tolerance Tolerance

The tolerance.

Returns

GeoLine2

A segment starting on the rim and ending on an edge of the triangle.

GetShortestLineTo(GeoEllipse2, GeoFace2)

Gets the shortest segment joining the rim of an ellipse to the boundary of a face, using the default tolerance.

public static GeoLine2 GetShortestLineTo(GeoEllipse2 ellipse, GeoFace2 face)

Parameters

ellipse GeoEllipse2
face GeoFace2

Returns

GeoLine2

Exceptions

ArgumentNullException

Thrown when the face is null.

GetShortestLineTo(GeoEllipse2, GeoFace2, Tolerance)

Gets the shortest segment joining the rim of an ellipse to the boundary of a face, within a tolerance.

public static GeoLine2 GetShortestLineTo(GeoEllipse2 ellipse, GeoFace2 face, Tolerance tolerance)

Parameters

ellipse GeoEllipse2

The ellipse.

face GeoFace2

The face, whose boundary is its outline and the rim of every hole.

tolerance Tolerance

The tolerance.

Returns

GeoLine2

The shortest of the segments to the outline and to each hole, the outline winning a tie.

Exceptions

ArgumentNullException

Thrown when the face is null.

GetShortestLineTo(GeoEllipse2, GeoEdge2)

Gets the shortest segment joining the rim of an ellipse to an edge, using the default tolerance.

public static GeoLine2 GetShortestLineTo(GeoEllipse2 ellipse, GeoEdge2 edge)

Parameters

ellipse GeoEllipse2
edge GeoEdge2

Returns

GeoLine2

GetShortestLineTo(GeoEllipse2, GeoEdge2, Tolerance)

Gets the shortest segment joining the rim of an ellipse to an edge, within a tolerance: as a segment or as an arc, whichever the edge is.

public static GeoLine2 GetShortestLineTo(GeoEllipse2 ellipse, GeoEdge2 edge, Tolerance tolerance)

Parameters

ellipse GeoEllipse2
edge GeoEdge2
tolerance Tolerance

Returns

GeoLine2

GetShortestLineTo(GeoEllipse2, GeoCircle2)

Gets the shortest segment joining the rim of an ellipse to a circle, using the default tolerance.

public static GeoLine2 GetShortestLineTo(GeoEllipse2 ellipse, GeoCircle2 circle)

Parameters

ellipse GeoEllipse2
circle GeoCircle2

Returns

GeoLine2

GetShortestLineTo(GeoEllipse2, GeoCircle2, Tolerance)

Gets the shortest segment joining the rim of an ellipse to the circumference of a circle, within a tolerance.

public static GeoLine2 GetShortestLineTo(GeoEllipse2 ellipse, GeoCircle2 circle, Tolerance tolerance)

Parameters

ellipse GeoEllipse2

The ellipse.

circle GeoCircle2

The circle.

tolerance Tolerance

The tolerance the crossings are found with.

Returns

GeoLine2

A segment starting on the rim and ending on the circumference, of no length at the first crossing where they cross. From the ellipse 300 by 100 centred on the origin to the circle of radius 50 about (0, 300), it runs from (0, 100) to (0, 250); to the circle of radius 400 about the origin, from (300, 0) out to (400, 0).

GetShortestLineTo(GeoEllipse2, GeoArc2)

Gets the shortest segment joining the rim of an ellipse to an arc, using the default tolerance.

public static GeoLine2 GetShortestLineTo(GeoEllipse2 ellipse, GeoArc2 arc)

Parameters

ellipse GeoEllipse2
arc GeoArc2

Returns

GeoLine2

GetShortestLineTo(GeoEllipse2, GeoArc2, Tolerance)

Gets the shortest segment joining the rim of an ellipse to an arc, within a tolerance.

public static GeoLine2 GetShortestLineTo(GeoEllipse2 ellipse, GeoArc2 arc, Tolerance tolerance)

Parameters

ellipse GeoEllipse2

The ellipse.

arc GeoArc2

The arc.

tolerance Tolerance

The tolerance.

Returns

GeoLine2

A segment starting on the rim and ending on the arc, of no length at the first crossing where they cross.

GetShortestLineTo(GeoEllipse2, GeoEllipse2)

Gets the shortest segment joining the rims of two ellipses, using the default tolerance.

public static GeoLine2 GetShortestLineTo(GeoEllipse2 ellipse, GeoEllipse2 other)

Parameters

ellipse GeoEllipse2
other GeoEllipse2

Returns

GeoLine2

GetShortestLineTo(GeoEllipse2, GeoEllipse2, Tolerance)

Gets the shortest segment joining the rims of two ellipses, within a tolerance.

public static GeoLine2 GetShortestLineTo(GeoEllipse2 ellipse, GeoEllipse2 other, Tolerance tolerance)

Parameters

ellipse GeoEllipse2

The ellipse the segment starts on.

other GeoEllipse2

The ellipse the segment ends on.

tolerance Tolerance

The tolerance the crossings are found with.

Returns

GeoLine2

A segment starting on the rim of the first and ending on the rim of the second, of no length at the first crossing where they cross; one inside the other gets the gap between the two rims. From the ellipse 300 by 100 centred on the origin to the one 100 by 50 about (0, 250) along Y, it runs from (0, 100) to (0, 150).

Remarks

Found as DistanceTo(GeoEllipse2, GeoEllipse2, Tolerance) finds the gap, by Brent's method from 36 starts round the first rim; the end on the second is the point of its rim nearest the start.

GetShortestLineTo(GeoEllipse2, GeoPolylineArc2)

Gets the shortest segment joining the rim of an ellipse to a curved chain, using the default tolerance.

public static GeoLine2 GetShortestLineTo(GeoEllipse2 ellipse, GeoPolylineArc2 chain)

Parameters

ellipse GeoEllipse2
chain GeoPolylineArc2

Returns

GeoLine2

Exceptions

ArgumentNullException

Thrown when the chain is null.

GetShortestLineTo(GeoEllipse2, GeoPolylineArc2, Tolerance)

Gets the shortest segment joining the rim of an ellipse to a curved chain, within a tolerance.

public static GeoLine2 GetShortestLineTo(GeoEllipse2 ellipse, GeoPolylineArc2 chain, Tolerance tolerance)

Parameters

ellipse GeoEllipse2

The ellipse.

chain GeoPolylineArc2

The chain.

tolerance Tolerance

The tolerance.

Returns

GeoLine2

A segment starting on the rim and ending on the chain, measured on the arcs themselves; the earlier edge wins a tie.

Exceptions

ArgumentNullException

Thrown when the chain is null.

GetShortestLineTo(GeoEllipse2, GeoPolygonArc2)

Gets the shortest segment joining the rim of an ellipse to a curved loop, using the default tolerance.

public static GeoLine2 GetShortestLineTo(GeoEllipse2 ellipse, GeoPolygonArc2 loop)

Parameters

ellipse GeoEllipse2
loop GeoPolygonArc2

Returns

GeoLine2

Exceptions

ArgumentNullException

Thrown when the loop is null.

GetShortestLineTo(GeoEllipse2, GeoPolygonArc2, Tolerance)

Gets the shortest segment joining the rim of an ellipse to a curved loop, within a tolerance.

public static GeoLine2 GetShortestLineTo(GeoEllipse2 ellipse, GeoPolygonArc2 loop, Tolerance tolerance)

Parameters

ellipse GeoEllipse2

The ellipse.

loop GeoPolygonArc2

The loop.

tolerance Tolerance

The tolerance.

Returns

GeoLine2

A segment starting on the rim and ending on the loop, measured on the arcs themselves; the earlier edge wins a tie.

Exceptions

ArgumentNullException

Thrown when the loop is null.

GetShortestLineTo(GeoEllipse2, GeoRay2)

Gets the shortest segment leaving the rim of an ellipse and landing on a ray, using the default tolerance.

public static GeoLine2 GetShortestLineTo(GeoEllipse2 ellipse, GeoRay2 ray)

Parameters

ellipse GeoEllipse2
ray GeoRay2

Returns

GeoLine2

GetShortestLineTo(GeoEllipse2, GeoRay2, Tolerance)

Gets the shortest segment leaving the rim of an ellipse and landing on a ray, within a tolerance.

public static GeoLine2 GetShortestLineTo(GeoEllipse2 ellipse, GeoRay2 ray, Tolerance tolerance)

Parameters

ellipse GeoEllipse2
ray GeoRay2
tolerance Tolerance

Returns

GeoLine2