Class MinimumBoundingCircle
Computes the Minimum Bounding Circle (MBC) for the points in a Geometry. The MBC is the smallest circle which covers all the input points (this is also sometimes known as the Smallest Enclosing Circle). This is equivalent to computing the Maximum Diameter of the input point set.
Inherited Members
Namespace: NetTopologySuite.Algorithm
Assembly: NetTopologySuite.dll
Syntax
public class MinimumBoundingCircle
Remarks
- As a centre point and a radius
- By the set of points defining the circle.
Depending on the number of points in the input
and their relative positions, this set
contains from 0 to 3 points.
- 0 or 1 points indicate an empty or trivial input point arrangement.
- 2 points define the diameter of the minimum bounding circle.
- 3 points define an inscribed triangle of the minimum bounding circle.
Constructors
| Edit this page View SourceMinimumBoundingCircle(Geometry)
Creates a new object for computing the minimum bounding circle for the point set defined by the vertices of the given geometry.
Declaration
public MinimumBoundingCircle(Geometry geom)
Parameters
Type | Name | Description |
---|---|---|
Geometry | geom | The geometry to use to obtain the point set |
Methods
| Edit this page View SourceGetCentre()
Gets the centre point of the computed Minimum Bounding Circle.
Declaration
public Coordinate GetCentre()
Returns
Type | Description |
---|---|
Coordinate |
GetCircle()
Gets a geometry which represents the Minimum Bounding Circle.
Declaration
public Geometry GetCircle()
Returns
Type | Description |
---|---|
Geometry | A Geometry representing the Minimum Bounding Circle. |
Remarks
If the input is degenerate (empty or a single unique point), this method will return an empty geometry or a single Point geometry. Otherwise, a Polygon will be returned which approximates the Minimum Bounding Circle. (Note that because the computed polygon is only an approximation, it may not precisely contain all the input points.)
GetDiameter()
Gets a geometry representing the diameter of the computed Minimum Bounding Circle.
Declaration
public Geometry GetDiameter()
Returns
Type | Description |
---|---|
Geometry |
|
GetExtremalPoints()
Gets the extremal points which define the computed Minimum Bounding Circle. There may be zero, one, two or three of these points, depending on the number of points in the input and the geometry of those points.
Declaration
public Coordinate[] GetExtremalPoints()
Returns
Type | Description |
---|---|
Coordinate[] | The points defining the Minimum Bounding Circle |
GetFarthestPoints()
Gets a geometry representing a line between the two farthest points in the input.
These points are two of the extremal points of the Minimum Bounding Circle They lie on the convex hull of the input.Declaration
[Obsolete("Use GetMaximumDiameter()")]
public Geometry GetFarthestPoints()
Returns
Type | Description |
---|---|
Geometry | A LineString between the two farthest points of the input |
GetMaximumDiameter()
Gets a geometry representing the maximum diameter of the input. The maximum diameter is the longest line segment between any two points of the input.
The points are two of the extremal points of the Minimum Bounding Circle. They lie on the convex hull of the input.Declaration
public Geometry GetMaximumDiameter()
Returns
Type | Description |
---|---|
Geometry | The result is |
GetRadius()
Gets the radius of the computed Minimum Bounding Circle.
Declaration
public double GetRadius()
Returns
Type | Description |
---|---|
double | The radius of the Minimum Bounding Circle |