diff options
Diffstat (limited to 'files/pt-br/web/javascript/reference/global_objects/math/sin')
-rw-r--r-- | files/pt-br/web/javascript/reference/global_objects/math/sin/index.html | 92 |
1 files changed, 92 insertions, 0 deletions
diff --git a/files/pt-br/web/javascript/reference/global_objects/math/sin/index.html b/files/pt-br/web/javascript/reference/global_objects/math/sin/index.html new file mode 100644 index 0000000000..3e5cdea187 --- /dev/null +++ b/files/pt-br/web/javascript/reference/global_objects/math/sin/index.html @@ -0,0 +1,92 @@ +--- +title: Math.sin() +slug: Web/JavaScript/Reference/Global_Objects/Math/sin +translation_of: Web/JavaScript/Reference/Global_Objects/Math/sin +--- +<div>{{JSRef}}</div> + +<p>A função <strong><code>Math.sin()</code></strong> retorna o seno de um número.</p> + +<div>{{EmbedInteractiveExample("pages/js/math-sin.html")}}</div> + +<p class="hidden">A fonte deste exemplo interativo esta em um reposi. Se você tiver interesse em contribuir com o projeto de exemplos interativos, por favor clone <a href="https://github.com/mdn/interactive-examples">https://github.com/mdn/interactive-examples</a> e nos envie um pull request</p> + +<h2 id="Sintaxe">Sintaxe</h2> + +<pre class="syntaxbox"><code>Math.sin(<var>x</var>)</code></pre> + +<h3 id="Paramêtros">Paramêtros</h3> + +<dl> + <dt><code>x</code></dt> + <dd>Um número (dado em radianos)</dd> +</dl> + +<h3 id="Valor_retornado">Valor retornado</h3> + +<p>O seno de um número dado.</p> + +<h2 id="Descrição">Descrição</h2> + +<p>O método <code>Math.sin()</code> retorna um valor numérico entre -1 e 1, que representa o seno de um angulo dado em radianos.</p> + +<p>Como <code>sin()</code> é um método estático de <code>Math</code>, você sempre o usa como <code>Math.sin()</code>, ao invés de um método de um objeto Math que você criou (<code>Math</code> não é um construtor).</p> + +<h2 id="Exemplos">Exemplos</h2> + +<h3 id="Usando_Math.sin()">Usando <code>Math.sin()</code></h3> + +<pre class="brush: js">Math.sin(0); // 0 +Math.sin(1); // 0.8414709848078965 + +Math.sin(Math.PI / 2); // 1 +</pre> + +<h2 id="Especificações">Especificações</h2> + +<table class="standard-table"> + <tbody> + <tr> + <th scope="col">Specification</th> + <th scope="col">Status</th> + <th scope="col">Comment</th> + </tr> + <tr> + <td>{{SpecName('ES1')}}</td> + <td>{{Spec2('ES1')}}</td> + <td>Definição inicial. Implementado no JavaScript 1.0.</td> + </tr> + <tr> + <td>{{SpecName('ES5.1', '#sec-15.8.2.16', 'Math.sin')}}</td> + <td>{{Spec2('ES5.1')}}</td> + <td> </td> + </tr> + <tr> + <td>{{SpecName('ES6', '#sec-math.sin', 'Math.sin')}}</td> + <td>{{Spec2('ES6')}}</td> + <td> </td> + </tr> + <tr> + <td>{{SpecName('ESDraft', '#sec-math.sin', 'Math.sin')}}</td> + <td>{{Spec2('ESDraft')}}</td> + <td> </td> + </tr> + </tbody> +</table> + +<h2 id="Browser_compatibility">Browser compatibility</h2> + +<p class="hidden">The compatibility table in this page is generated from structured data. If you'd like to contribute to the data, please check out <a href="https://github.com/mdn/browser-compat-data">https://github.com/mdn/browser-compat-data</a> and send us a pull request.</p> + +<p>{{Compat("javascript.builtins.Math.sin")}}</p> + +<h2 id="Veja_também">Veja também</h2> + +<ul> + <li>{{jsxref("Math.acos()")}}</li> + <li>{{jsxref("Math.asin()")}}</li> + <li>{{jsxref("Math.atan()")}}</li> + <li>{{jsxref("Math.atan2()")}}</li> + <li>{{jsxref("Math.cos()")}}</li> + <li>{{jsxref("Math.tan()")}}</li> +</ul> |