Lipi Reference
Lipi

Functions

math.cos()

The cosine of `angle`, where the angle is in radians.

Syntax · 1 of 4

                math.cos(const float angle) → const float
              

Arguments

angle required const float Angle, in radians.

Return Type

const float

Syntax · 2 of 4

                math.cos(input float angle) → input float
              

Arguments

angle required input float Angle, in radians.

Return Type

input float

Syntax · 3 of 4

                math.cos(simple float angle) → simple float
              

Arguments

angle required simple float Angle, in radians.

Return Type

simple float

Syntax · 4 of 4

                math.cos(series float angle) → series float
              

Arguments

angle required series float Angle, in radians.

Return Type

series float

Example


          //@lipi=2
indicator("math.cos Example", overlay=false)
wave = math.cos(bar_index * math.pi / 10)
plot(wave, title="Cosine Wave", color=color.blue)