Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Convert /web/javascript/reference/global_objects/math folder to Markdown (es) #8167

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
---
title: Math.acos()
slug: Web/JavaScript/Reference/Global_Objects/Math/acos
tags:
- JavaScript
- Math
- Métodos
- Referências
translation_of: Web/JavaScript/Reference/Global_Objects/Math/acos
original_slug: Web/JavaScript/Referencia/Objetos_globales/Math/acos
---
{{JSRef}}

La función **`Math.acos()`** devuelve el arco coseno (en radianes) de un número que es

<math display="block"><semantics><mrow><mo>∀</mo><mi>x</mi><mo>∊</mo><mo stretchy="false">[</mo><mrow><mo>-</mo><mn>1</mn></mrow><mo>;</mo><mn>1</mn><mo stretchy="false">]</mo><mo>,</mo><mspace width="thickmathspace"></mspace><mstyle mathvariant="monospace"><mrow><mo lspace="0em" rspace="thinmathspace">Math.acos</mo><mo stretchy="false">(</mo><mi>x</mi><mo stretchy="false">)</mo></mrow></mstyle><mo>=</mo><mo lspace="0em" rspace="0em">arccos</mo><mo stretchy="false">(</mo><mi>x</mi><mo stretchy="false">)</mo><mo>=</mo><mtext> the unique </mtext><mspace width="thickmathspace"></mspace><mi>y</mi><mo>∊</mo><mo stretchy="false">[</mo><mn>0</mn><mo>;</mo><mi>π</mi><mo stretchy="false">]</mo><mspace width="thinmathspace"></mspace><mtext>such that</mtext><mspace width="thickmathspace"></mspace><mo lspace="0em" rspace="0em">cos</mo><mo stretchy="false">(</mo><mi>y</mi><mo stretchy="false">)</mo><mo>=</mo><mi>x</mi></mrow><annotation encoding="TeX">\forall x \in [{-1};1],\;\mathtt{\operatorname{Math.acos}(x)} = \arccos(x) = \text{ the unique } \; y \in [0; \pi] \, \text{such that} \; \cos(y) = x</annotation></semantics></math>

## Sintaxis

Math.acos(x)

### Parámetros

- `x`
- : Un número.

### Valor devuelto

El arco coseno (en radianes) de un número dado si se encuentra entre **-1** y **1**; de otro modo, {{jsxref("NaN")}}.

## Descripción

El método `Math.acos()` devuelve un valor numérico entre 0 y π radianes para `x` entre -1 y 1. Si el valor de `x` está fuera de este rango, devuelve {{jsxref("NaN")}}.

Debido a que `acos()` es un método estático de `Math`, siempre debe usarse como `Math.acos()`, en vez de como un método de un objeto `Math` creado (`Math` no es un constructor).

## Ejemplos

### Usando `Math.acos()`

```js
Math.acos(-2); // NaN
Math.acos(-1); // 3.141592653589793
Math.acos(0); // 1.5707963267948966
Math.acos(0.5); // 1.0471975511965979
Math.acos(1); // 0
Math.acos(2); // NaN
```

Para valores menores que -1 o mayores que 1, `Math.acos()` devuelve {{jsxref("NaN")}}.

## Especificaciones

| Especificación | Estado | Comentarios |
| ------------------------------------------------------------------------ | ---------------------------- | --------------------------------------------------- |
| {{SpecName('ES1')}} | {{Spec2('ES1')}} | Definición inicial. Implementado en JavaScript 1.0. |
| {{SpecName('ES5.1', '#sec-15.8.2.2', 'Math.acos')}} | {{Spec2('ES5.1')}} | |
| {{SpecName('ES6', '#sec-math.acos', 'Math.acos')}} | {{Spec2('ES6')}} | |
| {{SpecName('ESDraft', '#sec-math.acos', 'Math.acos')}} | {{Spec2('ESDraft')}} | |

## Compatibilidad con navegador

{{Compat("javascript.builtins.Math.acos")}}

## Ver también

- {{jsxref("Math.asin()")}}
- {{jsxref("Math.atan()")}}
- {{jsxref("Math.atan2()")}}
- {{jsxref("Math.cos()")}}
- {{jsxref("Math.sin()")}}
- {{jsxref("Math.tan()")}}

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
---
title: Math.acosh()
slug: Web/JavaScript/Reference/Global_Objects/Math/acosh
tags:
- JavaScript
- Math
- Referencia
- metodo
translation_of: Web/JavaScript/Reference/Global_Objects/Math/acosh
original_slug: Web/JavaScript/Referencia/Objetos_globales/Math/acosh
---
{{JSRef}}

La función **`Math.acosh()`** retorna el arco coseno hiperbólico de un número que es:

<math display="block"><semantics><annotation encoding="TeX">Para todo x mayor ó igual a 1,se cumple que : la funcion Math.acosh(x) = arcosh(x) = al único y mayor ó igual a 0 ; tal que; cosh(y) = x</annotation></semantics></math>

## Sintaxis

Math.acosh(x)

### Parámetros

- `x`
- : Un número.

### Valor retornado

El arco coseno hiperbólico del número dado. Si el número es menor que 1, {{jsxref("NaN")}}.

## Descripción

Como `acosh()` es un método estático de `Math`, siempre debe ser usado como `Math.acosh()`, en vez de como un método de un objeto `Math` creado (`Math` no es constructor).

## Ejemplos

### Utilizando `Math.acosh()`

```js
Math.acosh(-1); // NaN
Math.acosh(0); // NaN
Math.acosh(0.5); // NaN
Math.acosh(1); // 0
Math.acosh(2); // 1.3169578969248166
```

Para valores menores que 1 `Math.acosh()` retorna {{jsxref("NaN")}}.

## Polyfill

Para todo <math><semantics><mrow><mi>x</mi><mo>≥</mo><mn>1</mn></mrow><annotation encoding="TeX">x mayor ó igual a 1</annotation></semantics></math>, se tiene que el arcosh(x) <math><semantics><annotation encoding="TeX">= ln(x + la raiz cuadrada de(x cuadrado - 1)) </annotation></semantics></math> y esto puede ser emulado con la siguiente funcion:

```js
Math.acosh = Math.acosh || function(x) {
return Math.log(x + Math.sqrt(x * x - 1));
};
```

## Especificaciones

| Especificación | Status | Comentario |
| ---------------------------------------------------------------------------- | ---------------------------- | ------------------- |
| {{SpecName('ES6', '#sec-math.acosh', 'Math.acosh')}} | {{Spec2('ES6')}} | Definición inicial. |
| {{ SpecName('ESDraft', '#sec-math.acosh', 'Math.acosh')}} | {{Spec2('ESDraft')}} | |

## Compatibilidad de navegador

{{Compat("javascript.builtins.Math.acosh")}}

## Ver también

- {{jsxref("Math.asinh()")}}
- {{jsxref("Math.atanh()")}}
- {{jsxref("Math.cosh()")}}
- {{jsxref("Math.sinh()")}}
- {{jsxref("Math.tanh()")}}
Loading