scipy.special.cotdg#

scipy.special.cotdg(x, out=None) = <ufunc 'cotdg'>#

Cotangent of the angle x given in degrees.

Parameters:
xarray_like

Angle, given in degrees.

outndarray, optional

Optional output array for the function results.

Returns:
scalar or ndarray

Cotangent at the input.

See also

sindg, cosdg, tandg

Notes

Array API Standard Support

cotdg has support for Python Array API Standard compatible backends in addition to NumPy. The following combinations of backend and device (or other capability) are supported.

Library

CPU

GPU

NumPy

n/a

CuPy

n/a

PyTorch

JAX

Dask

n/a

For the NumPy backend, this function supports all NumPy ufunc keyword arguments. Other backends may support out, but none of the other ufunc kwargs. out is typically supported for CuPy and PyTorch, but not currently in cases where SciPy relies on a generic Array API implementation or, for PyTorch on CPU, falls back to the NumPy backend. out is never supported for JAX because JAX arrays are immutable. cotdg does not currently support out for the PyTorch backend.

See Support for the array API standard for more information.

Examples

>>> import numpy as np
>>> import scipy.special as sc

It is more accurate than using cotangent directly.

>>> x = 90 + 180 * np.arange(3)
>>> sc.cotdg(x)
array([0., 0., 0.])
>>> 1 / np.tan(x * np.pi / 180)
array([6.1232340e-17, 1.8369702e-16, 3.0616170e-16])