- The Structure
- Members
- Arithmetic
- BrMatrix23Mul()
- BrMatrix23Inverse()
- BrMatrix23LPInverse()
- BrMatrix23ApplyP()
- BrMatrix23ApplyV()
- BrMatrix23TApplyP()
- BrMatrix23TApplyV()
- BrMatrix23Pre()
- BrMatrix23PreTranslate()
- BrMatrix23PreScale()
- BrMatrix23PreShearX()
- BrMatrix23PreShearY()
- BrMatrix23PreRotate()
- BrMatrix23Post()
- BrMatrix23PostTranslate()
- BrMatrix23PostScale()
- BrMatrix23PostShearX()
- BrMatrix23PostShearY()
- BrMatrix23PostRotate()
- Copy/Assign
- BrMatrix23Copy()
- Access & Maintenance
- BrMatrix23LPNormalise()
- Referencing & Lifetime
- Initialisation
- BrMatrix23Identity()
- BrMatrix23Translate()
- BrMatrix23Scale()
- BrMatrix23ShearX()
- BrMatrix23ShearY()
- BrMatrix23Rotate()

** br_matrix23**

Note that this is effectively used as a 33 matrix, but omitting the redundant, third column for storage purposes. Thus:

It is applied to homogenous 2D co-ordinates, which similarly omit the third element for sake of economy.

It can be noted that the bottom row has a translational effect. Also note, that the matrix determinant represents the area change effected.

`typedef`

`matrix.h `

for precise declaration and ordering)
**br_scalar m[3][2] Three rows of two columns**

`br_material`

.`br_scalar m[3][2]`

This matrix can also be thought of as an array of three `br_vector2`

*349*` structures, e.g. `

`br_vector2 m[3]`

. Thus `m[row]`

can be cast as `(br_vector2*)`

.

**BrMatrix23Mul()**

Declaration:

**void BrMatrix23Mul(br_matrix34* A, const br_matrix34* B, const br_matrix34* C)**

Arguments:

**br_matrix23 * A**

A pointer to the destination matrix (must be different from both sources).

**const br_matrix23 * B**

Pointer to the left hand source matrix.

**const br_matrix23 * C**

Pointer to the right hand source matrix.

Remarks: The result in

`A `

is equivalent to the following:

See Also:

`BrMatrix23Pre()`

, `BrMatrix23Post()`

**BrMatrix23Inverse()**

Declaration:

**br_scalar BrMatrix23Inverse(br_matrix23* A, const br_matrix23* B)**

Arguments:

**br_matrix23 * A**

A pointer to the destination matrix (must be different from source).

**const br_matrix23 * B**

A pointer to the source matrix.

Result:

**br_scalar**

If the inverse exists, the determinant of the source matrix is returned. If there is no inverse, scalar zero is returned.

Remarks: The result in

`A `

is equivalent to the following:

See Also:

`BrMatrix23LPInverse()`

.

**BrMatrix23LPInverse()**

Equivalent to the expression:

Declaration:

**void BrMatrix23LPInverse(br_matrix23* A, const br_matrix23* B)**

Arguments:

**br_matrix23 * A**

A pointer to the destination matrix (must be different from source).

**const br_matrix23 * B**

A pointer to the source matrix.

Remarks: The result in

`A `

is equivalent to the following:

See Also:

`BrMatrix23Inverse()`

.

**BrMatrix23ApplyP()**

Declaration:

**void BrMatrix23ApplyP(br_vector2* A, const br_vector2* B, const br_matrix23* C)**

Arguments:

**br_vector2 * A**

A pointer to the destination vector (must be different from source, and not part of transform), to hold the transformed point.

**const br_vector2 * B**

A pointer to the source vector, holding the point to be transformed.

**const br_matrix23 * C**

A pointer to the transform matrix to be applied.

Remarks: The result in

`A `

is equivalent to the following:

**BrMatrix23ApplyV()**

Declaration:

**void BrMatrix23ApplyV(br_vector2* A, const br_vector2* B, const br_matrix23* C)**

Arguments:

**br_vector2 * A**

A pointer to the destination vector (must be different from source, and not part of transform), to hold the transformed vector.

**const br_vector2 * B**

A pointer to the source vector, holding the vector to be transformed.

**const br_matrix23 * C**

A pointer to the transform matrix to be applied.

Remarks: The result in

`A `

is equivalent to the following:

**BrMatrix23TApplyP()**

Declaration:

**void BrMatrix23TApplyP(br_vector2* A, const br_vector2* B, const br_matrix23* C)**

Arguments:

**br_vector2 * A**

A pointer to the destination vector (must be different from source, and not part of transform), to hold the transformed point.

**const br_vector2 * B**

A pointer to the source vector, holding the point to be transformed.

**const br_matrix23 * C**

A pointer to the transform matrix to be applied transposed - the translation elements are presumed zero or irrelevant.

Remarks: The result in

`A `

is equivalent to the following:

**BrMatrix23TApplyV()**

Declaration:

