|
JNISpice version 2.0.0 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectspice.basic.Matrix33
public class Matrix33
Class Matrix33 represents 3 by 3 double precision matrices.
Version 1.0.0 22-DEC-2009 (NJB)
Constructor Summary | |
---|---|
Matrix33()
No-arguments constructor: create a zero-filled 3x3 matrix. |
|
Matrix33(double[] array)
Construct a Matrix33 from an array of type double[]. |
|
Matrix33(double[][] array3x3)
Construct a Matrix33 from an array of type double[][]. |
|
Matrix33(int axisIndex,
double angle)
Construct a rotation matrix that transforms vectors from the standard basis to a basis rotated about a specified coordinate axis by a specified angle. |
|
Matrix33(Matrix33 matrix)
Construct a Matrix33 from another Matrix33. |
|
Matrix33(Vector3 axis,
double angle)
Construct a rotation matrix that rotates vectors about a specified axis vector by a specified angle. |
|
Matrix33(Vector3 primaryVector,
int primaryIndex,
Vector3 secondaryVector,
int secondaryIndex)
Construct a rotation matrix representing a reference frame defined by primary and secondary vectors. |
|
Matrix33(Vector3 row0,
Vector3 row1,
Vector3 row2)
Construct a Matrix33 from a set of three row vectors. |
Method Summary | |
---|---|
Matrix33 |
add(Matrix33 m2)
Add this instance to another Matrix33 instance. |
double |
det()
Return the determinant of this instance. |
double |
dist(Matrix33 m2)
Return the vector (L2) distance between this instance and another Matrix33 instance. |
static Matrix33 |
fill(double value)
Fill all elements of a matrix with a given constant. |
double |
getElt(int i,
int j)
Return the element of this instance at index [i][j]. |
static Matrix33 |
identity()
Return the identity matrix. |
Matrix33 |
invert()
Invert this instance. |
boolean |
isRotation(double normTol,
double determinantTol)
Indicate whether this instance is a rotation matrix. |
Matrix33 |
mtxm(Matrix33 m2)
Multiply a Matrix33 instance on the left by the transpose of this instance. |
Vector3 |
mtxv(Vector3 vin)
Multiply a vector on the left by the transpose of this instance. |
Matrix33 |
mxm(Matrix33 m2)
Multiply another Matrix33 instance on the left by this instance. |
Matrix33 |
mxmt(Matrix33 m2)
Multiply the transpose of a Matrix33 instance on the left by this instance. |
Vector3 |
mxv(Vector3 vin)
Multiply a Vector3 on the left by this instance. |
double |
norm()
Compute the vector (L2) norm of this instance. |
Matrix33 |
scale(double s)
Multiply this instance by a scalar. |
Matrix33 |
sub(Matrix33 m2)
Subtract another Matrix33 instance from this instance. |
double[][] |
toArray()
Return a 3x3 array containing the contents of this Matrix33 instance. |
double[] |
toArray1D()
Return a 1-dimensional array containing the contents of this Matrix33 instance. |
java.lang.String |
toString()
Convert this instance to a String. |
Matrix33 |
xpose()
Transpose this instance. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Matrix33()
public Matrix33(Matrix33 matrix)
public Matrix33(double[][] array3x3) throws SpiceException
SpiceException
public Matrix33(double[] array) throws SpiceException
The array is considered to consist of rows 0-2 of the matrix, in that order.
SpiceException
public Matrix33(Vector3 row0, Vector3 row1, Vector3 row2)
public Matrix33(Vector3 primaryVector, int primaryIndex, Vector3 secondaryVector, int secondaryIndex) throws SpiceException
This constructor is analogous to the twovec_c function of CSPICE.
The association of axes and axis numbers is as follows:
axis index ---- ----- X 1 Y 2 Z 3
The matrix created by this constructor transforms vectors from the standard basis to that defined by the input vectors.
The numerical results shown for this example may differ across platforms. The results depend on the compiler and supporting libraries, and the machine specific arithmetic implementation.
Create a matrix that transforms vectors from the standard basis to one whose X-axis is aligned with the vector (1,1,1) and whose Z-axis is aligned with the component of (0,0,1) that is orthogonal to its X-axis.
import spice.basic.*; class Twovec { // // Load the JNISpice shared library. // static { System.loadLibrary( "JNISpice" ); } public static void main ( String[] args ) { try { Vector3 primary = new Vector3( 1, 1, 1 ); Vector3 secondary = new Vector3( 0, 0, 1 ); Matrix33 r = new Matrix33( primary, 1, secondary, 3 ); System.out.println ( r ); } catch ( SpiceException exc ) { exc.printStackTrace(); } } }
When run on a PC/Linux/java 1.6.0_14/gcc platform, the output from this program was (lines below were wrapped to fit into the 80 character page width):
5.7735026918962580e-01, 5.7735026918962580e-01, 5.773502691896258 0e-01, -7.0710678118654750e-01, 7.0710678118654750e-01, 0.000000000000000 0e+00, -4.0824829046386310e-01, -4.0824829046386310e-01, 8.164965809277261 0e-01
SpiceException
public Matrix33(int axisIndex, double angle) throws SpiceException
This constructor is analogous to the rotate_c function of CSPICE.
The association of axes and axis numbers is as follows:
axis index ---- ----- X 1 Y 2 Z 3
The angle is expressed in radians.
SpiceException
public Matrix33(Vector3 axis, double angle) throws SpiceException
This constructor is analogous to the axisar_c function of CSPICE.
The angle is expressed in radians.
SpiceException
Method Detail |
---|
public Matrix33 add(Matrix33 m2)
public double det() throws SpiceException
SpiceException
public double dist(Matrix33 m2)
public static Matrix33 fill(double value)
public double getElt(int i, int j) throws SpiceException
SpiceException
public static Matrix33 identity()
public Matrix33 invert() throws SpiceException
SpiceException
public boolean isRotation(double normTol, double determinantTol) throws SpiceException
The input tolerance values are used, respectively, as the maximum deviation of the magnitude of the matrix's columns from 1 and of the matrix's determinant from 1.
SpiceException
public Matrix33 mxm(Matrix33 m2)
public Matrix33 mtxm(Matrix33 m2)
public Vector3 mtxv(Vector3 vin)
public Matrix33 mxmt(Matrix33 m2)
public Vector3 mxv(Vector3 vin)
public double norm()
public Matrix33 sub(Matrix33 m2)
public Matrix33 scale(double s)
public double[][] toArray()
public double[] toArray1D()
public java.lang.String toString()
toString
in class java.lang.Object
public Matrix33 xpose()
|
JNISpice version 2.0.0 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |