|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.opensourcephysics.numerics.VectorMath
public final class VectorMath
VectorMath is a utility class for vector math. Contains static methods for dot products, cross products, etc.
| Method Summary | |
|---|---|
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. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static double[] plus(double[] a,
double[] b,
double c)
a - the first vectorb - the second vectorc - the scalar multiplier
public static double[] plus(double[] a,
double[] b)
a - the first vectorb - the second vector
public static double[] normalize(double[] a)
public static double dot(double[] a,
double[] b)
a - the first vectorb - the second vector
public static double[] project(double[] a,
double[] b)
a - the first vectorb - the second vector
public static double[] perp(double[] a,
double[] b)
a - the first vectorb - the second vector
public static double magnitudeSquared(double[] a)
a - the vector
public static double magnitude(double[] a)
a - the vector
public static final double[] cross3D(double[] v1,
double[] v2)
v1 - the first vectorv2 - the second vector
public static double[] cross2D(double[] v,
double b)
v - the vector in the planeb - the vector perpendicular to the plane
public static double cross2D(double[] a,
double[] b)
a - the first vectorb - the second vector
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||