@Test void clamp() { assertEquals(MathUtil.clamp(1.25), 1.0); assertEquals(MathUtil.clamp(-5.5), -1.0); assertEquals(MathUtil.clamp(Double.MAX_VALUE), 1.0); assertEquals(MathUtil.clamp(Double.NEGATIVE_INFINITY), -1.0); assertEquals(MathUtil.clamp(0.10118304), 0.10118304); assertEquals(MathUtil.clamp(-0.8572), -0.8572); }
public static double clamp(double d) { return Math.min(Math.max(d, -1), 1); }
MathUtil { public static double clamp(double d) { return Math.min(Math.max(d, -1), 1); } }
MathUtil { public static double clamp(double d) { return Math.min(Math.max(d, -1), 1); }  }
MathUtil { public static double clamp(double d) { return Math.min(Math.max(d, -1), 1); }  static double angleWrap(double angle); static double clamp(double d); static double clampAbove(double d, double threshold); static double cutOffBelow(double d, double threshold); static double powRetainingSign(double d, double power); static double deadZone(double d, double thresh); static Pose relativeOdometryUpdate(Pose fieldPose, Pose robotPoseDelta); static boolean approxEquals(double d1, double d2); static Point lineSegmentCircleIntersection(Point ul1, Point ul2, Point o, double radius); static boolean between(double r1, double r2, double val, double threshold); }
MathUtil { public static double clamp(double d) { return Math.min(Math.max(d, -1), 1); }  static double angleWrap(double angle); static double clamp(double d); static double clampAbove(double d, double threshold); static double cutOffBelow(double d, double threshold); static double powRetainingSign(double d, double power); static double deadZone(double d, double thresh); static Pose relativeOdometryUpdate(Pose fieldPose, Pose robotPoseDelta); static boolean approxEquals(double d1, double d2); static Point lineSegmentCircleIntersection(Point ul1, Point ul2, Point o, double radius); static boolean between(double r1, double r2, double val, double threshold); static final double EPSILON; }