Class UtilPoint2D_F32

java.lang.Object
georegression.geometry.UtilPoint2D_F32

@Generated("georegression.geometry.UtilPoint2D_F64") public class UtilPoint2D_F32 extends Object
  • Constructor Details

    • UtilPoint2D_F32

      public UtilPoint2D_F32()
  • Method Details

    • findClosestIdx

      public static int findClosestIdx(float x, float y, List<Point2D_F32> pts, float tol)
      Finds the closest point in the list to the specified point that is within tolerance. Returns the index of the point or -1 if none was found.
      Parameters:
      tol - Tolerance in Euclidean distance.
    • copy

      public static List<Point2D_F32> copy(List<Point2D_F32> pts)
    • noiseNormal

      public static void noiseNormal(List<Point2D_F32> pts, float sigma, Random rand)
    • noiseNormal

      public static Point2D_F32 noiseNormal(Point2D_F32 mean, float sigmaX, float sigmaY, Random rand, @Nullable @Nullable Point2D_F32 output)
    • 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(List<Point2D_F32> list, @Nullable @Nullable 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 points
      mean - 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, @Nullable @Nullable 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 points
      offset - First index in list
      length - Length of elements in list
      mean - 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, @Nullable @Nullable Point2D_F32 mean)
      Computes the mean/average of two points.
      Parameters:
      a - (input) Point A
      b - (input) Point B
      mean - (output) average of 'a' and 'b'
    • random

      public static List<Point2D_F32> random(float min, float max, int num, Random rand)
    • isEquals

      public static boolean isEquals(GeoTuple2D_F32 a, GeoTuple2D_F32 b, float tol)
    • bounding

      public static RectangleLength2D_F32 bounding(List<Point2D_F32> points, @Nullable @Nullable RectangleLength2D_F32 bounding)
      Finds the minimal volume RectangleLength2D_F32 which contains all the points.
      Parameters:
      points - Input: List of points.
      bounding - Output: Bounding rectangle
    • bounding

      public static Rectangle2D_F32 bounding(List<Point2D_F32> points, @Nullable @Nullable Rectangle2D_F32 bounding)
      Finds the minimal volume RectangleLength2D_F32 which contains all the points.
      Parameters:
      points - Input: List of points.
      bounding - Output: Bounding rectangle
    • orderCCW

      public static List<Point2D_F32> orderCCW(List<Point2D_F32> points)
      Puts the points into counter-clockwise order around their center.
      Parameters:
      points - List of points. Not modified.
      Returns:
      ordered list
    • computeNormal

      public static void computeNormal(List<Point2D_F32> points, Point2D_F32 mean, org.ejml.data.FMatrix covariance)
      Computes the mean and covariance matrix from the set of points. This describes a normal distribution
      Parameters:
      points - (Input) points
      mean - (Output) mean of the points
      covariance - (Output) 2x2 covariance matrix
    • randomNorm

      public static List<Point2D_F32> randomNorm(Point2D_F32 mean, org.ejml.data.FMatrix covariance, int count, Random rand, @Nullable @Nullable List<Point2D_F32> output)
      Randomly generates points from the specified normal distribution
      Parameters:
      mean - (Input) mean
      covariance - (Output) 2x2 covariance matrix
      count - (Input) Number of points to create
      rand - (Input) Random number generator
      output - (Output) Optional storage for points. If null a new list is created
      Returns:
      List containing points.