参考 cos()

cos()

Calculates the cosine of an angle.

cos() is useful for many geometric tasks in creative coding. The values returned oscillate between -1 and 1 as the input angle increases. cos() calculates the cosine of an angle, using radians by default, or according to if angleMode() setting (RADIANS or DEGREES).

示例

语法

cos(angle)

参数

angle
Number:

the angle, in radians by default, or according to if angleMode() setting (RADIANS or DEGREES).

返回值

Number: cosine of the angle.
This page is generated from the comments in src/math/trigonometry.js . Please feel free to edit it and submit a pull request!

相关参考