public final class Vectors
extends java.lang.Object
Constructor and Description |
---|
Vectors() |
Modifier and Type | Method and Description |
---|---|
static double[] |
add(double[] vecA,
double[] vecB)
Adds each element from two vectors and returns the result as a new vector.
|
static double |
length(double[] vec)
Calculates the (geometric) length of a vector.
|
static double[] |
max(double[] vecA,
double[] vecB)
Creates a new vector containing the larger elements from both vectors,
that is
r[n] = max(a[n], b[n]) . |
static double[] |
min(double[] vecA,
double[] vecB)
Creates a new vector containing the smaller elements from both vectors,
that is
r[n] = min(a[n], b[n]) . |
static void |
normalize(double[] vec)
Normalizes all elements of a vector.
|
static double |
sum(double[] vec)
Calculates the sum of a vector.
|
public static double[] add(double[] vecA, double[] vecB)
public static double[] max(double[] vecA, double[] vecB)
r[n] = max(a[n], b[n])
.public static double[] min(double[] vecA, double[] vecB)
r[n] = min(a[n], b[n])
.public static double sum(double[] vec)
public static double length(double[] vec)
public static void normalize(double[] vec)