radians()
Let's prepare ourselves to work with waves. But before we dive into the fun part, we have to take a look on radians.
The word itself reveals it's meaning: Radians is the count of radii.
Try to imagine the circumference of a circle as a straight line: The radius of the same circle would fit 6 times into the circumference. To say it in Processing:
radians(360) = 6.2831855.
The half of the circumference 360 is 180 and the radians of 180 is 3.1415927
. Sounds familiar? 3.1415927
is PI (π).
Therefore the radians-function converts degree-values into radian-values.
All trigonometric work with radians-values.
sin(radians_value);
cos(radians_value);
tan(radians_value);
PI (π)
general description, what is it and what is it for
PI is a constant number that describes the ratio between the diameter and the circimference of a circle. PI is exactly 3.14159265359.
$$PI * diameter = circumference/2$$
In Processing, PI is defined as a constant and can be used by calling PI
. Furthermore P5 holds some more constants related to PI: HALF_PI
, QUARTER_PI
, TWO_PI
, PI
particular function / technique description with code and comments