**void BrMatrix23TApplyV(br_vector2* A, const br_vector2* B, const br_matrix23* C)**

Arguments:

**br_vector2 * A**

A pointer to the destination vector (must be different from source, and not part of transform), to hold the transformed vector.

**const br_vector2 * B**

A pointer to the source vector, holding the vector to be transformed.

**const br_matrix23 * C**

A pointer to the transform matrix to be applied transposed - the translation elements are presumed zero or irrelevant.

Remarks: The result in

`A `

is equivalent to the following:

**BrMatrix23Pre()**

Declaration:

**void BrMatrix23Pre(br_matrix23* A, const br_matrix23* B)**

Arguments:

**br_matrix23 * A**

A pointer to the subject matrix (may be same as `B`

).

**const br_matrix23 * B**

A pointer to the pre-multiplying matrix.

Remarks: The result in

`A `

is equivalent to the following:

See Also:

`BrMatrix23Post()`

, `BrMatrix23Mul()`

**BrMatrix23PreTranslate()**

Declaration:

**void BrMatrix23PreTranslate(br_matrix23* mat, br_scalar dx, br_scalar dy)**

Arguments:

**br_matrix23 * mat**

A pointer to the subject matrix.

**br_scalar dx**

The x axis component used to form the translation matrix.

**br_scalar dy**

The y axis component used to form the translation matrix.

Remarks: The result in

`mat `

is equivalent to the following:

See Also:

`BrMatrix23PostTranslate()`

, `BrMatrix23Translate()`

**BrMatrix23PreScale()**

Declaration:

**void BrMatrix23PreScale(br_matrix23* mat, br_scalar sx, br_scalar sy)**

Arguments:

**br_matrix23 * mat**

A pointer to the subject matrix.

**br_scalar sx**

Scaling component along the x axis.

**br_scalar sy**

Scaling component along the y axis.

Remarks: The result in

`mat `

is equivalent to the following:

See Also:

`BrMatrix23PostScale()`

, `BrMatrix23Scale()`

**BrMatrix23PreShearX()**

Declaration:

**void BrMatrix23PreShearX(br_matrix23* mat, br_scalar sy)**

Arguments:

**br_matrix23 * mat**

A pointer to the subject matrix.

**br_scalar sy**

Shear factor by which the x co-ordinate is included in the transformed y co-ordinate.

Remarks: The result in

`mat `

is equivalent to the following:

See Also:

`BrMatrix23PostShearX()`

, `BrMatrix23ShearX()`

**BrMatrix23PreShearY()**

Declaration:

**void BrMatrix23PreShearY(br_matrix23* mat, br_scalar sx)**

Arguments:

**br_matrix23 * mat**

A pointer to the subject matrix.

**br_scalar sx**

Shear factor by which the y co-ordinate is included in the transformed x co-ordinate.

Remarks: The result in

`mat `

is equivalent to the following:

See Also:

`BrMatrix23PostShearY()`

, `BrMatrix23ShearY()`

**BrMatrix23PreRotate()**

Declaration:

**void BrMatrix23PreRotate(br_matrix23* mat, br_angle rz)**

Arguments:

**br_matrix23 * mat**

A pointer to the subject matrix.

**br_angle rz**

The clockwise angle about the z axis used to form the rotation matrix.

Remarks: The result in

`mat `

is equivalent to the following:

See Also:

`BrMatrix23PostRotate()`

, `BrMatrix23Rotate()`

**BrMatrix23Post()**

Declaration:

**void BrMatrix23Post(br_matrix23* A, const br_matrix23* B)**

Arguments:

**br_matrix23 * A**

A pointer to the subject matrix (may be same as `B`

).

**const br_matrix23 * B**

A pointer to the post-multiplying matrix.

Remarks: The result in

`A `

is equivalent to the following:

See Also:

`BrMatrix23Pre()`

, `BrMatrix23Mul()`

.

**BrMatrix23PostTranslate()**

Declaration:

**void BrMatrix23PostTranslate(br_matrix23* mat, br_scalar dx, br_scalar dy)**

Arguments:

**br_matrix23 * mat**

A pointer to the subject matrix.

**br_scalar dx**

The x axis component used to form the translation matrix.

**br_scalar dy**

The y axis component used to form the translation matrix.

Remarks: The result in

`mat `

is equivalent to the following:

See Also:

`BrMatrix23PreTranslate()`

, `BrMatrix23Translate()`

.

**BrMatrix23PostScale()**

Declaration:

**void BrMatrix23PostScale(br_matrix23* mat, br_scalar sx, br_scalar sy)**

Arguments:

**br_matrix23 * mat**

A pointer to the subject matrix.

**br_scalar sx**

Scaling component along the x axis.

**br_scalar sy**

Scaling component along the y axis.

Remarks: The result in

`mat `

is equivalent to the following:

See Also:

`BrMatrix23PreScale()`

, `BrMatrix23Scale()`

.

**BrMatrix23PostShearX()**

Declaration:

**void BrMatrix23PostShearX(br_matrix23* mat, br_scalar sy)**

