Package com.attivio.util
Class GeometryUtils
- java.lang.Object
-
- com.attivio.util.GeometryUtils
-
public final class GeometryUtils extends java.lang.Object
Utility functions for geometry classes.
-
-
Field Summary
Fields Modifier and Type Field Description static double
EPSILON
Small double for "equality" checks.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static boolean
equals(double a, double b)
Check if 2 double values are equal (withingEPSILON
of each other).static boolean
equals(double x1, double y1, double x2, double y2)
Check if 2 points equal.static double
getAngle(double x0, double y0, double x1, double y1)
Calculate the angle between a line defined by 2 points.static boolean
isNonZero(double value)
Checks ifvalue
is not withinEPSILON
of 0.0.static boolean
isZero(double value)
Checks ifvalue
is withinEPSILON
of 0.0.static boolean
lineContains(double x0, double y0, double x1, double y1, double x2, double y2)
Checks if point (x0, y0) is in line (x1, y1), (x2, y2).static boolean
linesIntersect(double x1, double y1, double x2, double y2, double x3, double y3, double x4, double y4)
Checks if line (x1, y1), (x2, y2) intersects the line (x3, y3), (x4, y4).static Shape
toShape(java.lang.Object value)
Get a shape forvalue
(if possible).
-
-
-
Field Detail
-
EPSILON
public static final double EPSILON
Small double for "equality" checks.- See Also:
- Constant Field Values
-
-
Method Detail
-
isZero
public static boolean isZero(double value)
Checks ifvalue
is withinEPSILON
of 0.0.
-
isNonZero
public static boolean isNonZero(double value)
Checks ifvalue
is not withinEPSILON
of 0.0.
-
equals
public static boolean equals(double a, double b)
Check if 2 double values are equal (withingEPSILON
of each other).
-
equals
public static boolean equals(double x1, double y1, double x2, double y2)
Check if 2 points equal.
-
lineContains
public static boolean lineContains(double x0, double y0, double x1, double y1, double x2, double y2)
Checks if point (x0, y0) is in line (x1, y1), (x2, y2).
-
linesIntersect
public static boolean linesIntersect(double x1, double y1, double x2, double y2, double x3, double y3, double x4, double y4)
Checks if line (x1, y1), (x2, y2) intersects the line (x3, y3), (x4, y4).
-
getAngle
public static double getAngle(double x0, double y0, double x1, double y1)
Calculate the angle between a line defined by 2 points.
-
toShape
public static Shape toShape(java.lang.Object value)
Get a shape forvalue
(if possible).
-
-