Skip to main content
All trigonometric functions operate element-wise. Angles are in radians unless otherwise noted.

sin

Compute the sine, element-wise.
Returns: NDArray — Sine of each element.

cos

Compute the cosine, element-wise.
Returns: NDArray — Cosine of each element.

tan

Compute the tangent, element-wise.
Returns: NDArray — Tangent of each element.

arcsin

Compute the inverse sine, element-wise. Also available as the alias asin.
Returns: NDArray — Angle in radians, in the range [-pi/2, pi/2].

arccos

Compute the inverse cosine, element-wise. Also available as the alias acos.
Returns: NDArray — Angle in radians, in the range [0, pi].

arctan

Compute the inverse tangent, element-wise. Also available as the alias atan.
Returns: NDArray — Angle in radians, in the range [-pi/2, pi/2].

arctan2

Compute the two-argument inverse tangent, element-wise. Returns the angle of the point (x2, x1) with the positive x-axis. Also available as the alias atan2.
Returns: NDArray — Angle in radians, in the range [-pi, pi].

hypot

Compute the hypotenuse sqrt(x1**2 + x2**2), element-wise. Avoids overflow for large values.
Returns: NDArray — Element-wise hypotenuse.

degrees

Convert angles from radians to degrees. Equivalent to rad2deg.
Returns: NDArray — Angles in degrees.

radians

Convert angles from degrees to radians. Equivalent to deg2rad.
Returns: NDArray — Angles in radians.

deg2rad

Convert angles from degrees to radians. Equivalent to radians.
Returns: NDArray — Angles in radians.

rad2deg

Convert angles from radians to degrees. Equivalent to degrees.
Returns: NDArray — Angles in degrees.