cmsc420.geom
Class Inclusive2DIntersectionVerifier

java.lang.Object
  extended by cmsc420.geom.Inclusive2DIntersectionVerifier

public class Inclusive2DIntersectionVerifier
extends java.lang.Object

The InclusiveIntersectionVerifier class provides static methods used to determine if two shapes intersect. Unlike the java.awt.geom methods, bounds are included in all intersection checks.

Version:
1.0, 19 Feb 2007
Author:
Ben Zoller

Constructor Summary
Inclusive2DIntersectionVerifier()
           
 
Method Summary
static boolean intersects(Circle2D c1, Circle2D c2)
          Returns true if a circle intersects with another circle.
static boolean intersects(java.awt.geom.Line2D seg1, java.awt.geom.Line2D seg2)
          Returns true if two line segments intersect.
static boolean intersects(java.awt.geom.Line2D seg, java.awt.geom.Rectangle2D rect)
          Returns true if any part of a segment intersects inclusively within the rectangle's bounds.
static boolean intersects(java.awt.geom.Point2D point, Circle2D circle)
          Returns true if a point lies inclusively within a circle's bounds.
static boolean intersects(java.awt.geom.Point2D point, java.awt.geom.Line2D line)
          Returns true if a point intersects with a line segment.
static boolean intersects(java.awt.geom.Point2D pt1, java.awt.geom.Point2D pt2)
          Returns true if a point intersects with another point.
static boolean intersects(java.awt.geom.Point2D point, java.awt.geom.Rectangle2D rect)
          Returns true if a point lies inclusively within a rectangle's bounds.
static boolean intersects(java.awt.geom.Rectangle2D rect, Circle2D circle)
          Returns true if a rectangle and circle intersect.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Inclusive2DIntersectionVerifier

public Inclusive2DIntersectionVerifier()
Method Detail

intersects

public static boolean intersects(java.awt.geom.Point2D pt1,
                                 java.awt.geom.Point2D pt2)
Returns true if a point intersects with another point. Else returns false.


intersects

public static boolean intersects(java.awt.geom.Point2D point,
                                 Circle2D circle)
Returns true if a point lies inclusively within a circle's bounds. Else returns false.


intersects

public static boolean intersects(java.awt.geom.Point2D point,
                                 java.awt.geom.Rectangle2D rect)
Returns true if a point lies inclusively within a rectangle's bounds. Else returns false.


intersects

public static boolean intersects(java.awt.geom.Point2D point,
                                 java.awt.geom.Line2D line)
Returns true if a point intersects with a line segment. Else returns false.


intersects

public static boolean intersects(java.awt.geom.Line2D seg,
                                 java.awt.geom.Rectangle2D rect)
Returns true if any part of a segment intersects inclusively within the rectangle's bounds. Else returns false.


intersects

public static boolean intersects(java.awt.geom.Line2D seg1,
                                 java.awt.geom.Line2D seg2)
Returns true if two line segments intersect. Else returns false.


intersects

public static boolean intersects(java.awt.geom.Rectangle2D rect,
                                 Circle2D circle)
Returns true if a rectangle and circle intersect. Else returns false.

Algorithm taken from Dave Mount's Geometry notes.


intersects

public static boolean intersects(Circle2D c1,
                                 Circle2D c2)
Returns true if a circle intersects with another circle. Else returns false.