org.ode4j.math
Class DVector6
java.lang.Object
org.ode4j.math.DVector6
public class DVector6
- extends java.lang.Object
Method Summary |
void |
add(int i,
double d)
|
int |
dim()
|
boolean |
equals(DVector6 v2)
|
double |
get(int i)
|
double |
get0()
|
double |
get1()
|
double |
get2()
|
double |
get3()
|
double |
get4()
|
double |
get5()
|
double |
length()
|
double |
lengthSquared()
|
void |
normalize()
this may be called for vectors `a' with extremely small magnitude, for
example the result of a cross product on two nearly perpendicular vectors. |
boolean |
safeNormalize6()
this may be called for vectors `a' with extremely small magnitude, for
example the result of a cross product on two nearly perpendicular vectors. |
DVector6 |
set(double[] a)
|
DVector6 |
set(double d0,
double d1,
double d2,
double d3,
double d4,
double d5)
|
void |
set(DVector6 v2)
|
void |
set(int i,
double d)
Set a vector/matrix at position i to a specific value. |
void |
set0(double d)
|
void |
set1(double d)
|
void |
set2(double d)
|
void |
set3(double d)
|
void |
set4(double d)
|
void |
set5(double d)
|
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
DVector6
public DVector6()
DVector6
public DVector6(DVector6 v2)
DVector6
public DVector6(double d0,
double d1,
double d2,
double d3,
double d4,
double d5)
set
public DVector6 set(double d0,
double d1,
double d2,
double d3,
double d4,
double d5)
set
public DVector6 set(double[] a)
set
public void set(DVector6 v2)
toString
public java.lang.String toString()
- Overrides:
toString
in class java.lang.Object
dim
public int dim()
get0
public double get0()
get1
public double get1()
get2
public double get2()
get3
public double get3()
get4
public double get4()
get5
public double get5()
get
public final double get(int i)
equals
public boolean equals(DVector6 v2)
set0
public void set0(double d)
set1
public void set1(double d)
set2
public void set2(double d)
set3
public void set3(double d)
set4
public void set4(double d)
set5
public void set5(double d)
set
public final void set(int i,
double d)
- Set a vector/matrix at position i to a specific value.
add
public void add(int i,
double d)
length
public final double length()
- Returns:
- The geometric length of this vector.
lengthSquared
public final double lengthSquared()
safeNormalize6
public final boolean safeNormalize6()
- this may be called for vectors `a' with extremely small magnitude, for
example the result of a cross product on two nearly perpendicular vectors.
we must be robust to these small vectors. to prevent numerical error,
first find the component a[i] with the largest magnitude and then scale
all the components by 1/a[i]. then we can compute the length of `a' and
scale the components by 1/l. this has been verified to work with vectors
containing the smallest representable numbers.
normalize
public void normalize()
- this may be called for vectors `a' with extremely small magnitude, for
example the result of a cross product on two nearly perpendicular vectors.
we must be robust to these small vectors. to prevent numerical error,
first find the component a[i] with the largest magnitude and then scale
all the components by 1/a[i]. then we can compute the length of `a' and
scale the components by 1/l. this has been verified to work with vectors
containing the smallest representable numbers.