|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--gov.sns.tools.math.r3.R3
Represents an element of R^3, the three-dimensional cartesian real space.
| Field Summary | |
double |
x1
first coordinate |
double |
x2
second coordinate |
double |
x3
third coordinate |
| Constructor Summary | |
R3()
Creates a new instance of R3, the zero element. |
|
R3(double[] arrVals)
Creates a new instance of R3 initialized to argument. |
|
R3(double x1,
double x2,
double x3)
Creates a new instance of R3 initialized to arguments. |
|
R3(R3 vecPt)
Creates a new instance of R3 initialized to argument. |
|
R3(java.lang.String strTokens)
Create a new instance of R3 with specified initial value specified by the formatted string argument. |
|
| Method Summary | |
R3 |
cartesian2Cylindrical()
Apply coordinate transform from cartesian to cylindrical coordinates. |
R3 |
cartesian2Spherical()
Apply coordinate transform from cartesian to spherical coordinates. |
R3 |
copy()
Performs a deep copy operation. |
R3 |
cylindrical2Cartesian()
Apply coordinate transform from cylindrical to cartesian coordinates |
double |
get1()
Return first coordinate value. |
double |
get2()
Return second coordinate value. |
double |
get3()
Return third coordinate value. |
double |
getx()
Return first coordinate value. |
double |
gety()
Return second coordinate value. |
double |
getz()
Return third coordinate value. |
R3 |
minus(R3 r)
Vector subtraction. |
double |
norm2()
Compute the l2 norm of the vector in R3. |
static R3 |
parse(java.lang.String strTokens)
Create a new instance of R3 with initial value determined by the formatted string argument. |
R3 |
plus(R3 r)
Vector addition. |
void |
print(java.io.PrintWriter os)
Print out centents on an output stream. |
void |
println(java.io.PrintWriter os)
Print out centents on an output stream, terminate with new line character. |
void |
set(double s)
Set all coordinates to value |
void |
set(int i,
double val)
Set index to value. |
void |
set1(double x1)
Set first coordinate value. |
void |
set2(double x2)
Set second coordinate value. |
void |
set3(double x3)
Set third coordinate value. |
void |
setx(double x)
Set first coordinate value. |
void |
sety(double y)
Set second coordinate value. |
void |
setz(double z)
Set third coordinate value. |
R3 |
spherical2Cartesian()
Apply coordinate tranform from spherical to cartesian coordinates |
R3 |
times(double s)
Scalar multiplication. |
R3 |
times(R3 r)
Vector multiplication using three-dimensional cross product. |
java.lang.String |
toString()
Convert the vector contents to a string. |
static R3 |
zero()
Create a new instance of the zero vector. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
public double x1
public double x2
public double x3
| Constructor Detail |
public R3()
public R3(double x1,
double x2,
double x3)
x1 - first coordinate valuex2 - first coordinate valuex3 - first coordinate valuepublic R3(double[] arrVals)
R3 object are zero.
arrVals - double array of initializing valuespublic R3(R3 vecPt)
vecPt - deep copies this value
public R3(java.lang.String strTokens)
throws java.lang.NumberFormatException,
java.lang.IllegalArgumentException
strTokens - token string representing values phase coordinates
java.lang.IllegalArgumentException - wrong number of tokens in argument (must be 6 or 7)
java.lang.NumberFormatException - bad numeric value, unparseable| Method Detail |
public static R3 zero()
public static R3 parse(java.lang.String strTokens)
throws java.lang.NumberFormatException,
java.lang.IllegalArgumentException
strTokens - six-token string representing values phase coordinates
java.lang.IllegalArgumentException - wrong number of tokens in argument (must be 6)
java.lang.NumberFormatException - bad numeric value, unparseablepublic R3 copy()
public void set(int i,
double val)
throws java.lang.ArrayIndexOutOfBoundsException
i - element index 0<=i<=2val - new element value
java.lang.ArrayIndexOutOfBoundsExceptionpublic void set1(double x1)
public void set2(double x2)
public void set3(double x3)
public void setx(double x)
public void sety(double y)
public void setz(double z)
public void set(double s)
public double get1()
public double get2()
public double get3()
public double getx()
public double gety()
public double getz()
public java.lang.String toString()
toString in class java.lang.Objectpublic R3 cartesian2Cylindrical()
public R3 cartesian2Spherical()
public R3 cylindrical2Cartesian()
public R3 spherical2Cartesian()
public R3 times(double s)
s - scalar to multiply this vector
public R3 plus(R3 r)
r - vector displacement
public R3 minus(R3 r)
r - vector displacement
public R3 times(R3 r)
r - second (right) operand in cross-product (this is first operand)
public double norm2()
public void print(java.io.PrintWriter os)
os - output stream receive content dumppublic void println(java.io.PrintWriter os)
os - output stream receive content dump
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||