Matrix.types.ps1xml

<!-- Generated with EZOut 2.0.6: Install-Module EZOut or https://github.com/StartAutomating/EZOut -->
<Types>
  <Type>
    <Name>System.Numerics.Matrix3x2</Name>
    <Members>
      <MemberSet>
        <Name>PSStandardMembers</Name>
        <Members>
          <PropertySet>
            <Name>DefaultDisplayPropertySet</Name>
            <ReferencedProperties>
              <Name>X</Name>
              <Name>Y</Name>
              <Name>Z</Name>
            </ReferencedProperties>
          </PropertySet>
        </Members>
      </MemberSet>
      <ScriptProperty>
        <Name>CSS</Name>
        <GetScriptBlock>
                        return "matrix($(
@(
$this.M11
$this.M12
$this.M21
$this.M22
$this.M31
$this.M32
) -join ', '
))"
                    </GetScriptBlock>
      </ScriptProperty>
      <ScriptProperty>
        <Name>Html</Name>
        <GetScriptBlock>
                        &lt;#
.SYNOPSIS
    Gets Matrix Html
.DESCRIPTION
    Gets an HTML representation of the Matrix.

    If there is an attached Content property, it will be rendered using the matrix.

    Otherwise, the Matrix's MathML representation will be rendered twice:

    * Once untransformed
    * Once transformed using itself
#&gt;
param()

# If we have content
if ($this.Content) {
    # put it in the matrix.
    "&lt;section style='transform:$($this.CSS)'&gt;"
        if ($this.Content.OuterXml) {
            $this.Content.OuterXml
        } elseif ($this.Content.Html) {
            $this.Content.Html
        } else {
            "$($this.Content)"
        }
    "&lt;/section&gt;"
} else {
    # Otherwise,
    $mathML = $this.MathML
    $mathML.OuterXML # show the MathML
    # and show it again, transformed.
    $mathML.math.setAttribute('style', "transform:$($this.CSS)")
    $mathML.OuterXML
}
                    </GetScriptBlock>
      </ScriptProperty>
      <ScriptProperty>
        <Name>MathML</Name>
        <GetScriptBlock>
                        &lt;#
.SYNOPSIS
    Matrix MathML
.DESCRIPTION
    Gets the Matrix as a MathML representation of itself.
.NOTES
    Also shows the equivalent `[Numerics.Matrtix4x4]`
#&gt;
[xml]@"
&lt;math display='block'&gt;
    &lt;mo&gt;[&lt;/mo&gt;
    &lt;mtable&gt;
    $(
        foreach ($row in 1..3) {
            "&lt;mtr&gt;"
            foreach ($col in 1..2) {
                "&lt;mtd&gt;&lt;mn&gt;$($this."M${row}${col}")&lt;/mn&gt;&lt;/mtd&gt;"
            }
            "&lt;/mtr&gt;"
        }
    )
    &lt;/mtable&gt;
    &lt;mo&gt;]&lt;/mo&gt;
    &lt;mo&gt;=&lt;/mo&gt;$(
        [Numerics.Matrix4x4]::Create($this).MathML.math.innerXml
    )
&lt;/math&gt;
"@

                    </GetScriptBlock>
      </ScriptProperty>
      <ScriptProperty>
        <Name>Points</Name>
        <GetScriptBlock>
                        $this.M11
$this.M12
$this.M21
$this.M22
$this.M31
$this.M32

                    </GetScriptBlock>
      </ScriptProperty>
      <NoteProperty>
        <Name>DefaultDisplay</Name>
        <Value>X
Y
Z</Value>
      </NoteProperty>
    </Members>
  </Type>
  <Type>
    <Name>System.Numerics.Matrix4x4</Name>
    <Members>
      <MemberSet>
        <Name>PSStandardMembers</Name>
        <Members>
          <PropertySet>
            <Name>DefaultDisplayPropertySet</Name>
            <ReferencedProperties>
              <Name>X</Name>
              <Name>Y</Name>
              <Name>Z</Name>
              <Name>W</Name>
            </ReferencedProperties>
          </PropertySet>
        </Members>
      </MemberSet>
      <ScriptProperty>
        <Name>CSS</Name>
        <GetScriptBlock>
                        return "matrix3d($(
@(
$this.M11
$this.M12
$this.M13
$this.M14
$this.M21
$this.M22
$this.M23
$this.M24
$this.M31
$this.M32
$this.M33
$this.M34
$this.M41
$this.M42
$this.M43
$this.M44
) -join ', '
))"
                    </GetScriptBlock>
      </ScriptProperty>
      <ScriptProperty>
        <Name>Html</Name>
        <GetScriptBlock>
                        &lt;#
.SYNOPSIS
    Gets Matrix Html
.DESCRIPTION
    Gets an HTML representation of the Matrix.

    If there is an attached Content property, it will be rendered using the matrix.

    Otherwise, the Matrix's MathML representation will be rendered twice:

    * Once untransformed
    * Once transformed using itself
#&gt;
param()

