We believe in a future in which the web is a preferred environment for numerical computation. To help realize this future, we've built stdlib. stdlib is a standard library, with an emphasis on numerical and scientific computation, written in JavaScript (and C) for execution in browsers and in Node.js.
The library is fully decomposable, being architected in such a way that you can swap out and mix and match APIs and functionality to cater to your exact preferences and use cases.
When you use stdlib, you can be absolutely certain that you are using the most thorough, rigorous, well-written, studied, documented, tested, measured, and high-quality code out there.
To join us in bringing numerical computing to the web, get started by checking us out on GitHub, and please consider financially supporting stdlib. We greatly appreciate your continued support!
asin
[![NPM version][npm-image]][npm-url] [![Build Status][test-image]][test-url] [![Coverage Status][coverage-image]][coverage-url]
Compute the [arcsine][arcsine] of a double-precision floating-point number.
bash
npm install @stdlib/math-base-special-asin
javascript
var asin = require( '@stdlib/math-base-special-asin' );
#### asin( x )
Computes the [arcsine][arcsine] of a double-precision floating-point number (in radians).
javascript
var v = asin( 0.0 );
// returns 0.0
v = asin( -3.141592653589793/6.0 );
// returns ~-0.551
The domain of x
is restricted to [-1,1]
. If |x| > 1
, the function returns NaN
.
javascript
var v = asin( -3.14 );
// returns NaN
javascript
var linspace = require( '@stdlib/array-base-linspace' );
var asin = require( '@stdlib/math-base-special-asin' );
var x = linspace( -1.0, 1.0, 100 );
var i;
for ( i = 0; i < x.length; i++ ) {
console.log( asin( x[ i ] ) );
}
c
#include "stdlib/math/base/special/asin.h"
#### stdlib_base_asin( x )
Computes the [arcsine][arcsine] of a double-precision floating-point number (in radians).
c
double out = stdlib_base_asin( 0.0 );
// returns 0.0
out = stdlib_base_asin( -3.141592653589793/6.0 );
// returns ~-0.551
The function accepts the following arguments:
- x: [in] double
input value (in radians).
c
double stdlib_base_asin( const double x );
c
#include "stdlib/math/base/special/asin.h"
#include <stdio.h>
int main( void ) {
const double x[] = { -1.0, -0.78, -0.56, -0.33, -0.11, 0.11, 0.33, 0.56, 0.78, 1.0 };
double v;
int i;
for ( i = 0; i < 10; i++ ) {
v = stdlib_base_asin( x[ i ] );
printf( "asin(%lf) = %lf\n", x[ i ], v );
}
}
@stdlib/math-base/special/acos
][@stdlib/math/base/special/acos]: compute the arccosine of a double-precision floating-point number.
- [@stdlib/math-base/special/asinh
][@stdlib/math/base/special/asinh]: compute the hyperbolic arcsine of a double-precision floating-point number.
- [@stdlib/math-base/special/atan
][@stdlib/math/base/special/atan]: compute the arctangent of a double-precision floating-point number.