From 9224412274e1e1a31a959083bb257a7d6ab2b113 Mon Sep 17 00:00:00 2001 From: David Thompson Date: Fri, 19 Aug 2016 20:40:12 -0400 Subject: Add Sly manual. --- manuals/sly/Miscellaneous.html | 189 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 189 insertions(+) create mode 100644 manuals/sly/Miscellaneous.html (limited to 'manuals/sly/Miscellaneous.html') diff --git a/manuals/sly/Miscellaneous.html b/manuals/sly/Miscellaneous.html new file mode 100644 index 0000000..d94bed8 --- /dev/null +++ b/manuals/sly/Miscellaneous.html @@ -0,0 +1,189 @@ + + + + + +Sly: Miscellaneous + + + + + + + + + + + + + + + + + + + + +
+

+Previous: , Up: Math   [Contents][Index]

+
+
+ +

4.2.6 Miscellaneous

+ +
+
(use-modules (sly math))
+
+ +

A grab bag of commonly used math functions and constants. +

+
+
Scheme Variable: pi
+

An approximation of \pi, the ratio of a circle’s circumference to its +diameter. +

+ +
+
Scheme Variable: 2pi
+

2\pi +

+ +
+
Scheme Variable: pi/2
+

\pi/2 +

+ +
+
Scheme Procedure: degrees->radians angle
+

Convert angle from degrees to radians. +

+ +
+
Scheme Procedure: radians->degrees angle
+

Convert angle from radians to degrees. +

+ +
+
Scheme Procedure: sin-degrees angle
+

Return the sine of angle, where angle is measured in +degrees. +

+ +
+
Scheme Procedure: cos-degrees angle
+

Return the cosine of angle, where angle is measured in +degrees. +

+ +
+
Scheme Procedure: tan-degrees angle
+

Return the tangent of angle, where angle is measured in +degrees. +

+ +
+
Scheme Procedure: atan-degrees y x
+

Return the arctangent of y and x, where y and +x are measured in degrees. +

+ +
+
Scheme Procedure: cotan z
+

Return the cotangent of z. +

+ +
+
Scheme Procedure: clamp min max x
+

Restrict x to the range [min, max], assuming that +min is actually less than max. +

+ +
+
Scheme Procedure: linear-scale min max a b n
+

Map n in the range [min, max] to the range [a, b]. +

+ +
+
Scheme Procedure: half x
+

Return x / 2. +

+ +
+
Scheme Procedure: square x
+

Return x^2. +

+ +
+
Scheme Procedure: make-lerp + *
+

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]. +

+ +
+
Scheme Procedure: lerp start end alpha
+

Return the linear interpolation between the numbers start and +end with scalar factor alpha. +

+ +
+
Scheme Procedure: modulo* x y
+

Return the remainder of x / y. Works like regular +modulo, except that x and y may be rational numbers +or inexact numbers. +

+
+
+

+Previous: , Up: Math   [Contents][Index]

+
+ + + + + -- cgit v1.2.3