acos

asin

atan

atan2

cos

degrees

radians

sin

tan

acos

Arguments
[n]
Docstring
The inverse of cos, returns the arc cosine of a value. This
function expects the values in the range of -1 to 1 and values are
returned in the range 0 to Math/PI (3.1415927).
Works only inside sketch functions?
No
Original Processing method
acos()
Example
(q/background 255)
(q/fill 0)
(q/text (str "(q/acos 0) = " (q/acos 0)) 10 20)
(q/text (str "(q/acos 1) = " (q/acos 1)) 10 40)
try example

asin

Arguments
[n]
Docstring
The inverse of sin, returns the arc sine of a value. This function
expects the values in the range of -1 to 1 and values are returned
in the range -PI/2 to PI/2.
Works only inside sketch functions?
No
Original Processing method
asin()
Example
(q/background 255)
(q/fill 0)
(q/text (str "(q/asin 0) = " (q/asin 0)) 10 20)
(q/text (str "(q/asin 1) = " (q/asin 1)) 10 40)
try example

atan

Arguments
[n]
Docstring
The inverse of tan, returns the arc tangent of a value. This
function expects the values in the range of -Infinity to
Infinity (exclusive) and values are returned in the range -PI/2 to
PI/2 .
Works only inside sketch functions?
No
Original Processing method
atan()
Example
(q/background 255)
(q/fill 0)
(q/text (str "(q/atan 0) = " (q/atan 0)) 10 20)
(q/text (str "(q/atan 1) = " (q/atan 1)) 10 40)
try example

atan2

Arguments
[y x]
Docstring
Calculates the angle (in radians) from a specified point to the
coordinate origin as measured from the positive x-axis. Values are
returned as a float in the range from PI to -PI. The atan2 function
is most often used for orienting geometry to the position of the
cursor. Note: The y-coordinate of the point is the first parameter
and the x-coordinate is the second due to the structure of
calculating the tangent.
Works only inside sketch functions?
No
Original Processing method
atan2()
Example
(q/background 255)
(q/fill 0)
(q/text (str "(q/atan2 2 1) = " (q/atan2 2 1)) 10 20)
(q/text (str "(q/atan2 1 2) = " (q/atan2 1 2)) 10 40)
try example

cos

Arguments
[angle]
Docstring
Calculates the cosine of an angle. This function expects the values
of the angle parameter to be provided in radians (values from 0 to
Math/PI*2). Values are returned in the range -1 to 1.
Works only inside sketch functions?
No
Original Processing method
cos()
Example
(q/background 255)
(q/fill 0)
(q/text (str "(q/cos 0) = " (q/cos 0)) 10 20)
(q/text (str "(q/cos q/HALF-PI) = " (q/cos q/HALF-PI)) 10 40)
try example

degrees

Arguments
[radians]
Docstring
Converts a radian measurement to its corresponding value in
degrees. Radians and degrees are two ways of measuring the same
thing. There are 360 degrees in a circle and (* 2 Math/PI) radians
in a circle. For example, (= 90° (/ Math/PI 2) 1.5707964). All
trigonometric methods in Processing require their parameters to be
specified in radians.
Works only inside sketch functions?
No
Original Processing method
degrees()
Example
(q/background 255)
(q/fill 0)
(q/text (str "(q/degrees 0) = " (q/degrees 0)) 10 20)
(q/text (str "(q/degrees q/HALF-PI) = " (q/degrees q/HALF-PI)) 10 40)
try example

radians

Arguments
[degrees]
Docstring
Converts a degree measurement to its corresponding value in
radians. Radians and degrees are two ways of measuring the same
thing. There are 360 degrees in a circle and 2*PI radians in a
circle. For example, 90° = PI/2 = 1.5707964. All trigonometric
methods in Processing require their parameters to be specified in
radians.
Works only inside sketch functions?
No
Original Processing method
radians()
Example
(q/background 255)
(q/fill 0)
(q/text (str "(q/radians 0) = " (q/radians 0)) 10 20)
(q/text (str "(q/radians 90) = " (q/radians 90)) 10 40)
try example

sin

Arguments
[angle]
Docstring
Calculates the sine of an angle. This function expects the values
of the angle parameter to be provided in radians (values from 0 to
6.28). A float within the range -1 to 1 is returned.
Works only inside sketch functions?
No
Original Processing method
sin()
Example
(q/background 255)
(q/fill 0)
(q/text (str "(q/sin 0) = " (q/sin 0)) 10 20)
(q/text (str "(q/sin q/HALF-PI) = " (q/sin q/HALF-PI)) 10 40)
try example

tan

Arguments
[angle]
Docstring
Calculates the ratio of the sine and cosine of an angle. This
function expects the values of the angle parameter to be provided in
radians (values from 0 to PI*2). Values are returned in the range
infinity to -infinity.
Works only inside sketch functions?
No
Original Processing method
tan()
Example
(q/background 255)
(q/fill 0)
(q/text (str "(q/tan 0) = " (q/tan 0)) 10 20)
(q/text (str "(q/tan  q/QUARTER-PI) = " (q/tan q/QUARTER-PI)) 10 40)
try example