

PREV CLASS NEXT CLASS  FRAMES NO FRAMES  
SUMMARY: NESTED  FIELD  CONSTR  METHOD  DETAIL: FIELD  CONSTR  METHOD 
java.lang.Object com.caffeineowl.graphics.GeomUtils
public class GeomUtils
Class to implement various algorithms related with planar (2D) geometry: intersections, areas, etc.
Field Summary  

protected static double 
angleTolerance
Maximum tolerance to be used when dealing with angles. 
protected static double 
areaTolerance
Maximum tolerance to be used when dealing with areas. 
protected static double 
distTolerance
Maximum tolerance to be used when dealing with distances. 
Constructor Summary  

GeomUtils()

Method Summary  

(package private) static boolean 
arePointsCollinear(double ax,
double ay,
double bx,
double by,
double cx,
double cy)
The points will be considered collinear (on the same straight line, including the degenerate cases) iff the area of the triangle defined by the three points is zero. 
static double 
getAngleTolerance()

static double 
getAreaTolerance()

static double 
getDistTolerance()

(package private) static boolean 
lineSeparatesPoints(double startx,
double starty,
double endx,
double endy,
double p0x,
double p0y,
double p1x,
double p1y,
boolean strict)
The points p0 and p1 will be considered separated by the line passing through start and end if, while "staying in start and looking towards end, one case see the p0 by turning their head on the opposite side of the line as for seeing p1". 
static void 
setAngleTolerance(double angleTolerance)

static void 
setAreaTolerance(double areaTolerance)

static void 
setDistTolerance(double distTolerance)

Methods inherited from class java.lang.Object 

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait 
Field Detail 

protected static double distTolerance
0
(zero);
or, locations separated by distances less than this value will be
considered as being the same/indiscernible.
protected static double angleTolerance
0
(zero).
protected static double areaTolerance
0
(zero).
Constructor Detail 

public GeomUtils()
Method Detail 

public static final double getDistTolerance()
public static final void setDistTolerance(double distTolerance)
distTolerance
 the distTolerance to setpublic static final double getAngleTolerance()
public static final void setAngleTolerance(double angleTolerance)
angleTolerance
 the angleTolerance to setpublic static double getAreaTolerance()
public static void setAreaTolerance(double areaTolerance)
areaTolerance
 the areaTolerance to setstatic final boolean arePointsCollinear(double ax, double ay, double bx, double by, double cx, double cy)
x
(ca):
if this is below the tolerance
, the points will
be considered collinear.
static final boolean lineSeparatesPoints(double startx, double starty, double endx, double endy, double p0x, double p0y, double p1x, double p1y, boolean strict)
Note: if the line defined by start and end is a degenerate one (i.e. the start and end points are equal or very close on of the other) the return value will be strongly affected by the computation errors, but mostly the return value will be given by the value of the strict parameter.
strict
 if true, having one of the p0 or p1
on the start>end line will cause this method to return false
(i.e. the points must be really separated by the line, with none of them on the line).
If false
, then any (or both) of the points being on the line
will cause a positive response.


PREV CLASS NEXT CLASS  FRAMES NO FRAMES  
SUMMARY: NESTED  FIELD  CONSTR  METHOD  DETAIL: FIELD  CONSTR  METHOD 