aboutsummaryrefslogtreecommitdiff
path: root/files/pt-br/web/css/transform-function/matrix/index.html
diff options
context:
space:
mode:
Diffstat (limited to 'files/pt-br/web/css/transform-function/matrix/index.html')
-rw-r--r--files/pt-br/web/css/transform-function/matrix/index.html112
1 files changed, 112 insertions, 0 deletions
diff --git a/files/pt-br/web/css/transform-function/matrix/index.html b/files/pt-br/web/css/transform-function/matrix/index.html
new file mode 100644
index 0000000000..8b21cf7b37
--- /dev/null
+++ b/files/pt-br/web/css/transform-function/matrix/index.html
@@ -0,0 +1,112 @@
+---
+title: matrix()
+slug: Web/CSS/transform-function/matrix
+translation_of: Web/CSS/transform-function/matrix()
+original_slug: Web/CSS/transform-function/matrix()
+---
+<div>{{CSSRef}}</div>
+
+<p>A função CSS <code><strong>matrix()</strong></code> define uma matriz de transformação 2D homogênea. Isso resulta em um dado do tipo {{cssxref("&lt;transform-function&gt;")}} .</p>
+
+<div class="note">
+<p><strong>Note:</strong> <code>matrix(a, b, c, d, tx, ty)</code> is a shorthand for <code><a href="/en-US/docs/Web/CSS/transform-function/matrix3d">matrix3d</a>(a, b, 0, 0, c, d, 0, 0, 0, 0, 1, 0, tx, ty, 0, 1)</code>.</p>
+</div>
+
+<h2 id="Syntax">Syntax</h2>
+
+<p>The <code>matrix()</code> function is specified with six values. The constant values are implied and not passed as parameters; the other parameters are described in the column-major order.</p>
+
+<div class="note"><strong>Note:</strong> Until Firefox 16, Gecko accepted a {{cssxref("&lt;length&gt;")}} value for <var>tx</var> and <var>ty</var>.</div>
+
+<pre class="syntaxbox">matrix(<var>a</var>, <var>b</var>, <var>c</var>, <var>d</var>, <var>tx</var>, <var>ty</var>)
+</pre>
+
+<h3 id="Values">Values</h3>
+
+<dl>
+ <dt><var>a</var> <var>b</var> <var>c</var> <var>d</var></dt>
+ <dd>Are {{cssxref("&lt;number&gt;")}}s describing the linear transformation.</dd>
+ <dt><var>tx</var> <var>ty</var></dt>
+ <dd>Are {{cssxref("&lt;number&gt;")}}s describing the translation to apply.</dd>
+</dl>
+
+<table class="standard-table">
+ <thead>
+ <tr>
+ <th scope="col">Cartesian coordinates on ℝ<sup>2</sup></th>
+ <th scope="col">Homogeneous coordinates on ℝℙ<sup>2</sup></th>
+ <th scope="col">Cartesian coordinates on ℝ<sup>3</sup></th>
+ <th scope="col">Homogeneous coordinates on ℝℙ<sup>3</sup></th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr>
+ <td colspan="1" rowspan="2"><math> <mfenced> <mtable> <mtr><mtd>a</mtd><mtd>c</mtd></mtr> <mtr><mtd>b</mtd><mtd>d</mtd></mtr> </mtable> </mfenced> </math></td>
+ <td><math> <mfenced> <mtable> <mtr><mtd>a</mtd><mtd>c</mtd><mtd>tx</mtd></mtr><mtr><mtd>b</mtd><mtd>d</mtd><mtd>ty</mtd></mtr><mtr><mtd>0</mtd><mtd>0</mtd><mtd>1</mtd></mtr></mtable> </mfenced> </math></td>
+ <td colspan="1" rowspan="2"><math> <mfenced> <mtable> <mtr><mtd>a</mtd><mtd>c</mtd><mtd>tx</mtd></mtr><mtr><mtd>b</mtd><mtd>d</mtd><mtd>ty</mtd></mtr><mtr><mtd>0</mtd><mtd>0</mtd><mtd>1</mtd></mtr></mtable> </mfenced> </math></td>
+ <td colspan="1" rowspan="2"><math> <mfenced> <mtable> <mtr><mtd>a</mtd><mtd>c</mtd><mtd>0</mtd><mtd>tx</mtd></mtr><mtr><mtd>b</mtd><mtd>d</mtd><mtd>0</mtd><mtd>ty</mtd></mtr><mtr><mtd>0</mtd><mtd>0</mtd><mtd>1</mtd><mtd>0</mtd></mtr><mtr><mtd>0</mtd><mtd>0</mtd><mtd>0</mtd><mtd>1</mtd></mtr></mtable> </mfenced> </math></td>
+ </tr>
+ <tr>
+ <td><code>[a b c d tx ty]</code></td>
+ </tr>
+ </tbody>
+</table>
+
+<p>The values represent the following functions:<br>
+ <code>matrix( scaleX(), skewY(), skewX(), scaleY(), translateX(), translateY() )</code></p>
+
+<h2 id="Examples">Examples</h2>
+
+<h3 id="HTML">HTML</h3>
+
+<pre class="brush: html">&lt;div&gt;Normal&lt;/div&gt;
+&lt;div class="changed"&gt;Changed&lt;/div&gt;</pre>
+
+<h3 id="CSS">CSS</h3>
+
+<pre class="brush: css">div {
+ width: 80px;
+ height: 80px;
+ background-color: skyblue;
+}
+
+.changed {
+ transform: matrix(1, 2, -1, 1, 80, 80);
+ background-color: pink;
+}</pre>
+
+<h3 id="Result">Result</h3>
+
+<p>{{EmbedLiveSample("Examples", 350, 350)}}</p>
+
+<h2 id="Specifications">Specifications</h2>
+
+<table class="standard-table">
+ <thead>
+ <tr>
+ <th scope="col">Specification</th>
+ <th scope="col">Status</th>
+ <th scope="col">Comment</th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr>
+ <td>{{SpecName("CSS3 Transforms", "#funcdef-transform-matrix", "matrix()")}}</td>
+ <td>{{Spec2("CSS3 Transforms")}}</td>
+ <td>Initial definition</td>
+ </tr>
+ </tbody>
+</table>
+
+<h2 id="Browser_compatibility">Compatibilidade com navegadores</h2>
+
+<p>Please see the <code><a href="/en-US/docs/Web/CSS/transform-function#Browser_compatibility">&lt;transform-function&gt;</a></code> data type for compatibility info.</p>
+
+<h2 id="See_also">See also</h2>
+
+<ul>
+ <li>{{cssxref("transform")}}</li>
+ <li>{{cssxref("&lt;transform-function&gt;")}}</li>
+ <li><code><a href="/en-US/docs/Web/CSS/transform-function/matrix3d">matrix3d()</a></code></li>
+ <li><a href="https://dev.opera.com/articles/understanding-the-css-transforms-matrix/">Understanding the CSS Transforms Matrix</a></li>
+</ul>