Previous: Quaternions, Up: Math [Contents][Index]
(use-modules (sly math))
A grab bag of commonly used math functions and constants.
An approximation of \pi, the ratio of a circle’s circumference to its diameter.
2\pi
\pi/2
Convert angle from degrees to radians.
Convert angle from radians to degrees.
Return the sine of angle, where angle is measured in degrees.
Return the cosine of angle, where angle is measured in degrees.
Return the tangent of angle, where angle is measured in degrees.
Return the arctangent of y and x, where y and x are measured in degrees.
Return the cotangent of z.
Restrict x to the range [min, max], assuming that min is actually less than max.
Map n in the range [min, max] to the range [a, b].
Return x / 2.
Return x^2.
Return a new procedure that accepts three arguments: start, end, and alpha. The returned procedure uses the procedures + and * to linearly interpolate a value between start and end. alpha should always be in the range [0, 1].
Return the linear interpolation between the numbers start and end with scalar factor alpha.
Return the remainder of x / y. Works like regular
modulo
, except that x and y may be rational numbers
or inexact numbers.
Previous: Quaternions, Up: Math [Contents][Index]