Reference atan()

atan()

Calculates the arc tangent of a number.

atan() is the inverse of tan(). It expects input values in the range of -Infinity to Infinity. By default, atan() returns values in the range -π ÷ 2 (about -1.57) to π ÷ 2 (about 1.57). If the angleMode() is DEGREES then values are returned in the range -90 to 90.

atan() can also be used in shaders with p5.strands. The following example uses atan() to create a soft color transition on a shape.

Examples

Syntax

atan(value)

Parameters

value
Number: value whose arc tangent is to be returned.

Returns

Number: arc tangent of the given value.

Related References