Matrix

Palette

MathML Matrix

A Matrix is just Math.

MathML can show math inside of HTML.

To show a matrix as a MathML matrix, we just need to access the .MathML property.

(Scale3d 3 2 1).MathML
[3000020000100001]

Matrix3x2

A 2D Matrix (Matrix3x2) can be mapped to a 3D Matrix (Matrix4x4).

When we show a 2D Matrix's MathML, we show both the matrix and and it's equivalent matrix3d

(Scale 1 2).MathML
[100200]=[1000020000100001]

Quaternion

A Quaternion ([Numerics.Quaternion]) can be mapped to a 3D Matrix ([Numerics.Matrix4x4]).

When we show a Quaternion's MathML, we show both the [Numerics.Quaternion] and and it's equivalent matrix3d

(Quaternion Identity).MathML
[X:0Y:0Z:0W:1]=[1000010000100001]

MathML in HTML

MathML obviously works fine in html.

We can also preview the matrix by accessing another property: .html

(Scale3d 3 2 1).Html

By default, this will show the matrix twice.

Once in it's original form, and once transformed by itself.

[3000020000100001] [3000020000100001]

A Matrix3x2 and a Quaternion can both be converted to a Matrix4x4

We show the equivalent matrix side by side

(Scale 1 0.5).MathML
(Quaternion 0.5 0.5 0.5 1).MathML
[1000.500]=[100000.50000100001] [X:0Y:0Z:0W:1]=[1000010000100001]

We can also attach our own .Content property to the matrix:

Scale -1 1 | 
    Add-Member NoteProperty Content "<h3>Backwards</h3>" -Force -PassThru |
        Select-Object -ExpandProperty Html

Backwards