Package micycle.pgs.commons
Class MinimumBoundingEllipse
java.lang.Object
micycle.pgs.commons.MinimumBoundingEllipse
Minimum Volume Enclosing Ellipsoid
- Author:
- Peter Borissow
-
Constructor Summary
ConstructorsConstructorDescriptionMinimumBoundingEllipse
(double[][] points, double tolerance) Khachiyan’s Algorithm for the Computation of Minimum Volume Enclosing Ellipsoids. -
Method Summary
Modifier and TypeMethodDescriptiondouble[][]
getBoundingCoordinates
(int numPoints) Returns a list of coordinates that can be used to render the ellipse.double[]
Returns the center point of the ellipsedouble[][]
Returns a matrix containing all the information regarding the shape of the ellipsoid.
-
Constructor Details
-
MinimumBoundingEllipse
public MinimumBoundingEllipse(double[][] points, double tolerance) Khachiyan’s Algorithm for the Computation of Minimum Volume Enclosing Ellipsoids.- Parameters:
points
- An array of points. Each entry in the array contains an x,y coordinate. The points must form a closed loop. Consider pre-processing a geometry to find its convex hull, and supply thos coordinates to compute the MBE.tolerance
- the error tolerance to use when terminating optimisation. 0.001 to 0.01 recommended.
-
-
Method Details
-
getCenter
public double[] getCenter()Returns the center point of the ellipse- Returns:
- double[2] containing center x and y coordinates
-
getMatrix
public double[][] getMatrix()Returns a matrix containing all the information regarding the shape of the ellipsoid. To get the radii and orientation of the ellipsoid take the Singular Value Decomposition of the matrix. -
getBoundingCoordinates
public double[][] getBoundingCoordinates(int numPoints) Returns a list of coordinates that can be used to render the ellipse.- Parameters:
numPoints
- The number of points used to represent the ellipse. The higher the number the more dense the ellipse outline, the more accurate the shape.
-