Calculates the tangent of an angle.
tan() is useful for many geometric tasks in creative coding. The values returned range from -Infinity to Infinity and repeat periodically as the input angle increases. tan() calculates the tan of an angle, using radians by default, or according to if angleMode() setting (RADIANS or DEGREES).
tan() can also be used in shaders with p5.strands. The following example uses tan() to create rapid color transitions on a shape.
Examples
Syntax
tan(angle)
Parameters
angle
Number: the angle, in radians by default, or according to if angleMode() setting (RADIANS or DEGREES).
Returns
Number: tangent of the angle.
Notice any errors or typos? Please let us know. Please feel free to edit src/math/trigonometry.js and open a pull request!