Table of Contents

Method Fit

Namespace
GeometryHelper.Geometry
Assembly
GeometryHelper.dll

Fit(IEnumerable<GeoPoint2>)

Gets the rectangle of least area round some points, using the default tolerance.

public static GeoRectangle2 Fit(IEnumerable<GeoPoint2> points)

Parameters

points IEnumerable<GeoPoint2>

Returns

GeoRectangle2

Fit(IEnumerable<GeoPoint2>, Tolerance)

Gets the rectangle of least area round some points, turned whichever way makes it smallest.

public static GeoRectangle2 Fit(IEnumerable<GeoPoint2> points, Tolerance tolerance)

Parameters

points IEnumerable<GeoPoint2>

The points.

tolerance Tolerance

The tolerance deciding whether points lie in one line.

Returns

GeoRectangle2

The rectangle, its width along one edge of the points' convex hull: a rectangle of least area always has a side along one, so trying each finds it exactly. Points all in one line give a rectangle of no height along that line.

Exceptions

ArgumentNullException

Thrown when the points are null.

ArgumentException

Thrown when there are no points.