asin()#

The inverse of sin(), returns the arc sine of a value.

Examples#

1def setup():
2    a = py5.PI/3
3    s = py5.sin(a)
4    a_s = py5.asin(s)
5    # prints "1.04719757 : 0.86602541 : 1.04719757"
6    py5.println(round(a, 8), ':', round(s, 8), ':', round(a_s, 8))
1def setup():
2    a = py5.PI + py5.PI/3
3    s = py5.sin(a)
4    a_s = py5.asin(s)
5    # prints "4.18879027 : -0.86602543 : -1.04719761"
6    py5.println(round(a, 8), ':', round(s, 8), ':', round(a_s, 8))

Description#

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

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

Syntax#

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

Parameters#

  • value: Union[float, npt.ArrayLike] - value in the range of -1 to 1 whose arc sine is to be returned

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