Class Utils

java.lang.Object
org.jhotdraw8.geom.contour.Utils

public class Utils extends Object
  • Field Details

    • realPrecision

      public static final double realPrecision
      absolute threshold to be used for reals in common geometric computation (e.g. to check for singularities).
      See Also:
    • sliceJoinThreshold

      public static final double sliceJoinThreshold
      absolute 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

      public static double perpDot(Point2D.Double v0, Point2D.Double v1)
    • minmax

      public static OrderedPair<Double,Double> minmax(double a, double b)
    • 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

      public static Point2D.Double pointFromParametric(Point2D.Double p0, Point2D.Double p1, double t)
      Return the point on the segment going from p0 to p1 at parametric value t.
    • angle

      public static double angle(Point2D.Double p0, Point2D.Double p1)
      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

      public static Point2D.Double unitPerp(Point2D.Double v)
      Normalized perpendicular vector to v (rotating counter clockwise).