VisimBox 1.0 VisimBox 3d simulation and visualisation ToolBox

- Main Page
- Packages
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | Properties
VisiMath.Matrix2 Struct Reference

Matrix2x2, used for 2D transformations. More...

List of all members.

## Public Member Functions
| Matrix2 (float val)
| Matrix2 (float n00, float n01, float n10, float n11)
void | Assign (float n00, float n01, float n10, float n11)
| Assigns new values to matrix.
void | SetToIdentity ()
| Sets matrix to identity.
void | Transpose ()
| Transposes Matrix.
void | Invert ()
| Inverts matrix.
void | Add (ref Matrix2 other)
| Adds another matrix to this one.
void | Substract (ref Matrix2 other)
| Substracts another matrix from this one.
void | Multiply (float scale)
| Scalar multiplication.
void | MultiplyBy (ref Matrix2 other)
| Multiplies this matrix by another (this = this*other)
Matrix2 | Multiply (ref Matrix2 other)
| Multiplies this matrix by another and returns this*other)
Vector2 | Multiply (ref Vector2 vec)
| Multiplies vector with matrix.
void | Transform (ref Vector2 vec)
| Transforms vector by matrix.
override int | GetHashCode ()
override string | ToString ()
override bool | Equals (object obj)
bool | Equals (Matrix2 other)
## Static Public Member Functions
static Matrix2 | Invert (ref Matrix2 mat)
| Calculates inverted matrix.
static Matrix2 | CreateScale (float scale)
| Creates 2D scale matrix.
static Matrix2 | CreateScale (ref Vector2 scale)
| Creates 2D scale matrix.
static Matrix2 | CreateScale (float scalex, float scaley)
| Creates 2D scale matrix.
static Matrix2 | CreateRotation (float angle)
| Creates 2d rotation transformation.
static Matrix2 | operator* (Matrix2 left, Matrix2 right)
| Matrix multiplication.
static Matrix2 | operator* (Matrix2 left, float right)
| Scalar multiplication.
static Matrix2 | operator* (float left, Matrix2 right)
| Scalar multiplication.
static Matrix2 | operator- (Matrix2 left, Matrix2 right)
| Substraction of two matrices.
static Matrix2 | operator+ (Matrix2 left, Matrix2 right)
| Addition of two matrices.
static Vector2 | operator* (Matrix2 left, Vector2 right)
| Multiplication of vector by matrix.
static bool | operator== (Matrix2 left, Matrix2 right)
| Compares two instances.
static bool | operator!= (Matrix2 left, Matrix2 right)
| Compares two instances.
## Public Attributes
float | m00
| Matrix fields.
float | m10
float | m01
float | m11
## Static Public Attributes
static Matrix2 | Identitity = new Matrix2(1, 0, 0, 1)
## Properties
float | this[int index]`[get, set]`
float | Determinant`[get]`
| Determinant of the matrix.

## Detailed Description

Matrix2x2, used for 2D transformations.

## Constructor & Destructor Documentation

VisiMath.Matrix2.Matrix2 | ( | float | val | ) |

VisiMath.Matrix2.Matrix2 | ( | float | n00,
|  | float | n01,
|  | float | n10,
|  | float | n11
| ) |  |

## Member Function Documentation

void VisiMath.Matrix2.Add | ( | ref Matrix2 | other | ) |

Adds another matrix to this one.

Parameters:

  other | right operand

void VisiMath.Matrix2.Assign | ( | float | n00,
|  | float | n01,
|  | float | n10,
|  | float | n11
| ) |  |

Assigns new values to matrix.

static Matrix2 VisiMath.Matrix2.CreateRotation | ( | float | angle | ) | `[static]`

Creates 2d rotation transformation.

Parameters:

  angle | angle in radians

Returns:
  New 2d transformation

static Matrix2 VisiMath.Matrix2.CreateScale | ( | float | scale | ) | `[static]`

Creates 2D scale matrix.

static Matrix2 VisiMath.Matrix2.CreateScale | ( | ref Vector2 | scale | ) | `[static]`

Creates 2D scale matrix.

static Matrix2 VisiMath.Matrix2.CreateScale | ( | float | scalex,
|  | float | scaley
| ) |  | `[static]`

Creates 2D scale matrix.

override bool VisiMath.Matrix2.Equals | ( | object | obj | ) |

bool VisiMath.Matrix2.Equals | ( | Matrix2 | other | ) |

