public class R3 extends Object
Constructor and Description |
---|
R3() |
Modifier and Type | Method and Description |
---|---|
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
|
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 doublespublic 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 doublespublic static double normSquared(double[] a)
a
- array of 3 doubles