-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathutilities.html
63 lines (37 loc) · 2.52 KB
/
utilities.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
<html>
<head>
<title>MathCell - Utilities</title>
<link rel="stylesheet" type="text/css" href="style.css">
<style></style>
</head>
<body>
<br id="basic"/>
<h1>Basic Functions</h1>
<p><b>lerp( <i>a</i>, <i>b</i> )</b> — linear interpolation between two-dimensional points returned as a function</p>
<p><b>linspace( <i>a</i>, <i>b</i>, number )</b> — equally spaced number of points from <i>a</i> to <i>b</i> inclusive</p>
<p><b>minMax( data, index )</b> — minimum and maximum values in a data array of points for the specified index returned as <code>{ min: min, max: max }</code></p>
<br id="rounding"/>
<h1>Rounding Functions</h1>
<p><b>roundTo( <i>x</i>, <i>n</i> )</b> — round to <i>n</i> significant digits</p>
<p><b>roundTo( <i>x</i>, <i>n</i>, <code>false</code> )</b> — round to <i>n</i> decimal places</p>
<p><b>floorTo( <i>x</i>, <i>n</i> )</b> — floor to <i>n</i> significant digits</p>
<p><b>floorTo( <i>x</i>, <i>n</i>, <code>false</code> )</b> — floor to <i>n</i> decimal places</p>
<p><b>ceilTo( <i>x</i>, <i>n</i> )</b> — ceiling to <i>n</i> significant digits</p>
<p><b>ceilTo( <i>x</i>, <i>n</i>, <code>false</code> )</b> — ceiling to <i>n</i> decimal places</p>
<br id="transform"/>
<h1>Transformation Functions</h1>
<p><b>normalize( vector )</b> — normalize a vector array</p>
<p><b>translate( points, vector )</b> — translate an array of points by a vector array</p>
<p><b>rotate( points, angle )</b> — rotate an array of points by an angle about the <i>z</i>-axis</p>
<p><b>rotate( points, angle, vector )</b> — rotate an array of points by an angle about an arbitrary axis</p>
<p><b>rotateObject( object, angle, vector )</b> — rotate a graphics object by an angle about an arbitrary axis</p>
<br id="color"/>
<h1>Color Functions</h1>
<p><b>color( <i>r</i>, <i>g</i>, <i>b</i> )</b> — RGB color returned as <code>{ r: r, g: g, b: b }</code></p>
<p><b>colorFromHue( <i>h</i> )</b> — RGB color for a hue in [0,1] returned as <code>{ r: r, g: g, b: b }</code></p>
<p><b>colorFromArg( <i>x</i> )</b> — RGB color from the argument of a complex number returned as <nobr><code>{ r: r, g: g, b: b }</code></nobr></p>
<p><b>colorStringFromHue( <i>h</i> )</b> — HTML color for a hue in [0,1]</p>
<p><b>colormap( name )</b> — predefined colormap returned as a function taking an argument in [0,1]</p>
<p><b>colormap( name, <code>true</code> )</b> — reversed predefined colormap returned as a function</p>
</body>
</html>