Next: , Up: Math   [Contents][Index]


5.2.1 Basics

Variable: pi

An essential constant for all trigonometry. Pi is the ratio of a circle’s circumferences to its diameter. Since pi is an irrational number, the pi in Chickadee is a mere floating point approximation that is “good enough.”

Variable: pi/2

Half of pi.

Variable: tau

Twice pi.

Procedure: cotan z

Return the cotangent of z.

Procedure: clamp min max x

Restrict x to the inclusive range defined by min and max. This procedure assumes that min is actually less than max.

Procedure: lerp start end alpha

Linearly interpolate the numbers start and end using the factor alpha, a number in the range [0, 1].

Procedure: degrees->radians degrees

Convert degrees to radians.

Procedure: radians->degrees radians

Convert radians to degrees.