Documentation ¶
Index ¶
- type Matrix
- func (m Matrix) Add(m1 Matrix) Matrix
- func (m Matrix) Clone() Matrix
- func (m Matrix) Col(col int, v vec.Vector) vec.Vector
- func (m Matrix) Det() float32
- func (m Matrix) Diagonal(dst vec.Vector) vec.Vector
- func (m Matrix) DivC(c float32) Matrix
- func (m Matrix) Eye() Matrix
- func (m Matrix) Flat(v vec.Vector) vec.Vector
- func (m Matrix) LU(L, U Matrix)
- func (m Matrix) Matrix() Matrix
- func (m Matrix) Mul(a Matrix, b Matrix) Matrix
- func (m Matrix) MulC(c float32) Matrix
- func (m Matrix) MulDiag(a Matrix, b vec.Vector) Matrix
- func (m Matrix) MulVec(v vec.Vector, dst vec.Vector) vec.Vector
- func (m Matrix) MulVecT(v vec.Vector, dst vec.Vector) vec.Vector
- func (m Matrix) Orientation(q vec.Quaternion) Matrix
- func (m Matrix) Quaternion() (q *vec.Quaternion)
- func (m Matrix) Rotation2D(a float32) Matrix
- func (m Matrix) RotationX(a float32) Matrix
- func (m Matrix) RotationY(a float32) Matrix
- func (m Matrix) RotationZ(a float32) Matrix
- func (m Matrix) Row(row int) vec.Vector
- func (m Matrix) SetCol(col int, v vec.Vector) Matrix
- func (m Matrix) SetDiagonal(v vec.Vector) Matrix
- func (m Matrix) SetRow(row int, v vec.Vector) Matrix
- func (m Matrix) SetSubmatrix(row, col int, m1 Matrix) Matrix
- func (m Matrix) SetSubmatrixRaw(row, col, rows1, cols1 int, m1 ...float32) Matrix
- func (m Matrix) Sub(m1 Matrix) Matrix
- func (m Matrix) Submatrix(row, col int, m1 Matrix) Matrix
- func (m Matrix) Transpose(m1 Matrix) Matrix
- type Matrix2x2
- func (m *Matrix2x2) Add(m1 Matrix2x2) *Matrix2x2
- func (m *Matrix2x2) Clone() *Matrix2x2
- func (m *Matrix2x2) Col(col int, v vec.Vector) vec.Vector
- func (m *Matrix2x2) Det() float32
- func (m *Matrix2x2) Diagonal(dst vec.Vector) vec.Vector
- func (m *Matrix2x2) DivC(c float32) *Matrix2x2
- func (m *Matrix2x2) Eye() *Matrix2x2
- func (m *Matrix2x2) Flat(v vec.Vector) vec.Vector
- func (m *Matrix2x2) LU(L, U *Matrix2x2)
- func (m *Matrix2x2) Matrix() Matrix
- func (m *Matrix2x2) Mul(a Matrix2x2, b Matrix2x2) *Matrix2x2
- func (m *Matrix2x2) MulC(c float32) *Matrix2x2
- func (m *Matrix2x2) MulDiag(a Matrix2x2, b vec.Vector2D) *Matrix2x2
- func (m *Matrix2x2) MulVec(v vec.Vector2D, dst vec.Vector) vec.Vector
- func (m *Matrix2x2) MulVecT(v vec.Vector2D, dst vec.Vector) vec.Vector
- func (m *Matrix2x2) Rotation2D(a float32) *Matrix2x2
- func (m *Matrix2x2) Row(row int) vec.Vector
- func (m *Matrix2x2) SetCol(col int, v vec.Vector) *Matrix2x2
- func (m *Matrix2x2) SetDiagonal(v vec.Vector2D) *Matrix2x2
- func (m *Matrix2x2) SetRow(row int, v vec.Vector) *Matrix2x2
- func (m *Matrix2x2) SetSubmatrix(row, col int, m1 Matrix) *Matrix2x2
- func (m *Matrix2x2) SetSubmatrixRaw(row, col, rows1, cols1 int, m1 ...float32) *Matrix2x2
- func (m *Matrix2x2) Sub(m1 Matrix2x2) *Matrix2x2
- func (m *Matrix2x2) Submatrix(row, col int, m1 Matrix) Matrix
- func (m *Matrix2x2) Transpose(m1 Matrix2x2) *Matrix2x2
- type Matrix3x3
- func (m *Matrix3x3) Add(m1 Matrix3x3) *Matrix3x3
- func (m *Matrix3x3) Clone() *Matrix3x3
- func (m *Matrix3x3) Col(col int, v vec.Vector) vec.Vector
- func (m *Matrix3x3) Det() float32
- func (m *Matrix3x3) Diagonal(dst vec.Vector) vec.Vector
- func (m *Matrix3x3) DivC(c float32) *Matrix3x3
- func (m *Matrix3x3) Eye() *Matrix3x3
- func (m *Matrix3x3) Flat(v vec.Vector) vec.Vector
- func (m *Matrix3x3) LU(L, U *Matrix3x3)
- func (m *Matrix3x3) Matrix() Matrix
- func (m *Matrix3x3) Mul(a Matrix3x3, b Matrix3x3) *Matrix3x3
- func (m *Matrix3x3) MulC(c float32) *Matrix3x3
- func (m *Matrix3x3) MulDiag(a Matrix3x3, b vec.Vector3D) *Matrix3x3
- func (m *Matrix3x3) MulVec(v vec.Vector3D, dst vec.Vector) vec.Vector
- func (m *Matrix3x3) MulVecT(v vec.Vector3D, dst vec.Vector) vec.Vector
- func (m *Matrix3x3) Orientation(q vec.Quaternion) *Matrix3x3
- func (m *Matrix3x3) Quaternion() (q *vec.Quaternion)
- func (m *Matrix3x3) RotationX(a float32) *Matrix3x3
- func (m *Matrix3x3) RotationY(a float32) *Matrix3x3
- func (m *Matrix3x3) RotationZ(a float32) *Matrix3x3
- func (m *Matrix3x3) Row(row int) vec.Vector
- func (m *Matrix3x3) SetCol(col int, v vec.Vector) *Matrix3x3
- func (m *Matrix3x3) SetDiagonal(v vec.Vector3D) *Matrix3x3
- func (m *Matrix3x3) SetRow(row int, v vec.Vector) *Matrix3x3
- func (m *Matrix3x3) SetSubmatrix(row, col int, m1 Matrix) *Matrix3x3
- func (m *Matrix3x3) SetSubmatrixRaw(row, col, rows1, cols1 int, m1 ...float32) *Matrix3x3
- func (m *Matrix3x3) Sub(m1 Matrix3x3) *Matrix3x3
- func (m *Matrix3x3) Submatrix(row, col int, m1 Matrix) Matrix
- func (m *Matrix3x3) Transpose(m1 Matrix3x3) *Matrix3x3
- type Matrix3x4
- func (m *Matrix3x4) Add(m1 Matrix3x4) *Matrix3x4
- func (m *Matrix3x4) Clone() *Matrix3x4
- func (m *Matrix3x4) Col(col int, v vec.Vector) vec.Vector
- func (m *Matrix3x4) DivC(c float32) *Matrix3x4
- func (m *Matrix3x4) Flat(v vec.Vector) vec.Vector
- func (m *Matrix3x4) Matrix() Matrix
- func (m *Matrix3x4) Mul(a Matrix, b Matrix4x3) *Matrix3x4
- func (m *Matrix3x4) MulC(c float32) *Matrix3x4
- func (m *Matrix3x4) MulVec(v vec.Vector4D, dst vec.Vector) vec.Vector
- func (m *Matrix3x4) MulVecT(v vec.Vector3D, dst vec.Vector) vec.Vector
- func (m *Matrix3x4) Orientation(q vec.Quaternion) *Matrix3x4
- func (m *Matrix3x4) Quaternion() (q *vec.Quaternion)
- func (m *Matrix3x4) RotationX(a float32) *Matrix3x4
- func (m *Matrix3x4) RotationY(a float32) *Matrix3x4
- func (m *Matrix3x4) RotationZ(a float32) *Matrix3x4
- func (m *Matrix3x4) Row(row int) vec.Vector
- func (m *Matrix3x4) SetCol(col int, v vec.Vector) *Matrix3x4
- func (m *Matrix3x4) SetRow(row int, v vec.Vector) *Matrix3x4
- func (m *Matrix3x4) SetSubmatrix(row, col int, m1 Matrix) *Matrix3x4
- func (m *Matrix3x4) SetSubmatrixRaw(row, col, rows1, cols1 int, m1 ...float32) *Matrix3x4
- func (m *Matrix3x4) Sub(m1 Matrix3x4) *Matrix3x4
- func (m *Matrix3x4) Submatrix(row, col int, m1 Matrix) Matrix
- func (m *Matrix3x4) Transpose(m1 Matrix4x3) *Matrix3x4
- type Matrix4x3
- func (m *Matrix4x3) Add(m1 Matrix4x3) *Matrix4x3
- func (m *Matrix4x3) Clone() *Matrix4x3
- func (m *Matrix4x3) Col(col int, v vec.Vector) vec.Vector
- func (m *Matrix4x3) DivC(c float32) *Matrix4x3
- func (m *Matrix4x3) Flat(v vec.Vector) vec.Vector
- func (m *Matrix4x3) Matrix() Matrix
- func (m *Matrix4x3) Mul(a Matrix, b Matrix3x4) *Matrix4x3
- func (m *Matrix4x3) MulC(c float32) *Matrix4x3
- func (m *Matrix4x3) MulVec(v vec.Vector3D, dst vec.Vector) vec.Vector
- func (m *Matrix4x3) MulVecT(v vec.Vector4D, dst vec.Vector) vec.Vector
- func (m *Matrix4x3) Orientation(q vec.Quaternion) *Matrix4x3
- func (m *Matrix4x3) Quaternion() (q *vec.Quaternion)
- func (m *Matrix4x3) RotationX(a float32) *Matrix4x3
- func (m *Matrix4x3) RotationY(a float32) *Matrix4x3
- func (m *Matrix4x3) RotationZ(a float32) *Matrix4x3
- func (m *Matrix4x3) Row(row int) vec.Vector
- func (m *Matrix4x3) SetCol(col int, v vec.Vector) *Matrix4x3
- func (m *Matrix4x3) SetRow(row int, v vec.Vector) *Matrix4x3
- func (m *Matrix4x3) SetSubmatrix(row, col int, m1 Matrix) *Matrix4x3
- func (m *Matrix4x3) SetSubmatrixRaw(row, col, rows1, cols1 int, m1 ...float32) *Matrix4x3
- func (m *Matrix4x3) Sub(m1 Matrix4x3) *Matrix4x3
- func (m *Matrix4x3) Submatrix(row, col int, m1 Matrix) Matrix
- func (m *Matrix4x3) Transpose(m1 Matrix3x4) *Matrix4x3
- type Matrix4x4
- func (m *Matrix4x4) Add(m1 Matrix4x4) *Matrix4x4
- func (m *Matrix4x4) Clone() *Matrix4x4
- func (m *Matrix4x4) Col(col int, v vec.Vector) vec.Vector
- func (m *Matrix4x4) Det() float32
- func (m *Matrix4x4) Diagonal(dst vec.Vector) vec.Vector
- func (m *Matrix4x4) DivC(c float32) *Matrix4x4
- func (m *Matrix4x4) Eye() *Matrix4x4
- func (m *Matrix4x4) Flat(v vec.Vector) vec.Vector
- func (m *Matrix4x4) LU(L, U *Matrix4x4)
- func (m *Matrix4x4) Matrix() Matrix
- func (m *Matrix4x4) Mul(a Matrix4x4, b Matrix4x4) *Matrix4x4
- func (m *Matrix4x4) MulC(c float32) *Matrix4x4
- func (m *Matrix4x4) MulDiag(a Matrix4x4, b vec.Vector4D) *Matrix4x4
- func (m *Matrix4x4) MulVec(v vec.Vector4D, dst vec.Vector) vec.Vector
- func (m *Matrix4x4) MulVecT(v vec.Vector4D, dst vec.Vector) vec.Vector
- func (m *Matrix4x4) Orientation(q vec.Quaternion) *Matrix4x4
- func (m *Matrix4x4) Quaternion() (q *vec.Quaternion)
- func (m *Matrix4x4) RotationX(a float32) *Matrix4x4
- func (m *Matrix4x4) RotationY(a float32) *Matrix4x4
- func (m *Matrix4x4) RotationZ(a float32) *Matrix4x4
- func (m *Matrix4x4) Row(row int) vec.Vector
- func (m *Matrix4x4) SetCol(col int, v vec.Vector) *Matrix4x4
- func (m *Matrix4x4) SetDiagonal(v vec.Vector4D) *Matrix4x4
- func (m *Matrix4x4) SetRow(row int, v vec.Vector) *Matrix4x4
- func (m *Matrix4x4) SetSubmatrix(row, col int, m1 Matrix) *Matrix4x4
- func (m *Matrix4x4) SetSubmatrixRaw(row, col, rows1, cols1 int, m1 ...float32) *Matrix4x4
- func (m *Matrix4x4) Sub(m1 Matrix4x4) *Matrix4x4
- func (m *Matrix4x4) Submatrix(row, col int, m1 Matrix) Matrix
- func (m *Matrix4x4) Transpose(m1 Matrix4x4) *Matrix4x4
- type MatrixSparse
- type MatrixSparseTriplet
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Matrix ¶
type Matrix [][]float32
func (Matrix) Det ¶
Determinant only valid for square matrix Undefined behavior for non square matrices
func (Matrix) LU ¶
LU decomposition into two triangular matrices NOTE: Assume, that l&u matrices are set to zero Matrix must be square and M, L and U matrix sizes must be equal
func (Matrix) Matrix ¶
Returns a Matrix view of this matrix. The view actually contains slices of original matrix rows. This way original matrix can be modified.
func (Matrix) Mul ¶
Destination matrix must be properly sized. given that a is MxN and b is NxK then destinatiom matrix must be MxK
func (Matrix) MulDiag ¶
Only makes sense for square matrices. Vector size must be equal to number of rows/cols
func (Matrix) MulVec ¶
Vector must have a size equal to number of cols. Destination vector must have a size equal to number of rows.
func (Matrix) MulVecT ¶
Vector must have a size equal to number of rows. Destination vector must have a size equal to number of cols.
func (Matrix) Orientation ¶
func (m Matrix) Orientation(q vec.Quaternion) Matrix
Build orientation matrix from quaternion Matrix size must be at least 3x3 Quaternion axis must be unit vector
func (Matrix) Quaternion ¶
func (m Matrix) Quaternion() (q *vec.Quaternion)
/ https://math.stackexchange.com/questions/893984/conversion-of-rotation-matrix-to-quaternion / Must be at least 3x3 matrix
func (Matrix) Rotation2D ¶
Fills destination matrix with a 2D rotation Matrix size must be at least 2x2
func (Matrix) RotationX ¶
Fills destination matrix with a rotation around X axis Matrix size must be at least 3x3
func (Matrix) RotationY ¶
Fills destination matrix with a rotation around Y axis Matrix size must be at least 3x3
func (Matrix) RotationZ ¶
Fills destination matrix with a rotation around Z axis Matrix size must be at least 3x3
func (Matrix) SetDiagonal ¶
Size of the vector must equal to number of rows
func (Matrix) SetSubmatrixRaw ¶
type Matrix2x2 ¶
type Matrix2x2 [2][2]float32
func (*Matrix2x2) Det ¶
Determinant only valid for square matrix Undefined behavior for non square matrices
func (*Matrix2x2) LU ¶
LU decomposition into two triangular matrices NOTE: Assume, that l&u matrices are set to zero Matrix must be square and M, L and U matrix sizes must be equal
func (*Matrix2x2) Matrix ¶
Returns a Matrix view of this matrix. The view actually contains slices of original matrix rows. This way original matrix can be modified.
func (*Matrix2x2) Mul ¶
Destination matrix must be properly sized. given that a is MxN and b is NxK then destinatiom matrix must be MxK
func (*Matrix2x2) MulDiag ¶
Only makes sense for square matrices. Vector size must be equal to number of rows/cols
func (*Matrix2x2) MulVec ¶
Vector must have a size equal to number of cols. Destination vector must have a size equal to number of rows.
func (*Matrix2x2) MulVecT ¶
Vector must have a size equal to number of rows. Destination vector must have a size equal to number of cols.
func (*Matrix2x2) Rotation2D ¶
Fills destination matrix with a 2D rotation Matrix size must be at least 2x2
func (*Matrix2x2) SetDiagonal ¶
Size of the vector must equal to number of rows
func (*Matrix2x2) SetSubmatrix ¶
func (*Matrix2x2) SetSubmatrixRaw ¶
type Matrix3x3 ¶
type Matrix3x3 [3][3]float32
func (*Matrix3x3) Det ¶
Determinant only valid for square matrix Undefined behavior for non square matrices
func (*Matrix3x3) LU ¶
LU decomposition into two triangular matrices NOTE: Assume, that l&u matrices are set to zero Matrix must be square and M, L and U matrix sizes must be equal
func (*Matrix3x3) Matrix ¶
Returns a Matrix view of this matrix. The view actually contains slices of original matrix rows. This way original matrix can be modified.
func (*Matrix3x3) Mul ¶
Destination matrix must be properly sized. given that a is MxN and b is NxK then destinatiom matrix must be MxK
func (*Matrix3x3) MulDiag ¶
Only makes sense for square matrices. Vector size must be equal to number of rows/cols
func (*Matrix3x3) MulVec ¶
Vector must have a size equal to number of cols. Destination vector must have a size equal to number of rows.
func (*Matrix3x3) MulVecT ¶
Vector must have a size equal to number of rows. Destination vector must have a size equal to number of cols.
func (*Matrix3x3) Orientation ¶
func (m *Matrix3x3) Orientation(q vec.Quaternion) *Matrix3x3
Build orientation matrix from quaternion Matrix size must be at least 3x3 Quaternion axis must be unit vector
func (*Matrix3x3) Quaternion ¶
func (m *Matrix3x3) Quaternion() (q *vec.Quaternion)
/ https://math.stackexchange.com/questions/893984/conversion-of-rotation-matrix-to-quaternion / Must be at least 3x3 matrix
func (*Matrix3x3) RotationX ¶
Fills destination matrix with a rotation around X axis Matrix size must be at least 3x3
func (*Matrix3x3) RotationY ¶
Fills destination matrix with a rotation around Y axis Matrix size must be at least 3x3
func (*Matrix3x3) RotationZ ¶
Fills destination matrix with a rotation around Z axis Matrix size must be at least 3x3
func (*Matrix3x3) SetDiagonal ¶
Size of the vector must equal to number of rows
func (*Matrix3x3) SetSubmatrix ¶
func (*Matrix3x3) SetSubmatrixRaw ¶
type Matrix3x4 ¶
type Matrix3x4 [3][4]float32
func (*Matrix3x4) Matrix ¶
Returns a Matrix view of this matrix. The view actually contains slices of original matrix rows. This way original matrix can be modified.
func (*Matrix3x4) Mul ¶
Destination matrix must be properly sized. given that a is MxN and b is NxK then destinatiom matrix must be MxK
func (*Matrix3x4) MulVec ¶
Vector must have a size equal to number of cols. Destination vector must have a size equal to number of rows.
func (*Matrix3x4) MulVecT ¶
Vector must have a size equal to number of rows. Destination vector must have a size equal to number of cols.
func (*Matrix3x4) Orientation ¶
func (m *Matrix3x4) Orientation(q vec.Quaternion) *Matrix3x4
Build orientation matrix from quaternion Matrix size must be at least 3x3 Quaternion axis must be unit vector
func (*Matrix3x4) Quaternion ¶
func (m *Matrix3x4) Quaternion() (q *vec.Quaternion)
/ https://math.stackexchange.com/questions/893984/conversion-of-rotation-matrix-to-quaternion / Must be at least 3x3 matrix
func (*Matrix3x4) RotationX ¶
Fills destination matrix with a rotation around X axis Matrix size must be at least 3x3
func (*Matrix3x4) RotationY ¶
Fills destination matrix with a rotation around Y axis Matrix size must be at least 3x3
func (*Matrix3x4) RotationZ ¶
Fills destination matrix with a rotation around Z axis Matrix size must be at least 3x3
func (*Matrix3x4) SetSubmatrix ¶
func (*Matrix3x4) SetSubmatrixRaw ¶
type Matrix4x3 ¶
type Matrix4x3 [4][3]float32
func (*Matrix4x3) Matrix ¶
Returns a Matrix view of this matrix. The view actually contains slices of original matrix rows. This way original matrix can be modified.
func (*Matrix4x3) Mul ¶
Destination matrix must be properly sized. given that a is MxN and b is NxK then destinatiom matrix must be MxK
func (*Matrix4x3) MulVec ¶
Vector must have a size equal to number of cols. Destination vector must have a size equal to number of rows.
func (*Matrix4x3) MulVecT ¶
Vector must have a size equal to number of rows. Destination vector must have a size equal to number of cols.
func (*Matrix4x3) Orientation ¶
func (m *Matrix4x3) Orientation(q vec.Quaternion) *Matrix4x3
Build orientation matrix from quaternion Matrix size must be at least 3x3 Quaternion axis must be unit vector
func (*Matrix4x3) Quaternion ¶
func (m *Matrix4x3) Quaternion() (q *vec.Quaternion)
/ https://math.stackexchange.com/questions/893984/conversion-of-rotation-matrix-to-quaternion / Must be at least 3x3 matrix
func (*Matrix4x3) RotationX ¶
Fills destination matrix with a rotation around X axis Matrix size must be at least 3x3
func (*Matrix4x3) RotationY ¶
Fills destination matrix with a rotation around Y axis Matrix size must be at least 3x3
func (*Matrix4x3) RotationZ ¶
Fills destination matrix with a rotation around Z axis Matrix size must be at least 3x3
func (*Matrix4x3) SetSubmatrix ¶
func (*Matrix4x3) SetSubmatrixRaw ¶
type Matrix4x4 ¶
type Matrix4x4 [4][4]float32
func (*Matrix4x4) Det ¶
Determinant only valid for square matrix Undefined behavior for non square matrices
func (*Matrix4x4) LU ¶
LU decomposition into two triangular matrices NOTE: Assume, that l&u matrices are set to zero Matrix must be square and M, L and U matrix sizes must be equal
func (*Matrix4x4) Matrix ¶
Returns a Matrix view of this matrix. The view actually contains slices of original matrix rows. This way original matrix can be modified.
func (*Matrix4x4) Mul ¶
Destination matrix must be properly sized. given that a is MxN and b is NxK then destinatiom matrix must be MxK
func (*Matrix4x4) MulDiag ¶
Only makes sense for square matrices. Vector size must be equal to number of rows/cols
func (*Matrix4x4) MulVec ¶
Vector must have a size equal to number of cols. Destination vector must have a size equal to number of rows.
func (*Matrix4x4) MulVecT ¶
Vector must have a size equal to number of rows. Destination vector must have a size equal to number of cols.
func (*Matrix4x4) Orientation ¶
func (m *Matrix4x4) Orientation(q vec.Quaternion) *Matrix4x4
Build orientation matrix from quaternion Matrix size must be at least 3x3 Quaternion axis must be unit vector
func (*Matrix4x4) Quaternion ¶
func (m *Matrix4x4) Quaternion() (q *vec.Quaternion)
/ https://math.stackexchange.com/questions/893984/conversion-of-rotation-matrix-to-quaternion / Must be at least 3x3 matrix
func (*Matrix4x4) RotationX ¶
Fills destination matrix with a rotation around X axis Matrix size must be at least 3x3
func (*Matrix4x4) RotationY ¶
Fills destination matrix with a rotation around Y axis Matrix size must be at least 3x3
func (*Matrix4x4) RotationZ ¶
Fills destination matrix with a rotation around Z axis Matrix size must be at least 3x3
func (*Matrix4x4) SetDiagonal ¶
Size of the vector must equal to number of rows
func (*Matrix4x4) SetSubmatrix ¶
func (*Matrix4x4) SetSubmatrixRaw ¶
type MatrixSparse ¶
type MatrixSparse struct {
Rows, Cols int
Data []MatrixSparseTriplet
}