Skip to content

Commit 75bb7a8

Browse files
committed
[css-transforms-2] Convert math from images to MathJax.
1 parent 2adccb8 commit 75bb7a8

File tree

10 files changed

+21
-8
lines changed

10 files changed

+21
-8
lines changed

css-transforms-2/Overview.bs

Lines changed: 21 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,19 @@ spec: filter-effects-1; type:property; text:filter;
4747
spec: html; type: element; text: a;
4848
</pre>
4949

50+
<script>
51+
window.MathJax = {
52+
tex: {
53+
inlineMath: [['$', '$']]
54+
displayMath: [['$$', '$$']]
55+
},
56+
svg: {
57+
fontCache: 'global'
58+
}
59+
};
60+
</script>
61+
<script src="mathjax/es5/tex-svg.js"></script>
62+
5063
Introduction {#intro}
5164
=====================
5265

@@ -148,8 +161,7 @@ Two Dimensional Subset {#two-dimensional-subset}
148161
UAs may not always be able to render three-dimensional transforms and then just support a two-dimensional subset of this specification. In this case <a href="#three-d-transform-functions">three-dimensional transforms</a> and the properties 'transform-style', 'perspective', 'perspective-origin' and 'backface-visibility' must not be supported. Section <a href="#3d-transform-rendering">3D Transform Rendering</a> does not apply. Matrix decomposing uses the technique taken from the "unmatrix" method in "Graphics Gems II, edited by Jim Arvo", simplified for the 2D case. Section <a href="#mathematical-description">Mathematical Description of Transform Functions</a> is still effective but can be reduced by using a 3x3 transformation matrix where <em>a</em> equals m<sub>11</sub>, <em>b</em> equals m<sub>12</sub>, <em>c</em> equals m<sub>21</sub>, <em>d</em> equals m<sub>22</sub>, <em>e</em> equals m<sub>41</sub> and <em>f</em> equals m<sub>42</sub> (see A 2D 3x2 matrix with six parameter).
149162

150163
<div class="figure">
151-
<img src="images/3x3matrix.png" alt="3x3 matrix" title="\begin{bmatrix} a & c & e \\ b
152-
& d & f \\ 0 & 0 & 1 \end{bmatrix}" width="82" height="79">
164+
$$\begin{bmatrix} a & c & e \\ b & d & f \\ 0 & 0 & 1 \end{bmatrix}$$
153165
<p class="caption">
154166
3x3 matrix for two-dimensional transformations.
155167

@@ -1310,29 +1322,30 @@ Mathematical Description of Transform Functions {#mathematical-description}
13101322

13111323
Mathematically, all transform functions can be represented as 4x4 transformation matrices of the following form:
13121324

1313-
<img src="images/4x4matrix.png" alt="\begin{bmatrix} m11 & m21 & m31 & m41 \\ m12 & m22 & m32 & m42 \\ m13 & m23 & m33 & m43 \\ m14 & m24 & m34 & m44 \end{bmatrix}" width="222" height="106">
1325+
$$\begin{bmatrix} m11 & m21 & m31 & m41 \\ m12 & m22 & m32 & m42 \\ m13 & m23 & m33 & m43 \\ m14 & m24 & m34 & m44 \end{bmatrix}$$
13141326

13151327
One translation unit on a matrix is equivalent to 1 pixel in the local coordinate system of the element.
13161328

13171329
<ul>
13181330
<li id="Translate3dDefined">
13191331
A 3D translation with the parameters <em>tx</em>, <em>ty</em> and <em>tz</em> is equivalent to the matrix:
13201332

1321-
<img src="images/translate3d.png" alt="\begin{bmatrix} 1 & 0 & 0 & tx \\ 0 & 1 & 0 & ty \\ 0 & 0 & 1 & tz \\ 0 & 0 & 0 & 1 \end{bmatrix}" width="114" height="106">
1333+
$$\begin{bmatrix} 1 & 0 & 0 & tx \\ 0 & 1 & 0 & ty \\ 0 & 0 & 1 & tz \\ 0 & 0 & 0 & 1 \end{bmatrix}$$
13221334

13231335
<li id="Scale3dDefined">
13241336
A 3D scaling with the parameters <em>sx</em>, <em>sy</em> and <em>sz</em> is equivalent to the matrix:
13251337

1326-
<img src="images/scale3d.png" alt="\begin{bmatrix} sx & 0 & 0 & 0 \\ 0 & sy & 0 & 0 \\ 0 & 0 & sz & 0 \\ 0 & 0 & 0 & 1 \end{bmatrix}" width="137" height="106">
1338+
$$\begin{bmatrix} sx & 0 & 0 & 0 \\ 0 & sy & 0 & 0 \\ 0 & 0 & sz & 0 \\ 0 & 0 & 0 & 1 \end{bmatrix}$$
13271339

13281340
<li id="Rotate3dDefined">
13291341
A 3D rotation with the vector [x,y,z] and the parameter <em>alpha</em> is equivalent to the matrix:
13301342

1331-
<img src="images/rotate3dmatrix.png" alt="\begin{bmatrix} 1 - 2 \cdot (y^2 + z^2) \cdot sq & 2 \cdot (x \cdot y \cdot sq - z \cdot sc) & 2 \cdot (x \cdot z \cdot sq + y \cdot sc) & 0 \\ 2 \cdot (x \cdot y \cdot sq + z \cdot sc) & 1 - 2 \cdot (x^2 + z^2) \cdot sq & 2 \cdot (y \cdot z \cdot sq - x \cdot sc) & 0 \\ 2 \cdot (x \cdot z \cdot sq - y \cdot sc) & 2 \cdot (y \cdot z \cdot sq + x \cdot sc) & 1 - 2 \cdot (x^2 + y^2) \cdot sq & 0 \\ 0 & 0 & 0 & 1 \end{bmatrix}" width="647" height="106">
1343+
$$\begin{bmatrix} 1 - 2 \cdot (y^2 + z^2) \cdot sq & 2 \cdot (x \cdot y \cdot sq - z \cdot sc) & 2 \cdot (x \cdot z \cdot sq + y \cdot sc) & 0 \\ 2 \cdot (x \cdot y \cdot sq + z \cdot sc) & 1 - 2 \cdot (x^2 + z^2) \cdot sq & 2 \cdot (y \cdot z \cdot sq - x \cdot sc) & 0 \\ 2 \cdot (x \cdot z \cdot sq - y \cdot sc) & 2 \cdot (y \cdot z \cdot sq + x \cdot sc) & 1 - 2 \cdot (x^2 + y^2) \cdot sq & 0 \\ 0 & 0 & 0 & 1 \end{bmatrix}$$
13321344

13331345
where:
13341346

1335-
<img src="images/rotate3dvariables.png" alt="\newline sc = \sin (\alpha/2) \cdot \cos (\alpha/2) \newline sq = \sin^2 (\alpha/2)" width="221" height="50">
1347+
$$sc = \sin (\alpha/2) \cdot \cos (\alpha/2)$$
1348+
$$sq = \sin^2 (\alpha/2)$$
13361349

13371350
and where x, y, and z have been normalized
13381351
(that is,
@@ -1343,7 +1356,7 @@ One translation unit on a matrix is equivalent to 1 pixel in the local coordinat
13431356
<li id="PerspectiveDefined">
13441357
A perspective projection matrix with the parameter <em>d</em> is equivalent to the matrix:
13451358

1346-
<img src="images/perspective.png" alt="\begin{bmatrix} 1 & 0 & 0 & 0 \\ 0 & 1 & 0 & 0 \\ 0 & 0 & 1 & 0 \\ 0 & 0 & -1/d & 1 \end{bmatrix}" width="143" height="106">
1359+
$$\begin{bmatrix} 1 & 0 & 0 & 0 \\ 0 & 1 & 0 & 0 \\ 0 & 0 & 1 & 0 \\ 0 & 0 & -1/d & 1 \end{bmatrix}$$
13471360

13481361
</ul>
13491362

-705 Bytes
Binary file not shown.
-1.3 KB
Binary file not shown.
-815 Bytes
Binary file not shown.
-2.69 KB
Binary file not shown.
-1.07 KB
Binary file not shown.
-1.21 KB
Binary file not shown.
-1.2 KB
Binary file not shown.
-883 Bytes
Binary file not shown.
-856 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)