Show / Hide Table of Contents

Struct Matrix3

3x3 matrix, typically used to describe a rotation.

Namespace: ABB.Robotics.Math
Assembly: ABB.Robotics.Math.dll
Syntax
public struct Matrix3

Constructors

View Source

Matrix3(Matrix4)

Creates a 3x3 matrix from the upper-left part of a 4x4 matrix.
Corresponds to extracting the rotation part of a transformation matrix.

Declaration
public Matrix3(Matrix4 mat)
Parameters
Type Name Description
Matrix4 mat
View Source

Matrix3(Vector3, Vector3, Vector3)

Creates a matrix from three column vectors.

Declaration
public Matrix3(Vector3 x0, Vector3 y0, Vector3 z0)
Parameters
Type Name Description
Vector3 x0
Vector3 y0
Vector3 z0
View Source

Matrix3(double, double, double, double, double, double, double, double, double)

Creates a matrix from elements row by row.

Declaration
public Matrix3(double e11, double e12, double e13, double e21, double e22, double e23, double e31, double e32, double e33)
Parameters
Type Name Description
double e11
double e12
double e13
double e21
double e22
double e23
double e31
double e32
double e33

Fields

View Source

Identity

Identity matrix.

Declaration
public static readonly Matrix3 Identity
Field Value
Type Description
Matrix3
View Source

x

Column vector.

Declaration
public Vector3 x
Field Value
Type Description
Vector3
View Source

y

Column vector.

Declaration
public Vector3 y
Field Value
Type Description
Vector3
View Source

z

Column vector.

Declaration
public Vector3 z
Field Value
Type Description
Vector3

Properties

View Source

Elements

Returns an array of all elements in column-first order.

Declaration
public double[] Elements { get; }
Property Value
Type Description
double[]
View Source

this[int]

Column vector access.

Declaration
public Vector3 this[int index] { get; set; }
Parameters
Type Name Description
int index
Property Value
Type Description
Vector3

Methods

View Source

AlmostEquals(Matrix3)

Comparison method for matrices with tolerance

Declaration
public bool AlmostEquals(Matrix3 rhs)
Parameters
Type Name Description
Matrix3 rhs

Matrix to compare with

Returns
Type Description
bool

true if equals within tolerance

View Source

Clean()

Zeroes any values smaller than Globals.EPS.

Declaration
public void Clean()
View Source

Determinant()

Returns the determinant.

Declaration
public double Determinant()
Returns
Type Description
double
View Source

Inverse()

Returns the inverse.

Declaration
public Matrix3 Inverse()
Returns
Type Description
Matrix3

Inverted matrix

View Source

Invert()

Inverts the matrix, using Cramer's rule.

Declaration
public void Invert()
View Source

Multiply(Matrix3)

Matrix-Matrix multiplication method.

Declaration
public Matrix3 Multiply(Matrix3 rhs)
Parameters
Type Name Description
Matrix3 rhs
Returns
Type Description
Matrix3
View Source

Multiply(Vector3)

Matrix-Vector3 multiplication method.

Declaration
public Vector3 Multiply(Vector3 rhs)
Parameters
Type Name Description
Vector3 rhs
Returns
Type Description
Vector3
View Source

ToString()

Returns a string in the format
[[x.x x.y x.z] [y.x y.y y.z] [z.x z.y z.z]]

Declaration
public override string ToString()
Returns
Type Description
string
Overrides
ValueType.ToString()
View Source

ToString(IFormatProvider)

Returns a string in the format
[[x.x x.y x.z] [y.x y.y y.z] [z.x z.y z.z]]

Declaration
public string ToString(IFormatProvider formatProvider)
Parameters
Type Name Description
IFormatProvider formatProvider
Returns
Type Description
string
View Source

Transpose()

Transposes the matrix.

Declaration
public void Transpose()

Operators

View Source

operator +(Matrix3, Matrix3)

Adds each element of the two Matrix3 values and returns the resulting Matrix3

Declaration
public static Matrix3 operator +(Matrix3 lhs, Matrix3 rhs)
Parameters
Type Name Description
Matrix3 lhs
Matrix3 rhs
Returns
Type Description
Matrix3
View Source

operator *(Matrix3, Matrix3)

Matrix-Matrix multiplication operator.

Declaration
public static Matrix3 operator *(Matrix3 lhs, Matrix3 rhs)
Parameters
Type Name Description
Matrix3 lhs
Matrix3 rhs
Returns
Type Description
Matrix3
View Source

operator *(Matrix3, Vector3)

Matrix-Vector3 multiplication operator.

Declaration
public static Vector3 operator *(Matrix3 lhs, Vector3 rhs)
Parameters
Type Name Description
Matrix3 lhs
Vector3 rhs
Returns
Type Description
Vector3
View Source

operator *(Matrix3, double)

Multiples each element with the supplied value and returns the resulting Matrix3

Declaration
public static Matrix3 operator *(Matrix3 lhs, double rhs)
Parameters
Type Name Description
Matrix3 lhs
double rhs
Returns
Type Description
Matrix3
  • View Source
In this article
Back to top Copyright © 2025 ABB