Documentation of 'georegression.geometry.UtilPolygons2D_F64' Java class
UtilPolygons2D_F64
georegression.geometry

Class UtilPolygons2D_F64



  • public class UtilPolygons2D_F64
    extends java.lang.Object
    Various functions related to polygons.
    • Constructor Detail

      • UtilPolygons2D_F64

        public UtilPolygons2D_F64()
    • Method Detail

      • isConvex

        public static boolean isConvex(Polygon2D_F64 poly)
        Determines if the polugon is convex or concave.
        Parameters:
        poly - Polygon
        Returns:
        true if convex and false if concave
      • convert

        public static void convert(Rectangle2D_F64 input,
                                   Quadrilateral_F64 output)
        Converts a rectangle into a quadrilateral
        Parameters:
        input - Rectangle.
        output - Quadrilateral. Modified.
      • convert

        public static void convert(Rectangle2D_F64 input,
                                   Polygon2D_F64 output)
        Converts a rectangle into a polygon
        Parameters:
        input - Rectangle.
        output - Polygon2D_F64. Modified.
      • convert

        public static void convert(Quadrilateral_F64 input,
                                   Polygon2D_F64 output)
        Converts a quadrilateral into a polygon
        Parameters:
        input - Quadrilateral.
        output - Polygon2D_F64. Modified.
      • convert

        public static void convert(Polygon2D_F64 input,
                                   Quadrilateral_F64 output)
        Converts a polygon into a quadrilateral
        Parameters:
        input - polygon.
        output - Quadrilateral. Modified.
      • convert

        public static void convert(RectangleLength2D_I32 input,
                                   Quadrilateral_F64 output)
        Converts a rectangle into a quadrilateral
        Parameters:
        input - Rectangle.
        output - Quadrilateral. Modified.
      • bounding

        public static void bounding(Quadrilateral_F64 quad,
                                    Rectangle2D_F64 rectangle)
        Finds the minimum area bounding rectangle around the quadrilateral.
        Parameters:
        quad - (Input) Quadrilateral
        rectangle - (Output) Minimum area rectangle
      • center

        public static Point2D_F64 center(Quadrilateral_F64 quad,
                                         Point2D_F64 center)
        Computes the center or average point in the quadrilateral.
        Parameters:
        quad - (Input) Quadrilateral
        center - (output) Center point of the quadrilateral. Can be null.
        Returns:
        The center point.
      • isCCW

        public static boolean isCCW(java.util.List<Point2D_F64> polygon)
        Returns true if the polygon is ordered in a counter-clockwise order. This is done by summing up the interior angles.
        Parameters:
        polygon - List of ordered points which define a polygon
        Returns:
        true if CCW and false if CW
      • vertexAverage

        public static void vertexAverage(Polygon2D_F64 input,
                                         Point2D_F64 average)
        Computes the average of all the vertexes
        Parameters:
        input - (input) polygon
        average - (output) average point
      • isIdentical

        public static boolean isIdentical(Polygon2D_F64 a,
                                          Polygon2D_F64 b,
                                          double tol)
        Checks to see if the vertexes of the two polygon's are the same up to the specified tolerance
        Parameters:
        a - Polygon
        b - Polygon
        tol - tolerance
        Returns:
        true if identical up to tolerance or false if not
      • isEquivalent

        public static boolean isEquivalent(Polygon2D_F64 a,
                                           Polygon2D_F64 b,
                                           double tol)
        Checks to see if the vertexes of the two polygon's are the same up to the specified tolerance and allows for a shift in their order
        Parameters:
        a - Polygon
        b - Polygon
        tol - tolerance
        Returns:
        true if identical up to tolerance or false if not
      • flip

        public static void flip(Polygon2D_F64 a)
        Flips the order of points inside the polygon. The first index will remain the same will otherwise be reversed
        Parameters:
        a - Polygon of order 3 or more.
      • shiftUp

        public static void shiftUp(Polygon2D_F64 a)
        Shifts all the vertexes in the polygon up one element. Wraps around at the end
        Parameters:
        a - Polygon
      • shiftDown

        public static void shiftDown(Polygon2D_F64 a)
        Shifts all the vertexes in the polygon up one element. Wraps around at the end
        Parameters:
        a - Polygon
      • convexHull

        public static void convexHull(java.util.List<Point2D_F64> points,
                                      Polygon2D_F64 hull)
        Computes the convex hull of the set of points.

        NOTE: This method declares a temporary array. If you want to avoid that invoke AndrewMonotoneConvexHull_F64 directly.

        Parameters:
        points - (Input) Set of points.
        hull - (output) storage for convex hull. Will be in counter-clockwise order

DataMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.