java.lang.Object
omix.util.math.vector.Matrix2d
public class Matrix2d extends Object
This class is a 2 × 2 matrix with double precision.
- Author:
- Dr. Peter Droste, Omix Visualization
-
Constructor Summary
-
Method Summary
Modifier and Type Method Description Vec2d
diag()
Returns the diagonal of the matrix as vectorMatrix2d
dot(double a)
ScaleMatrix2d
dot(Matrix2d matrix)
Scalar productVec2d
dot(Vec2d vector)
Product with a vector.double
get(int i, int j)
Returns the value of the matrix index (i,j).Matrix2d
plus(Matrix2d matrix)
Additionvoid
set(int i, int j, double value)
Sets the value of the matrix index (i,j).String
toString()
Matrix2d
transponate()
Transponates the matrix.
-
Constructor Details
-
Method Details
-
transponate
Transponates the matrix.- Returns:
- thisT
-
dot
Scalar product- Parameters:
matrix
-- Returns:
- this⋅matrix
-
set
public void set(int i, int j, double value)Sets the value of the matrix index (i,j).- Parameters:
i
-j
-value
-
-
get
public double get(int i, int j)Returns the value of the matrix index (i,j).- Parameters:
i
-j
-- Returns:
- value at i,j
-
plus
Addition- Parameters:
matrix
-- Returns:
- this + matrix
-
dot
Scale- Parameters:
a
-- Returns:
- this⋅a
-
dot
Product with a vector.- Parameters:
vector
-- Returns:
- this⋅vector
-
diag
Returns the diagonal of the matrix as vector- Returns:
- the diagonal of the matrix as vector
-
toString
- Overrides:
toString
in classObject
- See Also:
Object.toString()
-