Package inra.ijpb.geometry
Class FeretDiameters
java.lang.Object
inra.ijpb.geometry.FeretDiameters
public class FeretDiameters
extends java.lang.Object
Utility methods for computing Feret diameters
- Author:
- dlegland
-
Constructor Summary
Constructors Constructor Description FeretDiameters()
-
Method Summary
Modifier and Type Method Description static PointPair2D
maxFeretDiameter(java.util.ArrayList<? extends java.awt.geom.Point2D> points)
Computes Maximum Feret diameter of a set of points.static AngleDiameterPair
minFeretDiameter(java.util.ArrayList<? extends java.awt.geom.Point2D> points)
Computes Minimum Feret diameter of a set of points and returns both the diameter and the corresponding angle.Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Constructor Details
-
FeretDiameters
public FeretDiameters()
-
-
Method Details
-
maxFeretDiameter
public static final PointPair2D maxFeretDiameter(java.util.ArrayList<? extends java.awt.geom.Point2D> points)Computes Maximum Feret diameter of a set of points. Note: it is often a good idea to compute convex hull before computing Feret diameter.- Parameters:
points
- a collection of planar points- Returns:
- the maximum Feret diameter of the point set
-
minFeretDiameter
public static final AngleDiameterPair minFeretDiameter(java.util.ArrayList<? extends java.awt.geom.Point2D> points)Computes Minimum Feret diameter of a set of points and returns both the diameter and the corresponding angle. Uses a naive algorithm (complexity of O(n^2)). Note: it is often more efficient to compute the convex hull of the set of points before computing minimum Feret diameter.- Parameters:
points
- a collection of planar points- Returns:
- the minimum Feret diameter of the point set
-