java.lang.Object
org.jhotdraw8.geom.contour.Utils
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final doublestatic final doubleabsolute threshold to be used for reals in common geometric computation (e.g.static final doubleabsolute threshold to be used for joining slices together at end pointsstatic final double -
Method Summary
Modifier and TypeMethodDescriptionstatic doubleangle(Point2D.Double p0, Point2D.Double p1) Counter clockwise angle of the vector going from p0 to p1.static doubledeltaAngle(double angle1, double angle2) Returns the smaller difference between two angles, result is negative if angle2 < angle1.static booleanfuzzyInRange(double minValue, double value, double maxValue) static booleanfuzzyInRange(double minValue, double value, double maxValue, double epsilon) static OrderedPair<Double, Double> minmax(double a, double b) static doublenormalizeRadians(double angle) Normalize radians to be between 0 and 2PI, e.g.static doubleperpDot(Point2D.Double v0, Point2D.Double v1) static Point2D.DoublepointFromParametric(Point2D.Double p0, Point2D.Double p1, double t) Return the point on the segment going from p0 to p1 at parametric value t.static Point2D.DoubleNormalized perpendicular vector to v (rotating counter clockwise).
-
Field Details
-
realPrecision
public static final double realPrecisionabsolute threshold to be used for reals in common geometric computation (e.g. to check for singularities).- See Also:
-
sliceJoinThreshold
public static final double sliceJoinThresholdabsolute threshold to be used for joining slices together at end points- See Also:
-
tau
public static final double tau- See Also:
-
offsetThreshold
public static final double offsetThreshold- See Also:
-
-
Method Details
-
perpDot
-
minmax
-
fuzzyInRange
public static boolean fuzzyInRange(double minValue, double value, double maxValue) -
fuzzyInRange
public static boolean fuzzyInRange(double minValue, double value, double maxValue, double epsilon) -
pointFromParametric
Return the point on the segment going from p0 to p1 at parametric value t. -
angle
Counter clockwise angle of the vector going from p0 to p1. -
deltaAngle
public static double deltaAngle(double angle1, double angle2) Returns the smaller difference between two angles, result is negative if angle2 < angle1. -
normalizeRadians
public static double normalizeRadians(double angle) Normalize radians to be between 0 and 2PI, e.g. -PI/4 becomes 7PI/8 and 5PI becomes PI. -
unitPerp
Normalized perpendicular vector to v (rotating counter clockwise).
-