|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--edu.umd.cs.jazz.util.ZUtil
ZUtil provides some generic, useful routines.
Warning: Serialized and ZSerialized objects of this class will not be compatible with future Jazz releases. The current serialization support is appropriate for short term storage or RMI between applications running the same version of Jazz. A future release of Jazz will provide support for long term persistence.
Constructor Summary | |
ZUtil()
|
Method Summary | |
static double |
angleBetweenPoints(double x,
double y,
double ax,
double ay,
double bx,
double by)
Returns the angle in radians between point a and point b from point pt, that is the angle between a-pt-b. |
static double |
angleBetweenPoints(java.awt.geom.Point2D pt,
java.awt.geom.Point2D a,
java.awt.geom.Point2D b)
Returns the angle in radians between point a and point b from point pt, that is the angle between a-pt-b. |
static boolean |
intersectsPolygon(java.awt.geom.Rectangle2D rect,
double[] xp,
double[] yp)
Determines if any part of the rectangle is inside this polygon. |
static boolean |
isInsidePolygon(double x,
double y,
int np,
double[] xp,
double[] yp)
Determines if the point is inside the polygon. |
static boolean |
isInsidePolygon(java.awt.geom.Rectangle2D rect,
int np,
double[] xp,
double[] yp)
Determines if a rectangle is inside a polygon. |
static boolean |
rectIntersectsLine(java.awt.geom.Rectangle2D rect,
double x1,
double y1,
double x2,
double y2)
Tests if the specified line segment intersects the interior of the specified Rectangle2D . |
static boolean |
rectIntersectsPolyline(java.awt.geom.Rectangle2D rect,
double[] xp,
double[] yp,
double penWidth)
Determine if the specified rectangle intersects the specified polyline. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public ZUtil()
Method Detail |
public static boolean rectIntersectsLine(java.awt.geom.Rectangle2D rect, double x1, double y1, double x2, double y2)
Rectangle2D
.x1, y1
- the first endpoint of the specified
line segmentx2, y2
- the second endpoint of the specified
line segmenttrue
if the specified line segment intersects
the interior of this Rectangle2D
; false
otherwise.public static boolean rectIntersectsPolyline(java.awt.geom.Rectangle2D rect, double[] xp, double[] yp, double penWidth)
rect
- The rectangle that is being tested for intersectionxp
- The array of X-coordinates that determines the polylineyp
- The array of Y-coordinates that determines the polylinepenWidth
- The width of the polylinepublic static double angleBetweenPoints(java.awt.geom.Point2D pt, java.awt.geom.Point2D a, java.awt.geom.Point2D b)
pt,a,b
- The points that specify the anglepublic static double angleBetweenPoints(double x, double y, double ax, double ay, double bx, double by)
x,y
- The central pointax,ay
- The point abx,by
- The point bpublic static boolean intersectsPolygon(java.awt.geom.Rectangle2D rect, double[] xp, double[] yp)
rect
- The rectangle being tested for intersecting this polygonpublic static boolean isInsidePolygon(double x, double y, int np, double[] xp, double[] yp)
x,y
- The point being tested for containment within a polygonpublic static boolean isInsidePolygon(java.awt.geom.Rectangle2D rect, int np, double[] xp, double[] yp)
rect
- The rectangle being tested for containment within a polygon
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |