|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectmath.linearAlgebra.VectorMath
public final class VectorMath
Title: VectorMath Description: A utility class for vector math. Define static methods for dot products, cross products, etc. Copyright: Copyright (c) 2003 Gould, Christian, and Tobochnik
Constructor Summary | |
---|---|
VectorMath()
|
Method Summary | |
---|---|
static double[] |
cross2D(double[] a,
double b)
Calculate the cross product of a vector within a plane and a vector perpendicular to a plane. |
static double |
cross2D(double[] a,
double[] b)
Calculate the cross product of two vectors that lie within a plane. |
static double |
dot(double[] a)
Calculate the dot product of a vector with itself. |
static double |
dot(double[] a,
double[] b)
Calculate the dot product of two vectors. |
static double |
magnitude(double[] a)
Calculate the magnitude a vector. |
static void |
plus(double[] a,
double[] b)
Add two vectors. |
static void |
plus(double[] a,
double[] b,
double c)
Add a vector times a scalar to a vector. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public VectorMath()
Method Detail |
---|
public static void plus(double[] a, double[] b, double c)
a
- the first vectorb
- the second vectorc
- the scalar multiplierpublic static void plus(double[] a, double[] b)
a
- the first vectorb
- the second vectorpublic static double dot(double[] a, double[] b)
a
- the first vectorb
- the second vector
public static double dot(double[] a)
a
- the vector
public static double magnitude(double[] a)
a
- the vector
public static double cross2D(double[] a, double[] b)
a
- the first vectorb
- the second vector
public static double[] cross2D(double[] a, double b)
a
- the vector in the planeb
- the vector perpendicular to the plane
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |