Class Intersection2D_I32

java.lang.Object
georegression.metric.Intersection2D_I32

public class Intersection2D_I32 extends Object
  • Constructor Details

    • Intersection2D_I32

      public Intersection2D_I32()
  • Method Details

    • intersects

      public static boolean intersects(Rectangle2D_I32 a, Rectangle2D_I32 b)
      Checks to see if the two rectangles intersect each other
      Parameters:
      a - Rectangle
      b - Rectangle
      Returns:
      true if intersection
    • intersection

      public static boolean intersection(Rectangle2D_I32 a, Rectangle2D_I32 b, Rectangle2D_I32 result)
      Finds the intersection between two rectangles. If the rectangles don't intersect then false is returned.
      Parameters:
      a - Rectangle
      b - Rectangle
      result - Storage for the found intersection
      Returns:
      true if intersection
    • containsConvex

      public static boolean containsConvex(Polygon2D_I32 polygon, Point2D_I32 pt)
      Checks to see if the point is contained inside the convex polygon. If the point is an the polygon's perimeter it is considered to NOT be inside.
      Parameters:
      polygon - Convex polygon. Not modified.
      pt - Point. Not modified.
      Returns:
      True if the point is contained inside the polygon.
    • containsConcave

      public static boolean containsConcave(Polygon2D_I32 polygon, Point2D_I32 pt)
      Checks to see if the point is contained inside the concave polygon. NOTE: Points which lie along the perimeter may or may not be considered as inside
      Parameters:
      polygon - Convex polygon. Not modified.
      pt - Point. Not modified.
      Returns:
      True if the point is contained inside the polygon.
    • contains

      public static boolean contains(RectangleLength2D_I32 a, int x, int y)
      True if the point is contained inside the rectangle
      Parameters:
      a - Rectangle
      x - x-coordinate of point
      y - y-coordinate of point
      Returns:
      true if the point is inside and false it is not
    • contains

      public static boolean contains(Rectangle2D_I32 a, int x, int y)
      True if the point is contained inside the rectangle
      Parameters:
      a - Rectangle
      x - x-coordinate of point
      y - y-coordinate of point
      Returns:
      true if the point is inside and false it is not