# If we have content
if ($this.Content) {
    # put it in the matrix.
    "&lt;section style='transform:$($this.CSS)'&gt;"
        if ($this.Content.OuterXml) {
            $this.Content.OuterXml
        } elseif ($this.Content.Html) {
            $this.Content.Html
        } else {
            "$($this.Content)"
        }
    "&lt;/section&gt;"
} else {
    # Otherwise,
    $mathML = $this.MathML
    $mathML.OuterXML # show the MathML
    # and show it again, transformed.
    $mathML.math.setAttribute('style', "transform:$($this.CSS)")
    $mathML.OuterXML
}
                    </GetScriptBlock>
      </ScriptProperty>
      <ScriptProperty>
        <Name>MathML</Name>
        <GetScriptBlock>
                        [xml]@"
&lt;math display='block'&gt;
&lt;mo&gt;[&lt;/mo&gt;
&lt;mtable&gt;
$(
    foreach ($row in 1..4) {
        "&lt;mtr&gt;"
        foreach ($col in 1..4) {
            "&lt;mtd&gt;&lt;mn&gt;$($this."M${row}${col}")&lt;/mn&gt;&lt;/mtd&gt;"
        }
        "&lt;/mtr&gt;"
    }
)
&lt;/mtable&gt;
&lt;mo&gt;]&lt;/mo&gt;
&lt;/math&gt;
"@


                    </GetScriptBlock>
      </ScriptProperty>
      <ScriptProperty>
        <Name>Points</Name>
        <GetScriptBlock>
                        $this.M11
$this.M12
$this.M13
$this.M14
$this.M21
$this.M22
$this.M23
$this.M24
$this.M31
$this.M32
$this.M33
$this.M34
$this.M41
$this.M42
$this.M43
$this.M44

                    </GetScriptBlock>
      </ScriptProperty>
      <NoteProperty>
        <Name>DefaultDisplay</Name>
        <Value>X
Y
Z
W</Value>
      </NoteProperty>
    </Members>
  </Type>
  <Type>
    <Name>System.Numerics.Quaternion</Name>
    <Members>
      <MemberSet>
        <Name>PSStandardMembers</Name>
        <Members>
          <PropertySet>
            <Name>DefaultDisplayPropertySet</Name>
            <ReferencedProperties>
              <Name>X</Name>
              <Name>Y</Name>
              <Name>Z</Name>
              <Name>W</Name>
            </ReferencedProperties>
          </PropertySet>
        </Members>
      </MemberSet>
      <ScriptProperty>
        <Name>CSS</Name>
        <GetScriptBlock>
                        $matrix = [Numerics.Matrix4x4]::CreateFromQuaternion($this)
return "matrix3d($(
@(
$matrix.M11
$matrix.M12
$matrix.M13
$matrix.M14
$matrix.M21
$matrix.M22
$matrix.M23
$matrix.M24
$matrix.M31
$matrix.M32
$matrix.M33
$matrix.M34
$matrix.M41
$matrix.M42
$matrix.M43
$matrix.M44
) -join ', '
))"
                    </GetScriptBlock>
      </ScriptProperty>
      <ScriptProperty>
        <Name>Html</Name>
        <GetScriptBlock>
                        &lt;#
.SYNOPSIS
    Gets Matrix Html
.DESCRIPTION
    Gets an HTML representation of the Matrix.

    If there is an attached Content property, it will be rendered using the matrix.

    Otherwise, the Matrix's MathML representation will be rendered twice:

    * Once untransformed
    * Once transformed using itself
#&gt;
param()

# If we have content
if ($this.Content) {
    # put it in the matrix.
    "&lt;section style='transform:$($this.CSS)'&gt;"
        if ($this.Content.OuterXml) {
            $this.Content.OuterXml
        } elseif ($this.Content.Html) {
            $this.Content.Html
        } else {
            "$($this.Content)"
        }
    "&lt;/section&gt;"
} else {
    # Otherwise,
    $mathML = $this.MathML
    $mathML.OuterXML # show the MathML
    # and show it again, transformed.
    $mathML.math.setAttribute('style', "transform:$($this.CSS)")
    $mathML.OuterXML
}
                    </GetScriptBlock>
      </ScriptProperty>
      <ScriptProperty>
        <Name>MathML</Name>
        <GetScriptBlock>
                        &lt;#
.SYNOPSIS
    Matrix MathML
.DESCRIPTION
    Gets the Matrix as a MathML representation of itself.
.NOTES
    Also shows the equivalent `[Numerics.Matrtix4x4]`
#&gt;
param()
[xml]@"
&lt;math display='block'&gt;
&lt;mo&gt;[&lt;/mo&gt;
&lt;mtable&gt;
$(
    "&lt;mtr&gt;"
    foreach ($var in 'X','Y','Z','W') {
        "&lt;mtd&gt;"
            "&lt;mi&gt;$var&lt;/mi&gt;"
            "&lt;mo&gt;:&lt;/mo&gt;"
            "&lt;mn&gt;$($this.$var)&lt;/mn&gt;"
        "&lt;/mtd&gt;"
    }
    "&lt;/mtr&gt;"
)
&lt;/mtable&gt;
&lt;mo&gt;]&lt;/mo&gt;
&lt;mo&gt;=&lt;/mo&gt;$(
    [Numerics.Matrix4x4]::CreateFromQuaternion($this).MathML.math.innerXml
)
&lt;/math&gt;
"@


                    </GetScriptBlock>
      </ScriptProperty>
      <NoteProperty>
        <Name>DefaultDisplay</Name>
        <Value>X
Y
Z
W</Value>
      </NoteProperty>
    </Members>
  </Type>
</Types>