sin

Static sin 

Source
pub static sin: SinInternalType
Expand description

Calculates the sine of an angle. This function takes into account the current angleMode. Values are returned in the range -1 to 1.

Examples

let a = 0.0;
let inc = TWO_PI / 25.0;
for (let i = 0; i < 25; i++) {
  line(i * 4, 50, i * 4, 50 + sin(a) * 40.0);
  a = a + inc;
}

Parameters

angle the angle