|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectus.ihmc.utilities.math.MathTools
public class MathTools
Method Summary | |
---|---|
static void |
checkIfEqual(double val,
double desired,
double epsilon)
|
static void |
checkIfEqual(int val,
int desired)
|
static void |
checkIfInRange(double argument,
double min,
double max)
|
static double |
clipToMinMax(double val,
double min,
double max)
Returns max if max greater than given value Returns min if min less than given value Returns value if value is between max and min |
static float |
clipToMinMax(float val,
float min,
float max)
|
static double |
cube(double x)
|
static double[] |
cumulativeSumDoubles(double[] doubles)
Computes the cumulative sum array for a given array of doubles. |
static java.util.ArrayList<FrameVector> |
diff(java.util.ArrayList<FrameVector> array)
|
static double[] |
diff(double[] array)
Subtracts each element of a double array by the previous element in the array, returns the new array |
static double[] |
dotPlus(double[] array,
double addToAllElementsOfA)
Adds parameter 'addToAllElements' to all elements of the double array and returns the new array |
static int[] |
dotPlus(int[] array,
int addToAllElementsOfA)
Adds parameter 'addToAllElements' to all elements of the integer array and returns the new array |
static boolean |
epsilonEquals(double v1,
double v2,
double epsilon)
True if value |(v1-v2)| <= |epsilon| false if not |
static double |
generateRandomDoubleInRange(java.util.Random random,
double range1,
double range2)
Returns an evenly distributed random number between two bounds. |
static double |
get(javax.vecmath.Tuple3d tuple,
Direction direction)
|
static boolean |
isFinite(double proposed)
|
static boolean |
isFinite(javax.vecmath.Tuple3d tuple)
|
static boolean |
isGreaterThan(double value,
double valueToCompareAgainst,
int precision)
|
static boolean |
isGreaterThanOrEqualTo(double value,
double valueToCompareAgainst,
int precision)
|
static boolean |
isInsideBoundsExclusive(double val,
double min,
double max)
Checks to see if val is Inside Bounds of max and min |
static boolean |
isInsideBoundsInclusive(double val,
double min,
double max)
|
static boolean |
isLessThan(double value,
double valueToCompareAgainst,
int precision)
|
static boolean |
isLessThanOrEqualTo(double value,
double valueToCompareAgainst,
int precision)
|
static boolean |
isNumber(double proposed)
|
static double |
max(double[] array)
Finds and returns the max value in an array of Doubles |
static double |
mean(java.util.ArrayList<java.lang.Double> array)
|
static double |
mean(double[] array)
|
static double |
min(double[] array)
Finds and returns the min value in an array of doubles |
static void |
set(javax.vecmath.Tuple3d tuple,
Direction direction,
double value)
|
static double |
sign(double argument)
Returns the sign of the argument. |
static double |
square(double x)
|
static double |
sumDoubles(java.util.Collection<java.lang.Double> doubles)
Sums the doubles in a collection |
static double |
sumDoubles(double[] doubles)
Finds the sum of doubles in an array |
static int |
sumIntegers(java.util.Collection<java.lang.Integer> integers)
Sums the integers in a collection |
static int |
sumIntegers(int[] integers)
Sums the integers in an array |
static boolean |
withinPercentEquals(double v1,
double v2,
double percent)
True if v2 is within given percent of v1 False otherwise |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static double sign(double argument)
argument
- double
public static int[] dotPlus(int[] array, int addToAllElementsOfA)
array
- int[]addToAllElementsOfA
- int
public static double[] dotPlus(double[] array, double addToAllElementsOfA)
array
- double[]addToAllElementsOfA
- double
public static java.util.ArrayList<FrameVector> diff(java.util.ArrayList<FrameVector> array)
array
- ArrayList
public static double[] diff(double[] array)
array
- double[]
public static double generateRandomDoubleInRange(java.util.Random random, double range1, double range2)
random
- Random number generator.range
- One side of the bounds.range2
- Other side of the bounds.
public static boolean epsilonEquals(double v1, double v2, double epsilon)
v1
- doublev2
- doubleepsilon
- double
public static boolean withinPercentEquals(double v1, double v2, double percent)
v1
- doublev2
- doublepercent
- double
public static double clipToMinMax(double val, double min, double max)
val
- doublemin
- doublemax
- double
public static float clipToMinMax(float val, float min, float max)
public static boolean isInsideBoundsExclusive(double val, double min, double max)
val
- doublemin
- doublemax
- double
public static boolean isInsideBoundsInclusive(double val, double min, double max)
public static int sumIntegers(java.util.Collection<java.lang.Integer> integers)
integers
- collection of integers
public static int sumIntegers(int[] integers)
integers
- array of integers
public static double sumDoubles(java.util.Collection<java.lang.Double> doubles)
doubles
- collection of doubles
public static double sumDoubles(double[] doubles)
array
- double[]
return doublepublic static double[] cumulativeSumDoubles(double[] doubles)
doubles
- input sequence
public static double min(double[] array)
array
- double[]
public static double max(double[] array)
array
- double[]
public static double mean(double[] array)
array
- double[]
public static double mean(java.util.ArrayList<java.lang.Double> array)
array
- ArrayListpublic static void checkIfInRange(double argument, double min, double max)
public static double square(double x)
public static double cube(double x)
public static void checkIfEqual(double val, double desired, double epsilon)
public static boolean isGreaterThan(double value, double valueToCompareAgainst, int precision)
public static boolean isGreaterThanOrEqualTo(double value, double valueToCompareAgainst, int precision)
public static boolean isLessThan(double value, double valueToCompareAgainst, int precision)
public static boolean isLessThanOrEqualTo(double value, double valueToCompareAgainst, int precision)
public static void checkIfEqual(int val, int desired)
public static void set(javax.vecmath.Tuple3d tuple, Direction direction, double value)
public static double get(javax.vecmath.Tuple3d tuple, Direction direction)
public static boolean isFinite(double proposed)
public static boolean isNumber(double proposed)
public static boolean isFinite(javax.vecmath.Tuple3d tuple)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |