|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcmsc420.geom.Inclusive2DIntersectionVerifier
public class Inclusive2DIntersectionVerifier
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.
| 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 |
|---|
public Inclusive2DIntersectionVerifier()
| Method Detail |
|---|
public static boolean intersects(java.awt.geom.Point2D pt1,
java.awt.geom.Point2D pt2)
true if a point intersects with another point.
Else returns false.
public static boolean intersects(java.awt.geom.Point2D point,
Circle2D circle)
true if a point lies inclusively within a circle's
bounds. Else returns false.
public static boolean intersects(java.awt.geom.Point2D point,
java.awt.geom.Rectangle2D rect)
true if a point lies inclusively within a
rectangle's bounds. Else returns false.
public static boolean intersects(java.awt.geom.Point2D point,
java.awt.geom.Line2D line)
true if a point intersects with a line segment.
Else returns false.
public static boolean intersects(java.awt.geom.Line2D seg,
java.awt.geom.Rectangle2D rect)
true if any part of a segment intersects
inclusively within the rectangle's bounds. Else returns
false.
public static boolean intersects(java.awt.geom.Line2D seg1,
java.awt.geom.Line2D seg2)
true if two line segments intersect. Else returns
false.
public static boolean intersects(java.awt.geom.Rectangle2D rect,
Circle2D circle)
true if a rectangle and circle intersect. Else
returns false.
Algorithm taken from Dave Mount's Geometry notes.
public static boolean intersects(Circle2D c1,
Circle2D c2)
true if a circle intersects with another circle.
Else returns false.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||