|
1 | | -# Module Documentation |
| 1 | +# purescript-math |
2 | 2 |
|
3 | | -## Module Math |
| 3 | +[](https://travis-ci.org/purescript/purescript-math) |
4 | 4 |
|
| 5 | +Math functions. |
5 | 6 |
|
6 | | -Wraps the math functions and constants from Javascript's built-in `Math` object. |
7 | | -See [Math Reference at MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math). |
| 7 | +## Installation |
8 | 8 |
|
9 | | -#### `Radians` |
10 | | - |
11 | | -``` purescript |
12 | | -type Radians = Number |
13 | | -``` |
14 | | - |
15 | | -An alias to make types in this module more explicit. |
16 | | - |
17 | | -#### `abs` |
18 | | - |
19 | | -``` purescript |
20 | | -abs :: Number -> Number |
21 | | -``` |
22 | | - |
23 | | -Returns the absolute value of the argument. |
24 | | - |
25 | | -#### `acos` |
26 | | - |
27 | | -``` purescript |
28 | | -acos :: Number -> Radians |
29 | | -``` |
30 | | - |
31 | | -Returns the inverse cosine of the argument. |
32 | | - |
33 | | -#### `asin` |
34 | | - |
35 | | -``` purescript |
36 | | -asin :: Number -> Radians |
37 | | -``` |
38 | | - |
39 | | -Returns the inverse sine of the argument. |
40 | | - |
41 | | -#### `atan` |
42 | | - |
43 | | -``` purescript |
44 | | -atan :: Number -> Radians |
45 | | -``` |
46 | | - |
47 | | -Returns the inverse tangent of the argument. |
48 | | - |
49 | | -#### `atan2` |
50 | | - |
51 | | -``` purescript |
52 | | -atan2 :: Number -> Number -> Radians |
53 | | -``` |
54 | | - |
55 | | -Four-quadrant tangent inverse. Given the arguments `y` and `x`, returns |
56 | | -the inverse tangent of `y / x`, where the signs of both arguments are used |
57 | | -to determine the sign of the result. |
58 | | -If the first argument is negative, the result will be negative. |
59 | | -The result is the angle between the positive x axis and a point `(x, y)`. |
60 | | - |
61 | | -#### `ceil` |
62 | | - |
63 | | -``` purescript |
64 | | -ceil :: Number -> Number |
65 | | -``` |
66 | | - |
67 | | -Returns the smallest integer not smaller than the argument. |
68 | | - |
69 | | -#### `cos` |
70 | | - |
71 | | -``` purescript |
72 | | -cos :: Radians -> Number |
73 | | -``` |
74 | | - |
75 | | -Returns the cosine of the argument. |
76 | | - |
77 | | -#### `exp` |
78 | | - |
79 | | -``` purescript |
80 | | -exp :: Number -> Number |
81 | | -``` |
82 | | - |
83 | | -Returns `e` exponentiated to the power of the argument. |
84 | | - |
85 | | -#### `floor` |
86 | | - |
87 | | -``` purescript |
88 | | -floor :: Number -> Number |
89 | | -``` |
90 | | - |
91 | | -Returns the largest integer not larger than the argument. |
92 | | - |
93 | | -#### `log` |
94 | | - |
95 | | -``` purescript |
96 | | -log :: Number -> Number |
97 | | -``` |
98 | | - |
99 | | -Returns the natural logarithm of a number. |
100 | | - |
101 | | -#### `max` |
102 | | - |
103 | | -``` purescript |
104 | | -max :: Number -> Number -> Number |
105 | | -``` |
106 | | - |
107 | | -Returns the largest of two numbers. |
108 | | - |
109 | | -#### `min` |
110 | | - |
111 | | -``` purescript |
112 | | -min :: Number -> Number -> Number |
113 | | -``` |
114 | | - |
115 | | -Returns the smallest of two numbers. |
116 | | - |
117 | | -#### `pow` |
118 | | - |
119 | | -``` purescript |
120 | | -pow :: Number -> Number -> Number |
121 | | -``` |
122 | | - |
123 | | -Return the first argument exponentiated to the power of the second argument. |
124 | | - |
125 | | -#### `round` |
126 | | - |
127 | | -``` purescript |
128 | | -round :: Number -> Number |
129 | | -``` |
130 | | - |
131 | | -Returns the integer closest to the argument. |
132 | | - |
133 | | -#### `sin` |
134 | | - |
135 | | -``` purescript |
136 | | -sin :: Radians -> Number |
137 | | -``` |
138 | | - |
139 | | -Returns the sine of the argument. |
140 | | - |
141 | | -#### `sqrt` |
142 | | - |
143 | | -``` purescript |
144 | | -sqrt :: Number -> Number |
145 | 9 | ``` |
146 | | - |
147 | | -Returns the square root of the argument. |
148 | | - |
149 | | -#### `tan` |
150 | | - |
151 | | -``` purescript |
152 | | -tan :: Radians -> Number |
| 10 | +bower install purescript-math |
153 | 11 | ``` |
154 | 12 |
|
155 | | -Returns the tangent of the argument. |
156 | | - |
157 | | -#### `e` |
158 | | - |
159 | | -``` purescript |
160 | | -e :: Number |
161 | | -``` |
162 | | - |
163 | | -The base of natural logarithms, *e*, around 2.71828. |
164 | | - |
165 | | -#### `ln2` |
166 | | - |
167 | | -``` purescript |
168 | | -ln2 :: Number |
169 | | -``` |
170 | | - |
171 | | -The natural logarithm of 2, around 0.6931. |
172 | | - |
173 | | -#### `ln10` |
174 | | - |
175 | | -``` purescript |
176 | | -ln10 :: Number |
177 | | -``` |
178 | | - |
179 | | -The natural logarithm of 10, around 2.3025. |
180 | | - |
181 | | -#### `log2e` |
182 | | - |
183 | | -``` purescript |
184 | | -log2e :: Number |
185 | | -``` |
186 | | - |
187 | | -The base 2 logarithm of `e`, around 1.4426. |
188 | | - |
189 | | -#### `log10e` |
190 | | - |
191 | | -``` purescript |
192 | | -log10e :: Number |
193 | | -``` |
194 | | - |
195 | | -Base 10 logarithm of `e`, around 0.43429. |
196 | | - |
197 | | -#### `pi` |
198 | | - |
199 | | -``` purescript |
200 | | -pi :: Number |
201 | | -``` |
202 | | - |
203 | | -The ratio of the circumference of a circle to its diameter, around 3.14159. |
204 | | - |
205 | | -#### `sqrt1_2` |
206 | | - |
207 | | -``` purescript |
208 | | -sqrt1_2 :: Number |
209 | | -``` |
210 | | - |
211 | | -The Square root of one half, around 0.707107. |
212 | | - |
213 | | -#### `sqrt2` |
214 | | - |
215 | | -``` purescript |
216 | | -sqrt2 :: Number |
217 | | -``` |
218 | | - |
219 | | -The square root of two, around 1.41421. |
220 | | - |
221 | | - |
| 13 | +## Module documentation |
222 | 14 |
|
| 15 | +- [Math](docs/Math.md) |
0 commit comments