override int VisiMath.Matrix2.GetHashCode | ( |  | ) |

void VisiMath.Matrix2.Invert | ( |  | ) |

Inverts matrix.

static Matrix2 VisiMath.Matrix2.Invert | ( | ref Matrix2 | mat | ) | `[static]`

Calculates inverted matrix.

Parameters:

  mat | matrix to be inverted

Returns:
  Inverted matrix

Exceptions:

  System.ArgumentException | Thrown if matrix is singular

Matrix2 VisiMath.Matrix2.Multiply | ( | ref Matrix2 | other | ) |

Multiplies this matrix by another and returns this*other)

Parameters:

  other | right operand

void VisiMath.Matrix2.Multiply | ( | float | scale | ) |

Scalar multiplication.

Parameters:

  scale | Scalar operand

Vector2 VisiMath.Matrix2.Multiply | ( | ref Vector2 | vec | ) |

Multiplies vector with matrix.

Parameters:

  vec | right operand

Returns:
  transformed vector

void VisiMath.Matrix2.MultiplyBy | ( | ref Matrix2 | other | ) |

Multiplies this matrix by another (this = this*other)

Parameters:

  other | right operand

static bool VisiMath.Matrix2.operator!= | ( | Matrix2 | left,
|  | Matrix2 | right
| ) |  | `[static]`

Compares two instances.

Parameters:

  left | first operand.
  right | second operand.

Returns:
  True if left != right, otherwise false.

static Matrix2 VisiMath.Matrix2.operator* | ( | Matrix2 | left,
|  | Matrix2 | right
| ) |  | `[static]`

Matrix multiplication.

Parameters:

  left | left operand
  right | right operand

Returns:
  New Matrix24 with result

static Matrix2 VisiMath.Matrix2.operator* | ( | Matrix2 | left,
|  | float | right
| ) |  | `[static]`

Scalar multiplication.

Parameters:

  left | Matrix
  right | scalar

Returns:
  Matrix*scalar

static Vector2 VisiMath.Matrix2.operator* | ( | Matrix2 | left,
|  | Vector2 | right
| ) |  | `[static]`

Multiplication of vector by matrix.

Parameters:

  left | Matrix
  right | vector

Returns:
  Transformed vector

static Matrix2 VisiMath.Matrix2.operator* | ( | float | left,
|  | Matrix2 | right
| ) |  | `[static]`

Scalar multiplication.

Parameters:

  left | scalar
  right | Matrix

Returns:
  Matrix*scalar

static Matrix2 VisiMath.Matrix2.operator+ | ( | Matrix2 | left,
|  | Matrix2 | right
| ) |  | `[static]`

Addition of two matrices.

Parameters:

  left | left operand
  right | right operand

Returns:
  left + right

static Matrix2 VisiMath.Matrix2.operator- | ( | Matrix2 | left,
|  | Matrix2 | right
| ) |  | `[static]`

Substraction of two matrices.

Parameters:

  left | left operand
  right | right operand

Returns:
  left - right

static bool VisiMath.Matrix2.operator== | ( | Matrix2 | left,
|  | Matrix2 | right
| ) |  | `[static]`

Compares two instances.

Parameters:

  left | first operand.
  right | second operand.

Returns:
  True if left == right, otherwise false.

void VisiMath.Matrix2.SetToIdentity | ( |  | ) |

Sets matrix to identity.

void VisiMath.Matrix2.Substract | ( | ref Matrix2 | other | ) |

Substracts another matrix from this one.

Parameters:

  other | right operand

override string VisiMath.Matrix2.ToString | ( |  | ) |

void VisiMath.Matrix2.Transform | ( | ref Vector2 | vec | ) |

Transforms vector by matrix.

Parameters:

  vec | vector to be transformed

void VisiMath.Matrix2.Transpose | ( |  | ) |

Transposes Matrix.

## Member Data Documentation

Matrix2 VisiMath.Matrix2.Identitity = new Matrix2(1, 0, 0, 1)`[static]`

float VisiMath.Matrix2.m00

Matrix fields.

float VisiMath.Matrix2.m01

float VisiMath.Matrix2.m10

float VisiMath.Matrix2.m11

## Property Documentation

float VisiMath.Matrix2.Determinant`[get]`

Determinant of the matrix.

float VisiMath.Matrix2.this[int index]`[get, set]`

The documentation for this struct was generated from the following file:

- Matrix2.cs

All Classes Namespaces Files Functions Variables Enumerations Properties Events