public class MoreMath
extends java.lang.Object
Constructor and Description |
---|
MoreMath() |
Modifier and Type | Method and Description |
---|---|
static double[] |
addVectors(double[] x,
double[] y)
Add two vectors and return the vector sum
|
static double[] |
averageVectors(java.util.ArrayList<double[]> list)
Average all of the vectors in a list of vectors and return
the average vector.
|
static double |
log(double x,
double base)
Return logarithm of a given base
|
static double |
log(double x,
int base) |
static double |
log(int x,
double base) |
static double |
log(int x,
int base) |
static void |
printVector(double[] x)
Print a vector in the form [x,y,...z] to standard out
|
static void |
printVector(double[] x,
java.io.PrintStream out)
Print a vector in the form [x,y,...z] to the print stream
|
static double |
roundTo(double num,
int decimalPlaces)
Round a double to the given number of decimalPlaces
|
static double[] |
vectorDivide(double[] x,
double c)
Divide a vector by a scalar and return the resulting vector
|
static double |
vectorLength(double[] values) |
static double |
vectorOneNorm(double[] values) |
public static double roundTo(double num, int decimalPlaces)
public static double log(double x, double base)
public static double log(int x, int base)
public static double log(double x, int base)
public static double log(int x, double base)
public static double[] addVectors(double[] x, double[] y)
public static double[] vectorDivide(double[] x, double c)
public static double[] averageVectors(java.util.ArrayList<double[]> list)
public static void printVector(double[] x)
public static void printVector(double[] x, java.io.PrintStream out)
public static double vectorLength(double[] values)
public static double vectorOneNorm(double[] values)