public final class VectorMath
extends java.lang.Object
| Modifier and Type | Method | Description |
|---|---|---|
static double[] |
cross2D(double[] v,
double b) |
Calculates the cross product of a double[2] vector in a plane and a vector perpendicular to that plane.
|
static double |
cross2D(double[] a,
double[] b) |
Calculate the cross product of two-component vectors.
|
static double[] |
cross3D(double[] v1,
double[] v2) |
Calculates the vector cross product of double[3] vectors v1 and v2.
|
static double |
dot(double[] a,
double[] b) |
Calculate the dot product of two vectors.
|
static double |
magnitude(double[] a) |
Calculates the magnitude a vector.
|
static double |
magnitudeSquared(double[] a) |
Computes the magnitdue squared of this vector.
|
static double[] |
normalize(double[] a) |
|
static double[] |
perp(double[] a,
double[] b) |
Computes the part of the first vector that is perpendicular to the second vector.
|
static double[] |
plus(double[] a,
double[] b) |
Add two vectors.
|
static double[] |
plus(double[] a,
double[] b,
double c) |
Add a vector times a scalar to a vector.
|
static double[] |
project(double[] a,
double[] b) |
Projects the first vector onto the second vector.
|
public static double[] plus(double[] a,
double[] b,
double c)
a - the first vectorb - the second vectorc - the scalar multiplierpublic static double[] plus(double[] a,
double[] b)
a - the first vectorb - the second vectorpublic static double[] normalize(double[] a)
public static double dot(double[] a,
double[] b)
a - the first vectorb - the second vectorpublic static double[] project(double[] a,
double[] b)
a - the first vectorb - the second vectorpublic static double[] perp(double[] a,
double[] b)
a - the first vectorb - the second vectorpublic static double magnitudeSquared(double[] a)
a - the vectorpublic static double magnitude(double[] a)
a - the vectorpublic static final double[] cross3D(double[] v1,
double[] v2)
v1 - the first vectorv2 - the second vectorpublic static double[] cross2D(double[] v,
double b)
v - the vector in the planeb - the vector perpendicular to the planepublic static double cross2D(double[] a,
double[] b)
a - the first vectorb - the second vector