tan()#

Calculates the ratio of the sine and cosine of an angle.

Examples#

example picture for tan()
1def setup():
2    a = 0
3    for i in range(50):
4        py5.line(2*i, 50, 2*i, 50+2*py5.tan(a))
5        a += py5.TWO_PI/50

Description#

Calculates the ratio of the sine and cosine of an angle. This function expects the values of the angle parameter to be provided in radians (values from 0 to TWO_PI). Values are returned in the range infinity to -infinity.

This function makes a call to the numpy tan() function.

Syntax#

tan(angle: Union[float, npt.ArrayLike]) -> Union[float, npt.NDArray]

Parameters#

  • angle: Union[float, npt.ArrayLike] - angle in radians

Updated on February 26, 2022 13:22:44pm UTC