|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.deegree.commons.utils.math.Vectors3d
public class Vectors3d
The Vectors3f
class supplies convenience methods for 3 dimensional vector (represented as a double array
with length 3 ) calculations. No checking what so ever is done, so the callee has to make sure the arrays are
initialized and have a length of 3.
Two different methods of almost all functions exist, one which creates a new allocated array and one which puts the result in a supplied array. Again, the callee has to make sure the supplied array is initialized and has a length of at least 3.
Constructor Summary | |
---|---|
Vectors3d()
|
Method Summary | |
---|---|
static String |
asString(double[] a)
|
static double[] |
cross(double[] a,
double[] b)
Calculate the cross product of given vectors and store the result in a new allocated array of length 3. |
static void |
cross(double[] a,
double[] b,
double[] result)
Calculate the cross product of given vectors and store the result in given result vector with length 3 |
static double |
dot(double[] a,
double[] b)
Calculate the dot product of given vectors (with length 3). |
static double |
length(double[] a)
|
static double[] |
normal(double[] a,
double[] b,
double[] c)
Calculate the normal vector for given vectors a, b, c by calculating the cross product from ab x ac and store the result in a new allocated array with length 3. |
static void |
normal(double[] a,
double[] b,
double[] c,
double[] result)
Calculate the normal vector for given vectors a, b, c by calculating the cross product from ab x ac and store the result in given result vector. |
static double[] |
normal(double[] a,
int index)
Calculate the normal vector for vectors starting at index by using the vectors a=(index, index+1, index+2), b=(index+3, index+4, index+5) and c=(index+6, index+7, index+8) by calculating the cross product from ab x ac and store the result in a new allocated array with length 3. |
static void |
normal(double[] a,
int index,
double[] result)
Calculate the normal vector for vectors starting at index by using the vectors a=(index, index+1, index+2), b=(index+3, index+4, index+5) and c=(index+6, index+7, index+8) by calculating the cross product from ab x ac and store the result in given array with length 3. |
static double[] |
normal(double[] a,
int ia,
int ib,
int ic)
Calculate the normal vector for vectors starting at index by using the vectors a=(ia, ia+1, ia+2), b=(ib, ib+1, ib+3) and c=(ic, ic+1, ic+2) by calculating the cross product from ab x ac and store the result in a new allocated array with length 3. |
static void |
normal(double[] a,
int ia,
int ib,
int ic,
double[] result)
Calculate the normal vector for vectors starting at given indizes a=(ia, ia+1, ia+2), b=(ib, ib+1, ib+2) and c=(ic, ic+1, ic+2) by calculating the cross product from ab x ac and store the result in given array with length 3. |
static double[] |
normalize(double[] a)
Normalize the given vector (of length 3) and store the result in a new allocated array of length 3. |
static double[] |
normalizedNormal(double[] a,
double[] b,
double[] c)
Calculate the normalized normal vector for given triangle with vertices a, b, c by calculating the cross product from ab x ac and normalize the result which will be stored in a new allocated array of length 3. |
static void |
normalizedNormal(double[] a,
double[] b,
double[] c,
double[] result)
Calculate the normalized normal vector for given triangle with vertices a, b, c by calculating the cross product from ab x ac and normalize the result which will be stored in the given result array with length 3. |
static double[] |
normalizedNormal(double[] a,
int index)
Calculate the normal vector for vectors starting at index by using the vectors a=(index, index+1, index+2), b=(index+3, index+4, index+5) and c=(index+6, index+7, index+8) by calculating the cross product from ab x ac and store the result in a new allocated array with length 3. |
static void |
normalizedNormal(double[] a,
int index,
double[] result)
Calculate the normalized normal vector for given triangle with vertices a=(index, index+1, index+2), b=(index+3, index+4, index+5) and c=(index+6, index+7, index+8) by calculating the cross product from ab x ac and normalize the result which will be stored in the given result array with length 3. |
static double[] |
normalizedNormal(double[] a,
int ia,
int ib,
int ic)
Calculate the normal vector for vectors starting at index by using the vectors a=(ia, ia+1, ia+2), b=(ib, ib+1, ib+2) and c=(ic, ic+1, ic+2) by calculating the cross product from ab x ac and store the result in a new allocated array with length 3. |
static void |
normalizedNormal(double[] a,
int ia,
int ib,
int ic,
double[] result)
Calculate the normalized normal vector for given triangle with vertices a=(ia, ia+1, ia+2), b=(ib, ib+1, ib+2) and c=(ic, ic+1, ic+2) by calculating the cross product from ab x ac and normalize the result which will be stored in the given result array with length 3. |
static void |
normalizeInPlace(double[] a)
Normalize the given vector (of length 3) in place. |
static double[] |
sub(double[] a,
double[] b)
Subtract b from a and store the result in a new allocated double[3] array. |
static void |
sub(double[] a,
double[] b,
double[] result)
Subtract b from a and store the result in result. |
static double[] |
sub(double[] a,
int ia,
int ib)
|
static void |
sub(double[] a,
int ia,
int ib,
double[] result)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Vectors3d()
Method Detail |
---|
public static void sub(double[] a, double[] b, double[] result)
a
- array with length 3b
- array with length 3result
- array with length 3public static double[] sub(double[] a, double[] b)
a
- array with length 3b
- array with length 3
public static void sub(double[] a, int ia, int ib, double[] result)
a
- an array containing the ordinates of the vectorsia
- index of the first vectorib
- index of the second vectorresult
- an array with length 3public static double[] sub(double[] a, int ia, int ib)
a
- an array containing the ordinates of the vectorsia
- index of the first vectorib
- index of the second vector
public static final String asString(double[] a)
a
- array with length 3
public static final double[] normal(double[] a, int index)
a
- array with length > index + 9index
- index of the first vector
public static final double[] normal(double[] a, int ia, int ib, int ic)
a
- array containing the ordinates of the vectorsia
- index of the first vectorib
- index of the second vectoric
- index of the third vector
public static final void normal(double[] a, int ia, int ib, int ic, double[] result)
a
- array containing the ordinates of the vectorsia
- index of the first vectorib
- index of the second vectoric
- index of the third vectorresult
- array with length 3
IndexOutOfBoundsException
- if one of the indizes doesn't fitpublic static final void normal(double[] a, int index, double[] result)
a
- an array containing the ordinates of the vectors with length > index + 9index
- index of the first vectorresult
- array with length 3
IndexOutOfBoundsException
- if a.length < index +9public static final double[] normalizedNormal(double[] a, int index)
a
- array containing the ordinates of the vectors with length > index + 9index
- index of the first vector
public static final double[] normalizedNormal(double[] a, int ia, int ib, int ic)
a
- array containing the ordinates of the vectorsia
- index of the first vectorib
- index of the second vectoric
- index of the third vector
public static final void normalizedNormal(double[] a, int index, double[] result)
a
- array containing the ordinates of the vectors with length > index + 9index
- index of the first vectorresult
- array with length 3public static final void normalizedNormal(double[] a, int ia, int ib, int ic, double[] result)
a
- array containing the ordinates of the vectorsia
- index of the first vectorib
- index of the second vectoric
- index of the third vectorresult
- array with length 3public static final double[] normal(double[] a, double[] b, double[] c)
a
- array with length 3b
- array with length 3c
- array with length 3
public static final void normal(double[] a, double[] b, double[] c, double[] result)
a
- array with length 3b
- array with length 3c
- array with length 3result
- array with length 3public static final double[] normalizedNormal(double[] a, double[] b, double[] c)
a
- array with length 3b
- array with length 3c
- array with length 3
public static final void normalizedNormal(double[] a, double[] b, double[] c, double[] result)
a
- array with length 3b
- array with length 3c
- array with length 3result
- array with length 3public static final double[] cross(double[] a, double[] b)
a
- array with length 3b
- array with length 3
public static final void cross(double[] a, double[] b, double[] result)
a
- array with length 3b
- array with length 3result
- array with length 3public static final double dot(double[] a, double[] b)
a
- array with length 3b
- array with length 3
public static final double length(double[] a)
a
- array with length 3
public static final void normalizeInPlace(double[] a)
a
- array with length 3public static final double[] normalize(double[] a)
a
- array with length 3
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |