Package xbot.common.math
Class MathUtils
java.lang.Object
xbot.common.math.MathUtils
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic double
constrainDouble
(double value, double lowerBound, double upperBound) static double
constrainDoubleToRobotScale
(double value) static int
constrainInt
(int value, int lowerBound, int upperBound) static double
deadband
(double input, double deadband) static double
static double
exponentAndRetainSign
(double value, int exponent) static double
scaleDouble
(double value, double oldMin, double oldMax, double newMin, double newMax) static double
squareAndRetainSign
(double value)
-
Field Details
-
Tau
public static double Tau
-
-
Constructor Details
-
MathUtils
public MathUtils()
-
-
Method Details
-
constrainDouble
public static double constrainDouble(double value, double lowerBound, double upperBound) -
constrainInt
public static int constrainInt(int value, int lowerBound, int upperBound) -
scaleDouble
public static double scaleDouble(double value, double oldMin, double oldMax, double newMin, double newMax) -
constrainDoubleToRobotScale
public static double constrainDoubleToRobotScale(double value) -
squareAndRetainSign
public static double squareAndRetainSign(double value) -
exponentAndRetainSign
public static double exponentAndRetainSign(double value, int exponent) -
deadband
public static double deadband(double input, double deadband) -
deadband
-