|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectmfc.vector.Real3
This class represents a real 3-vector (x, y, z).
All methods avoid the creation of temporarily used objects in their internal computations unless stated in their descriptions.
| Field Summary | |
static double |
EPSILON
Threashold for zero tests. |
double |
x
The x-component. |
double |
y
The y-component. |
double |
z
The zcomponent. |
| Constructor Summary | |
Real3()
Create the zero vector. |
|
Real3(double theX,
double theY,
double theZ)
Create a vector with given entries. |
|
Real3(Real3 v)
Create a copy of the given vector. |
|
| Method Summary | |
void |
assign(double newX,
double newY,
double newZ)
Assign this with the given entries. |
void |
assign(Real3 v)
Assign this this with the given vector. |
void |
assignCrossProduct(Real3 v,
Real3 w)
Assign this with cross product of two vectors. |
void |
assignDivide(double a)
Divide by a scalar. |
void |
assignLinearCombination(double a,
Real3 v,
double b,
Real3 w)
Assign this with a linear combination of two vectors. |
void |
assignMinus(Real3 v)
Subtract a vector. |
void |
assignPlus(Real3 v)
Add a vector. |
void |
assignTimes(double a)
Multiply by a scalar. |
void |
assignZero()
Assign this with zero. |
Real3 |
copy()
Create a copy of this and return it. |
static double |
dotProduct(Real3 v,
Real3 w)
Return dot product of two vectors. |
double |
getX()
Get the value of x. |
double |
getY()
Get the value of y. |
double |
getZ()
Get the value of z. |
double |
norm()
Return the length of this. |
void |
normalize()
Normalize this. |
double |
normSquared()
Return the square length of this. |
void |
projectTo(ComplexProjective1 cp)
Project a point on the unit sphere stereographically from the north pole to complex projective space. |
void |
setX(double v)
Set the value of x. |
void |
setY(double v)
Set the value of y. |
void |
setZ(double v)
Set the value of z. |
java.lang.String |
toString()
Return a String representation of this. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
public static final double EPSILON
public double x
public double y
public double z
| Constructor Detail |
public Real3()
public Real3(double theX,
double theY,
double theZ)
public Real3(Real3 v)
| Method Detail |
public double getX()
public void setX(double v)
v - value to assign to xpublic double getY()
public void setY(double v)
v - value to assign to ypublic double getZ()
public void setZ(double v)
v - value to assign to zpublic Real3 copy()
this and return it.
thispublic void assignZero()
this with zero.
public void assign(double newX,
double newY,
double newZ)
this with the given entries.
public void assign(Real3 v)
this this with the given vector.
public void assignPlus(Real3 v)
v - the vector to addpublic void assignMinus(Real3 v)
v - the vector to subtractpublic void assignTimes(double a)
a - the scalarpublic void assignDivide(double a)
a - the scalar
public void assignLinearCombination(double a,
Real3 v,
double b,
Real3 w)
this with a linear combination of two vectors.
a - a double, the factor of vv - a Real3b - a double, the factor of ww - a Real3
public void assignCrossProduct(Real3 v,
Real3 w)
this with cross product of two vectors.
v - first factor in cross product.w - second factor in cross product.
public static final double dotProduct(Real3 v,
Real3 w)
v - a Real3w - a Real3
v.x * w.x + v.y * w.y + v.z * w.zpublic double normSquared()
this.
dotProduct(this, this)norm(),
normalize()public double norm()
this.
&sqrt;(x * x + y * y + z * z)normSquared(),
normalize()public void normalize()
Normalize this.
Divide this by norm().
normSquared(),
norm(),
normalize()
public void projectTo(ComplexProjective1 cp)
throws java.lang.IllegalArgumentException
Project a point on the unit sphere stereographically from the north pole to complex projective space.
(0, 0, 1) is projected to the point with homogeneous
coordinates (1, 0).
(0, 0, -1) is
projected to the point with homogenous coordinates (0,
1).
cp - the ComplexProjective1 used to hand over the
result. Must not be null.
java.lang.IllegalArgumentException - if normSquared() differs from
1.0 by more than EPSILONpublic java.lang.String toString()
String representation of this.
String representation of this
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||