Class Matrix
java.lang.Object
org.shredzone.commons.suncalc.util.Matrix
A three dimensional matrix.
 
Objects are immutable and threadsafe.
- 
Method Summary
Modifier and TypeMethodDescriptionAdds a matrix to this matrix.booleandoubleget(int r, int c) Gets a value from the matrix.inthashCode()static Matrixidentity()Creates an identity matrix.multiply(double scalar) Performs a scalar multiplication.Multiplies two matrices.Applies this matrix to aVector.negate()Negates this matrix.static MatrixrotateX(double angle) Creates a matrix that rotates a vector by the given angle at the X axis.static MatrixrotateY(double angle) Creates a matrix that rotates a vector by the given angle at the Y axis.static MatrixrotateZ(double angle) Creates a matrix that rotates a vector by the given angle at the Z axis.Subtracts a matrix from this matrix.toString()Transposes this matrix. 
- 
Method Details
- 
identity
Creates an identity matrix.- Returns:
 - Identity 
Matrix 
 - 
rotateX
Creates a matrix that rotates a vector by the given angle at the X axis.- Parameters:
 angle- angle, in radians- Returns:
 - Rotation 
Matrix 
 - 
rotateY
Creates a matrix that rotates a vector by the given angle at the Y axis.- Parameters:
 angle- angle, in radians- Returns:
 - Rotation 
Matrix 
 - 
rotateZ
Creates a matrix that rotates a vector by the given angle at the Z axis.- Parameters:
 angle- angle, in radians- Returns:
 - Rotation 
Matrix 
 - 
transpose
Transposes this matrix.- Returns:
 Matrixthat is a transposition of this matrix.
 - 
negate
Negates this matrix.- Returns:
 Matrixthat is a negation of this matrix.
 - 
add
Adds a matrix to this matrix. - 
subtract
Subtracts a matrix from this matrix. - 
multiply
Multiplies two matrices. - 
multiply
Performs a scalar multiplication.- Parameters:
 scalar- Scalar to multiply with- Returns:
 Matrixthat is the scalar product
 - 
multiply
Applies this matrix to aVector. - 
get
Gets a value from the matrix.- Parameters:
 r- Row number (0..2)c- Column number (0..2)- Returns:
 - Value at that position
 
 - 
equals
 - 
hashCode
 - 
toString
 
 -