atan()#

The inverse of tan(), returns the arc tangent of a value.

Examples#

1def setup():
2    a = py5.PI/3
3    t = py5.tan(a)
4    a_t = py5.atan(t)
5    # prints "1.04719757 : 1.73205087 : 1.04719757"
6    py5.println(round(a, 8), ':', round(t, 8), ':', round(a_t, 8))
1def setup():
2    a = py5.PI + py5.PI/3
3    t = py5.tan(a)
4    a_t = py5.atan(t)
5    # prints "4.18879027 : 1.73205106 : 1.04719761"
6    py5.println(round(a, 8), ':', round(t, 8), ':', round(a_t, 8))

Description#

The inverse of tan(), returns the arc tangent of a value. This function expects the values in the range of -Infinity to Infinity and values are returned in the range -HALF_PI to HALF_PI.

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

Syntax#

atan(value: Union[float, npt.ArrayLike]) -> Union[float, npt.NDArray]

Parameters#

  • value: Union[float, npt.ArrayLike] - value whose arc tangent is to be returned

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