Compute the cotangent of an angle measured in degrees.
var cotd = require( '@stdlib/math/base/special/cotd' );Evaluates the cotangent of x (in degrees).
var v = cotd( 0.0 );
// returns Infinity
v = cotd( 60.0 );
// returns ~0.58
v = cotd( 90.0 );
// returns 0.0
v = cotd( NaN );
// returns NaNvar uniform = require( '@stdlib/random/array/uniform' );
var logEachMap = require( '@stdlib/console/log-each-map' );
var cotd = require( '@stdlib/math/base/special/cotd' );
var opts = {
'dtype': 'float64'
};
var x = uniform( 100, -180.0, 180.0, opts );
logEachMap( 'cotd(%0.4f) = %0.4f', x, cotd );#include "stdlib/math/base/special/cotd.h"Evaluates the cotangent of x (in degrees).
double out = stdlib_base_cotd( 0.0 );
// returns Infinity
out = stdlib_base_cotd( 60.0 );
// returns ~0.58The function accepts the following arguments:
- x:
[in] doubleinput value.
double stdlib_base_cotd( const double x );#include "stdlib/math/base/special/cotd.h"
#include <stdio.h>
int main( void ) {
const double x[] = { 0.0, 30.0, 45.0, 60.0, 90.0 };
double y;
int i;
for ( i = 0; i < 5; i++ ) {
y = stdlib_base_cotd( x[ i ] );
printf( "cotd(%lf) = %lf\n", x[ i ], y );
}
}@stdlib/math/base/special/cscd: compute the cosecant of a degree.@stdlib/math/base/special/secd: compute the secant of an angle measured in degrees.@stdlib/math/base/special/tand: compute the tangent of an angle measured in degrees.