Arguments:

**br_matrix23 * mat**

A pointer to the subject matrix.

**br_scalar sy**

Shear factor by which the x co-ordinate is included in the transformed y coordinate.

Remarks: The result in

`mat `

is equivalent to the following:

See Also:

`BrMatrix23PreShearX()`

, `BrMatrix23ShearX()`

.

**BrMatrix23PostShearY()**

Declaration:

**void BrMatrix23PostShearY(br_matrix23* mat, br_scalar sx)**

Arguments:

**br_matrix23 * mat**

A pointer to the subject matrix.

**br_scalar sx**

Shear factor by which the y co-ordinate is included in the transformed x coordinate.

Remarks: The result in

`mat `

is equivalent to the following:

See Also:

`BrMatrix23PreShearY()`

, `BrMatrix23ShearY()`

.

**BrMatrix23PostRotate()**

Declaration:

**void BrMatrix23PostRotate(br_matrix23* mat, br_angle rz)**

Arguments:

**br_matrix23 * mat**

A pointer to the subject matrix.

**br_angle rz**

The clockwise angle about the z axis used to form the rotation matrix.

Remarks: The result in

`mat `

is equivalent to the following:

See Also:

`BrMatrix23PreRotate()`

, `BrMatrix23Rotate()`

.

`BrMatrix23Copy()`

to ensure compatibility.

**BrMatrix23Copy()**

Declaration:

**void BrMatrix23Copy(br_matrix23* A, const br_matrix23* B)**

Arguments:

**br_matrix23 * A**

A pointer to the destination matrix (may be the same as source - though redundant).

**const br_matrix23 * B**

A pointer to the source matrix.

**BrMatrix23LPNormalise()**

Declaration:

**void BrMatrix23LPNormalise(br_matrix23* A, const br_matrix23* B)**

Arguments:

**br_matrix23 * A**

A pointer to the destination matrix, which must not point to the source matrix.

**const br_matrix23 * B**

A pointer to the source matrix.

Effects: The destination matrix is the source matrix adjusted so that it represents a length preserving transformation.

Remarks: This function is typically applied to a length preserving matrix which has undergone a long sequence of operations, to ensure that the final matrix is still truly length-preserving.

`BR_VECTOR2() `

macros would serve as well.
All other initialisation should use the functions `BrMatrix23Identity()`

*184*`, `

`BrMatrix23Translate()`

*184*`, `

`BrMatrix23Scale()`

*185*`, `

`BrMatrix23Shear`

[`X`

|`Y`

]`()`

*185**|186*, `BrMatrix23Rotate()`

*186*`, or `

`BrMatrix23Copy()`

*182*`.`

**BrMatrix23Identity()**

Declaration:

**void BrMatrix23Identity(br_matrix23* mat)**

Arguments:

**br_matrix23 * mat**

A pointer to the destination matrix.

Effects: Stores the identity matrix at the destination.

**BrMatrix23Translate()**

Declaration:

**void BrMatrix23Translate(br_matrix23* mat, br_scalar dx, br_scalar dy)**

Arguments:

**br_matrix23 * mat**

A pointer to the destination matrix.

**br_scalar dx**

Translation component along the x axis.

**br_scalar dy**

Translation component along the y axis.

See Also:

`BrMatrix23PreTranslate()`

, `BrMatrix23PostTranslate()`

.

**BrMatrix23Scale()**

Declaration:

**void BrMatrix23Scale(br_matrix23* mat, br_scalar sx, br_scalar sy)**

Arguments:

**br_matrix23 * mat**

A pointer to the destination matrix.

**br_scalar sx**

Scaling component along the x axis.

**br_scalar sy**

Scaling component along the y axis.

See Also:

`BrMatrix23PreScale()`

, `BrMatrix23PostScale()`

.

**BrMatrix23ShearX()**

Declaration:

**void BrMatrix23ShearX(br_matrix23* mat, br_scalar sy)**

Arguments:

**br_matrix23 * mat**

A pointer to the destination matrix.

**br_scalar sy**

Shear factor by which the x co-ordinate is included in the transformed y co-ordinate.

See Also:

`BrMatrix23PreShearX()`

, `BrMatrix23PostShearX()`

.

**BrMatrix23ShearY()**

Declaration:

**void BrMatrix23ShearX(br_matrix23* mat, br_scalar sx)**

Arguments:

**br_matrix23 * mat**

A pointer to the destination matrix.

**br_scalar sx**

Shear factor by which the y co-ordinate is included in the transformed x co-ordinate.

See Also:

`BrMatrix23PreShearY()`

, `BrMatrix23PostShearY()`

.

**BrMatrix23Rotate()**

Declaration:

**void BrMatrix23Rotate(br_matrix23* mat, br_angle rz)**

Arguments:

**br_matrix23 * mat**

A pointer to the destination matrix.

**br_angle rz**

Clockwise rotation about the z axis.

See Also:

`BrMatrix23PreRotate()`

, `BrMatrix23PostRotate()`

.

Generated with CERN WebMaker