@stdlib/math-base-special-cotdf
v0.1.1
Published
Compute the cotangent of a single-precision floating-point number (in degrees).
Downloads
79
Readme
cotdf
Compute the cotangent of a single-precision floating-point number (in degrees).
Installation
npm install @stdlib/math-base-special-cotdfUsage
var cotdf = require( '@stdlib/math-base-special-cotdf' );cotdf( x )
Evaluates the cotangent of a single-precision floating-point number (in degrees).
var v = cotdf( 0.0 );
// returns Infinity
v = cotdf( 60.0 );
// returns ~0.58
v = cotdf( 90.0 );
// returns 0.0
v = cotdf( NaN );
// returns NaNExamples
var uniform = require( '@stdlib/random-array-uniform' );
var logEachMap = require( '@stdlib/console-log-each-map' );
var cotdf = require( '@stdlib/math-base-special-cotdf' );
var opts = {
'dtype': 'float32'
};
var x = uniform( 100, -180.0, 180.0, opts );
logEachMap( 'cotdf(%0.4f) = %0.4f', x, cotdf );C APIs
Usage
#include "stdlib/math/base/special/cotdf.h"stdlib_base_cotdf( x )
Evaluates the cotangent of a single-precision floating-point number (in degrees).
float out = stdlib_base_cotdf( 0.0f );
// returns Infinity
out = stdlib_base_cotdf( 60.0f );
// returns ~0.58fThe function accepts the following arguments:
- x:
[in] floatinput value.
float stdlib_base_cotdf( const float x );Examples
#include "stdlib/math/base/special/cotdf.h"
#include <stdio.h>
int main( void ) {
const float x[] = { 0.0f, 30.0f, 45.0f, 60.0f, 90.0f };
float y;
int i;
for ( i = 0; i < 5; i++ ) {
y = stdlib_base_cotdf( x[ i ] );
printf( "cotdf(%f) = %f\n", x[ i ], y );
}
}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-2026. The Stdlib Authors.
