| [ Web Proxy ] |
| Viewing: https://developer.mozilla.org/pt-BR/docs/Web/JavaScript/Reference/Global_Objects/Math/cos | [Back] [Original] |
Get to know MDN better
Esta pgina foi traduzida do ingls pela comunidade. Saiba mais e junte-se comunidade MDN Web Docs.
This feature is well established and works across many devices and browser versions. Its been available across browsers since julho de 2015.
A funo Math.cos() ,que estatica, retorna o cosseno de um ngulo, que deve estar em radianos. A expresso length adjacent length hypotenuse .
function getCircleX(radians, radius) {
return Math.cos(radians) * radius;
}
console.log(getCircleX(1, 10));
// Expected output: 5.403023058681398
console.log(getCircleX(2, 10));
// Expected output: -4.161468365471424
console.log(getCircleX(Math.PI, 10));
// Expected output: -10
Math.cos(x)
xngulo em radianos
O cosseno do nmero: x
Math.cos() um mtodo que retorna um nmero entre -1 e 1, que representa o cosseno de um ngulo.
J que cos() um mtodo esttico de Math, voc sempre deve usar Math.cos(), ao invez de criar um objeto de Math (Math no tem construtor).
Math.cos()Math.cos(0); // 1
Math.cos(1); // 0.5403023058681398
Math.cos(Math.PI); // -1
Math.cos(2 * Math.PI); // 1
| Specification |
|---|
| ECMAScript 2027 LanguageSpecification # sec-math.cos |
This page was last modified on 17 de fev. de 2025 by MDN contributors.
MathMath.abs()Math.acos()Math.acosh()Math.asin()Math.asinh()Math.atan()Math.atan2()Math.atanh()Math.cbrt()Math.ceil()Math.clz32()Math.cos()Math.cosh()Math.exp()Math.expm1()f16round()Math.floor()fround()Math.hypot()imul()Math.log()Math.log1p()Math.log2()Math.log10()Math.max()Math.min()Math.pow()Math.random()Math.round()Math.sign()Math.sin()Math.sinh()Math.sqrt()sumPrecise()Math.tan()Math.tanh()Math.trunc()Your blueprint for a better internet.
Portions of this content are 19982026 by individual mozilla.org contributors. Content available under a Creative Commons license.
| Web Proxy Viewer | New URL | Original Page |