Method FromThreePoints
- Namespace
- GeometryHelper.Geometry
- Assembly
- GeometryHelper.dll
FromThreePoints(GeoPoint2, GeoPoint2, GeoPoint2)
Creates the arc through three points, using the default tolerance.
public static GeoArc2 FromThreePoints(GeoPoint2 start, GeoPoint2 middle, GeoPoint2 end)
Parameters
startGeoPoint2Where the arc starts.
middleGeoPoint2A point the arc passes through between its ends.
endGeoPoint2Where the arc ends.
Returns
- GeoArc2
The arc from the start through the middle to the end.
Exceptions
- InvalidOperationException
Thrown when the three points share a line, so no circle passes through them.
FromThreePoints(GeoPoint2, GeoPoint2, GeoPoint2, Tolerance)
Creates the arc through three points, within a tolerance.
public static GeoArc2 FromThreePoints(GeoPoint2 start, GeoPoint2 middle, GeoPoint2 end, Tolerance tolerance)
Parameters
startGeoPoint2Where the arc starts.
middleGeoPoint2A point the arc passes through between its ends.
endGeoPoint2Where the arc ends.
toleranceToleranceThe tolerance.
Returns
- GeoArc2
The arc from the start through the middle to the end.
Remarks
Which way the arc turns follows the middle point: it sweeps the way that passes through it, so swapping the start and the end reverses the arc rather than giving the other part of the circle.
The points share a line, and have no arc through them, where the middle one lies within the point tolerance of the line through the other two, or the triangle they make has twice an area of no more than the square of the point tolerance: (0, 0), (100, 0.01) and (200, 0) have the arc of radius 500 000 through them at a tolerance of a thousandth, and share a line at 0.05. Read by the area alone, (0, 7), (5000, 7 + 1.2E-10) and (10000, 7) gave an arc of radius 1E17 that missed its own start by 12.5. An arc that would miss one of its three points by more than the tolerance, its radius past the reach of the digits, is refused too.
Exceptions
- InvalidOperationException
Thrown when the three points share a line, so no circle passes through them, or so nearly that the arc through them would miss them.
- ArgumentException
Thrown when a point is not a finite one.