-
Matrix
-
PowerShell
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
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
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
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.
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
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