|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.jreality.tutorial.projects.ksurfaces.R3
public class R3
This class provides simple static methods to do verctor calculation in R3. The vectors of R3 are represented by array of 3 doubles.
Constructor Summary | |
---|---|
R3()
|
Method Summary | |
---|---|
static void |
copy(double[] a,
double[] target)
target = a, copy the entries of a into target |
static void |
cross(double[] a,
double[] b,
double[] target)
target = a x b, i.e., the cross product or vector product WARNING: This method fails when the target is same as one of its arguments. |
static double |
dot(double[] a,
double[] b)
<a,b>, i.e., the dot product or inner product |
static void |
minus(double[] a,
double[] b,
double[] target)
target = a-b |
static double |
norm(double[] a)
|a|, the length of a vector. |
static double |
normSquared(double[] a)
|a|^2, the square of the length of a vector. |
static void |
plus(double[] a,
double[] b,
double[] target)
target = a + b |
static void |
times(double s,
double[] a,
double[] target)
target = s * a, product of a real with a vector |
static void |
zero(double[] target)
target = 0, reset the three entries of target to 0 |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public R3()
Method Detail |
---|
public static final void plus(double[] a, double[] b, double[] target)
a
- array of 3 doublesb
- array of 3 doublestarget
- array of 3 doublespublic static final void minus(double[] a, double[] b, double[] target)
a
- array of 3 doublesb
- array of 3 doublestarget
- array of 3 doublespublic static final void cross(double[] a, double[] b, double[] target)
a
- array of 3 doublesb
- array of 3 doublestarget
- array of 3 doublespublic static final void copy(double[] a, double[] target)
a
- array of 3 doublestarget
- array of 3 doublespublic static final void zero(double[] target)
target
- array of 3 doublespublic static final double dot(double[] a, double[] b)
a
- array of 3 doublesb
- array of 3 doubles
public static final void times(double s, double[] a, double[] target)
s
- the scalar reala
- array of 3 doublestarget
- array of 3 doublespublic static double norm(double[] a)
a
- array of 3 doubles
public static double normSquared(double[] a)
a
- array of 3 doubles
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |