public class R3 extends BaseVector<R3> implements java.io.Serializable
Modifier and Type | Class and Description |
---|---|
static class |
R3.IND
Class
R3x3.IND is an enumeration of the matrix indices
for the R3x3 class. |
Modifier and Type | Field and Description |
---|---|
static int |
INT_SIZE
number of dimensions (DIM=3)
|
ATTR_DATA
Constructor and Description |
---|
R3()
Creates a new instance of R3, the zero element.
|
R3(DataAdaptor daSource)
Initializing constructor for
R3 . |
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.
|
Modifier and Type | Method and Description |
---|---|
R3 |
cartesian2Cylindrical()
Apply coordinate transform from cartesian to cylindrical coordinates.
|
R3 |
cartesian2Spherical()
Apply coordinate transform from cartesian to spherical coordinates.
|
R3 |
clone()
Creates and returns a deep copy of this vector.
|
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.
|
protected R3 |
newInstance()
Handles object creation required by the base class.
|
static R3 |
parse(java.lang.String strTokens)
Create a new instance of R3 with initial value determined
by the formatted string argument.
|
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 |
setAll(double s)
Set all coordinates to 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 |
squared()
Returns the vector of squared elements.
|
R3 |
times(R3 r)
Vector multiplication using three-dimensional cross product.
|
double[] |
toArray()
Get all the vector values as a 3-array.
|
java.lang.String |
toString()
Convert the vector contents to a string.
|
static R3 |
zero()
Create a new instance of the zero vector.
|
assignUnity, assignZero, copyVector, embedIn, getArrayCopy, getElem, getElem, getSize, hashCode, innerProd, isEquivalentTo, leftMultiply, load, minus, minusEquals, negate, negateEquals, norm1, norm2, normInf, plus, plusEquals, print, print, println, projectOnto, rightMultiply, save, setElem, setElem, setVector, setVector, setVector, times, timesEquals
public static final int INT_SIZE
public R3()
public R3(double x1, double x2, double x3)
x1
- first coordinate valuex2
- first coordinate valuex3
- first coordinate valuejava.lang.ArrayIndexOutOfBoundsException
- the argument must have the same length as this vectorpublic R3(double[] arrVals) throws java.lang.ArrayIndexOutOfBoundsException
R3
object are zero.arrVals
- double array of initializing valuesjava.lang.ArrayIndexOutOfBoundsException
- the argument must have the same length as this vectorpublic R3(R3 vecPt)
vecPt
- deep copies this valuepublic R3(java.lang.String strTokens) throws java.lang.NumberFormatException, java.lang.IllegalArgumentException
Create a new instance of R3 with specified initial value specified by the formatted string argument.
The string should be formatted as
"(x,y,z)"
where x, y, z are floating point representations.
strTokens
- token string representing values phase coordinatesjava.lang.IllegalArgumentException
- wrong number of tokens in argument (must be 6 or 7)java.lang.NumberFormatException
- bad numeric value, unparseablepublic R3(DataAdaptor daSource)
R3
. Initial values are taken
from the data source provided. The values are parsed from a numeric string
and identified by the tag BaseVector#ATTR_Data
.daSource
- interface to data source containing initialization datapublic 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 coordinatesjava.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 valuejava.lang.ArrayIndexOutOfBoundsException
- the index i was greater than 2public void set1(double x1)
x1
- first coordinate of 3-vectorpublic void set2(double x2)
x2
- second coordinate of 3-vectorpublic void set3(double x3)
x3
- third coordinate of 3-vectorpublic void setx(double x)
x
- first coordinate of 3-vectorpublic void sety(double y)
y
- second coordinate of 3-vectorpublic void setz(double z)
z
- first coordinate of 3-vectorpublic void setAll(double s)
s
- new value of all vector coordinatespublic double[] toArray()
public double get1()
public double get2()
public double get3()
public double getx()
public double gety()
public double getz()
public R3 clone()
clone
in class BaseVector<R3>
BaseVector.clone()
public java.lang.String toString()
toString
in class BaseVector<R3>
public R3 cartesian2Cylindrical()
public R3 cartesian2Spherical()
public R3 cylindrical2Cartesian()
public R3 spherical2Cartesian()
public R3 times(R3 r)
r
- second (right) operand in cross-product (this is first operand)public R3 squared()
protected R3 newInstance()
newInstance
in class BaseVector<R3>
V
BaseVector.newInstance()