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
ellipseGeoEllipse2pointGeoPoint2
Returns
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
ellipseGeoEllipse2The ellipse.
pointGeoPoint2The point.
toleranceToleranceThe 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
ellipseGeoEllipse2lineGeoLine2
Returns
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
ellipseGeoEllipse2The ellipse.
lineGeoLine2The segment.
toleranceToleranceThe 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
ellipseGeoEllipse2polylineGeoPolyline2
Returns
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
ellipseGeoEllipse2The ellipse.
polylineGeoPolyline2The polyline.
toleranceToleranceThe 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
ellipseGeoEllipse2polygonGeoPolygon2
Returns
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
ellipseGeoEllipse2The ellipse.
polygonGeoPolygon2The polygon.
toleranceToleranceThe 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
ellipseGeoEllipse2rectGeoRectangle2
Returns
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
ellipseGeoEllipse2The ellipse.
rectGeoRectangle2The rectangle.
toleranceToleranceThe 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
ellipseGeoEllipse2triangleGeoTriangle2
Returns
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
ellipseGeoEllipse2The ellipse.
triangleGeoTriangle2The triangle; one whose corners coincide exactly is read as its longest edge, a short side being the side it is.
toleranceToleranceThe 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
ellipseGeoEllipse2faceGeoFace2
Returns
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
ellipseGeoEllipse2The ellipse.
faceGeoFace2The face, whose boundary is its outline and the rim of every hole.
toleranceToleranceThe 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
ellipseGeoEllipse2edgeGeoEdge2
Returns
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
ellipseGeoEllipse2edgeGeoEdge2toleranceTolerance
Returns
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
ellipseGeoEllipse2circleGeoCircle2
Returns
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
ellipseGeoEllipse2The ellipse.
circleGeoCircle2The circle.
toleranceToleranceThe 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
ellipseGeoEllipse2arcGeoArc2
Returns
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
ellipseGeoEllipse2The ellipse.
arcGeoArc2The arc.
toleranceToleranceThe 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
ellipseGeoEllipse2otherGeoEllipse2
Returns
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
ellipseGeoEllipse2The ellipse the segment starts on.
otherGeoEllipse2The ellipse the segment ends on.
toleranceToleranceThe 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
ellipseGeoEllipse2chainGeoPolylineArc2
Returns
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
ellipseGeoEllipse2The ellipse.
chainGeoPolylineArc2The chain.
toleranceToleranceThe 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
ellipseGeoEllipse2loopGeoPolygonArc2
Returns
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
ellipseGeoEllipse2The ellipse.
loopGeoPolygonArc2The loop.
toleranceToleranceThe 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
ellipseGeoEllipse2rayGeoRay2
Returns
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
ellipseGeoEllipse2rayGeoRay2toleranceTolerance