0.1.1 • Published 11 months ago
@stdlib/math-base-special-acotf v0.1.1
acotf
Compute the inverse cotangent of a single-precision floating-point number.
Installation
npm install @stdlib/math-base-special-acotf
Usage
var acotf = require( '@stdlib/math-base-special-acotf' );
acotf( x )
Computes the inverse cotangent of a single-precision floating-point number.
var v = acotf( 2.0 );
// returns ~0.4636
v = acotf( Infinity );
// returns 0.0
Examples
var linspace = require( '@stdlib/array-base-linspace' );
var acotf = require( '@stdlib/math-base-special-acotf' );
var x = linspace( -5.0, 5.0, 100 );
var i;
for ( i = 0; i < x.length; i++ ) {
console.log( acotf( x[ i ] ) );
}
C APIs
Usage
#include "stdlib/math/base/special/acotf.h"
stdlib_base_acotf( x )
Computes the inverse cotangent of a single-precision floating-point number.
float out = stdlib_base_acotf( 2.0f );
// returns ~0.4636f
The function accepts the following arguments:
- x:
[in] float
input value.
float stdlib_base_acotf( const float x );
Examples
#include "stdlib/math/base/special/acotf.h"
#include <stdio.h>
int main( void ) {
const float x[] = { -5.0f, -3.89f, -2.78f, -1.67f, -0.56f, 0.56f, 1.67f, 2.78f, 3.89f, 5.0f };
float v;
int i;
for ( i = 0; i < 10; i++ ) {
v = stdlib_base_acotf( x[ i ] );
printf( "acot(%f) = %f\n", x[ i ], v );
}
}
Notice
This package is part of stdlib, a standard library for JavaScript and Node.js, with an emphasis on numerical and scientific computing. The library provides a collection of robust, high performance libraries for mathematics, statistics, streams, utilities, and more.
For more information on the project, filing bug reports and feature requests, and guidance on how to develop stdlib, see the main project repository.
Community
License
See LICENSE.
Copyright
Copyright © 2016-2024. The Stdlib Authors.