edu.umd.cs.jazz.util
Class ZUtil
java.lang.Object
|
+--edu.umd.cs.jazz.util.ZUtil
- All Implemented Interfaces:
- java.io.Serializable
- public class ZUtil
- extends java.lang.Object
- implements java.io.Serializable
provides some generic, useful routines.
- See Also:
- Serialized Form
|
Constructor Summary |
ZUtil()
|
|
Method Summary |
static float |
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 |
rectIntersectsPolyline(java.awt.geom.Rectangle2D rect,
float[] xp,
float[] yp,
float 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 |
ZUtil
public ZUtil()
rectIntersectsPolyline
public static boolean rectIntersectsPolyline(java.awt.geom.Rectangle2D rect,
float[] xp,
float[] yp,
float penWidth)
- Determine if the specified rectangle intersects the specified polyline.
- Parameters:
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 polyline- Returns:
- true if the rectangle intersects the polyline.
angleBetweenPoints
public static float 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.
- Parameters:
pt,a,b - The points that specify the angle- Returns:
- the angle