georegression.geometry
Class UtilPoint2D_F32
- java.lang.Object
-
- georegression.geometry.UtilPoint2D_F32
-
public class UtilPoint2D_F32 extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor and Description UtilPoint2D_F32()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method and Description static Rectangle2D_F32bounding(java.util.List<Point2D_F32> points, Rectangle2D_F32 bounding)Finds the minimal volumeRectangleLength2D_F32which contains all the points.static RectangleLength2D_F32bounding(java.util.List<Point2D_F32> points, RectangleLength2D_F32 bounding)Finds the minimal volumeRectangleLength2D_F32which contains all the points.static java.util.List<Point2D_F32>copy(java.util.List<Point2D_F32> pts)static floatdistance(float x0, float y0, float x1, float y1)static floatdistanceSq(float x0, float y0, float x1, float y1)static booleanisEquals(GeoTuple2D_F32 a, GeoTuple2D_F32 b, float tol)static Point2D_F32mean(java.util.List<Point2D_F32> list, Point2D_F32 mean)Finds the point which has the mean location of all the points in the list.static Point2D_F32mean(Point2D_F32[] list, int offset, int length, Point2D_F32 mean)Finds the point which has the mean location of all the points in the array.static Point2D_F32mean(Point2D_F32 a, Point2D_F32 b, Point2D_F32 mean)Computes the mean/average of two points.static voidnoiseNormal(java.util.List<Point2D_F32> pts, float sigma, java.util.Random rand)static java.util.List<Point2D_F32>orderCCW(java.util.List<Point2D_F32> points)Puts the points into counter-clockwise order around their center.static java.util.List<Point2D_F32>random(float min, float max, int num, java.util.Random rand)
-
-
-
Method Detail
-
copy
public static java.util.List<Point2D_F32> copy(java.util.List<Point2D_F32> pts)
-
noiseNormal
public static void noiseNormal(java.util.List<Point2D_F32> pts, float sigma, java.util.Random rand)
-
distance
public static float distance(float x0, float y0, float x1, float y1)
-
distanceSq
public static float distanceSq(float x0, float y0, float x1, float y1)
-
mean
public static Point2D_F32 mean(java.util.List<Point2D_F32> list, Point2D_F32 mean)
Finds the point which has the mean location of all the points in the list. This is also known as the centroid.- Parameters:
list- List of pointsmean- Storage for mean point. If null then a new instance will be declared- Returns:
- The found mean
-
mean
public static Point2D_F32 mean(Point2D_F32[] list, int offset, int length, Point2D_F32 mean)
Finds the point which has the mean location of all the points in the array. This is also known as the centroid.- Parameters:
list- List of pointsoffset- First index in listlength- Length of elements in listmean- Storage for mean point. If null then a new instance will be declared- Returns:
- The found mean
-
mean
public static Point2D_F32 mean(Point2D_F32 a, Point2D_F32 b, Point2D_F32 mean)
Computes the mean/average of two points.- Parameters:
a- (input) Point Ab- (input) Point Bmean- (output) average of 'a' and 'b'
-
random
public static java.util.List<Point2D_F32> random(float min, float max, int num, java.util.Random rand)
-
isEquals
public static boolean isEquals(GeoTuple2D_F32 a, GeoTuple2D_F32 b, float tol)
-
bounding
public static RectangleLength2D_F32 bounding(java.util.List<Point2D_F32> points, RectangleLength2D_F32 bounding)
Finds the minimal volumeRectangleLength2D_F32which contains all the points.- Parameters:
points- Input: List of points.bounding- Output: Bounding rectangle
-
bounding
public static Rectangle2D_F32 bounding(java.util.List<Point2D_F32> points, Rectangle2D_F32 bounding)
Finds the minimal volumeRectangleLength2D_F32which contains all the points.- Parameters:
points- Input: List of points.bounding- Output: Bounding rectangle
-
orderCCW
public static java.util.List<Point2D_F32> orderCCW(java.util.List<Point2D_F32> points)
Puts the points into counter-clockwise order around their center.- Parameters:
points- List of points. Not modified.- Returns:
- ordered list
-
-
DataMelt 3.0 © DataMelt by jWork.ORG