uom-types 2.0.0 → 3.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +33 -1
- package/dist/_angle-plane.d.cts +89 -0
- package/dist/_angle-plane.d.mts +89 -0
- package/dist/_identity.d.cts +29 -0
- package/dist/_identity.d.mts +29 -0
- package/dist/_index.d.cts +235 -0
- package/dist/_index.d.mts +235 -0
- package/dist/_time-duration.d.cts +482 -0
- package/dist/_time-duration.d.mts +482 -0
- package/dist/{functions-ho.cjs → functions-higher-order.cjs} +31 -4
- package/dist/{functions-ho.d.cts → functions-higher-order.d.cts} +37 -8
- package/dist/{functions-ho.d.mts → functions-higher-order.d.mts} +37 -8
- package/dist/{functions-ho.mjs → functions-higher-order.mjs} +31 -4
- package/dist/functions.cjs +167 -5
- package/dist/functions.d.cts +169 -26
- package/dist/functions.d.mts +169 -26
- package/dist/functions.mjs +155 -6
- package/dist/index.d.cts +1 -86
- package/dist/index.d.mts +1 -86
- package/dist/units-converters.cjs +564 -0
- package/dist/units-converters.d.cts +370 -0
- package/dist/units-converters.d.mts +370 -0
- package/dist/units-converters.mjs +483 -0
- package/dist/units.d.cts +3056 -0
- package/dist/units.d.mts +3056 -0
- package/package.json +61 -48
- package/dist/si-units-converters.cjs +0 -2
- package/dist/si-units-converters.d.cts +0 -2
- package/dist/si-units-converters.d.mts +0 -2
- package/dist/si-units-converters.mjs +0 -1
- package/dist/si-units.d.cts +0 -5
- package/dist/si-units.d.mts +0 -5
package/dist/functions.d.cts
CHANGED
|
@@ -1,26 +1,42 @@
|
|
|
1
|
-
import { Multiply, Divide, Inverse, UnknownUnit, DivideUnitExponents } from './
|
|
2
|
-
import {
|
|
1
|
+
import { M as Multiply, D as Divide, I as Inverse, U as UnknownUnit, a as Unit, b as UnknownAbstractUnit, A as AbstractUnit, c as DivideUnitExponents } from './_index.cjs';
|
|
2
|
+
import { R as Radian } from './_angle-plane.cjs';
|
|
3
|
+
import { U as Unitless } from './_identity.cjs';
|
|
3
4
|
|
|
4
|
-
type OperationIO<T extends number> = T extends UnknownUnit ? T : number;
|
|
5
5
|
/**
|
|
6
|
-
*
|
|
6
|
+
* @module uom-types/functions
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
type OperationIO<T extends number> = [T] extends [
|
|
10
|
+
UnknownUnit | UnknownAbstractUnit
|
|
11
|
+
] ? T : number;
|
|
12
|
+
/**
|
|
13
|
+
* Add two values with the same units together.
|
|
14
|
+
*
|
|
15
|
+
* @category Math
|
|
7
16
|
*/
|
|
8
17
|
declare function add<T extends number>(a: OperationIO<T>, b: OperationIO<T>): OperationIO<T>;
|
|
9
18
|
/**
|
|
10
|
-
* Subtract one value from another.
|
|
19
|
+
* Subtract one value from another with the same units.
|
|
20
|
+
*
|
|
21
|
+
* @category Math
|
|
11
22
|
*/
|
|
12
23
|
declare function sub<T extends number>(a: OperationIO<T>, b: OperationIO<T>): OperationIO<T>;
|
|
13
24
|
/**
|
|
14
25
|
* Multiple two values together.
|
|
26
|
+
*
|
|
27
|
+
* @category Math
|
|
15
28
|
*/
|
|
16
|
-
declare function mul<A extends number, B extends number>(a:
|
|
29
|
+
declare function mul<A extends number, B extends number>(a: A, b: B): Multiply<A, B>;
|
|
17
30
|
/**
|
|
18
31
|
* Divide one value by another.
|
|
32
|
+
*
|
|
33
|
+
* @category Math
|
|
19
34
|
*/
|
|
20
|
-
declare function div<A extends number, B extends number>(a:
|
|
35
|
+
declare function div<A extends number, B extends number>(a: A, b: B): Divide<A, B>;
|
|
21
36
|
/**
|
|
22
37
|
* Modulo operator.
|
|
23
38
|
*
|
|
39
|
+
* @category Math
|
|
24
40
|
* @param a - Must be an integer.
|
|
25
41
|
* @param b - Must be an integer.
|
|
26
42
|
* @returns `a % b`
|
|
@@ -29,6 +45,7 @@ declare function mod<T extends number>(a: OperationIO<T>, b: OperationIO<T>): Op
|
|
|
29
45
|
/**
|
|
30
46
|
* Perform mathematic modular arithmetic.
|
|
31
47
|
*
|
|
48
|
+
* @category Math
|
|
32
49
|
* @param a - Must be an integer.
|
|
33
50
|
* @param b - Must be a positive integer.
|
|
34
51
|
* @returns An integer between zero (inclusive) and `b` (exclusive).
|
|
@@ -36,95 +53,221 @@ declare function mod<T extends number>(a: OperationIO<T>, b: OperationIO<T>): Op
|
|
|
36
53
|
declare function modSafe<T extends number>(a: OperationIO<T>, b: OperationIO<T>): OperationIO<T>;
|
|
37
54
|
/**
|
|
38
55
|
* Put a number to the power of -1.
|
|
56
|
+
*
|
|
57
|
+
* @category Math
|
|
39
58
|
*/
|
|
40
|
-
declare function pow<B extends number>(base:
|
|
59
|
+
declare function pow<B extends number>(base: B, exponent: -1): Inverse<B>;
|
|
41
60
|
/**
|
|
42
61
|
* Put a number to the power of 0.
|
|
62
|
+
*
|
|
63
|
+
* @category Math
|
|
43
64
|
*/
|
|
44
|
-
declare function pow<B extends number>(base:
|
|
65
|
+
declare function pow<B extends number>(base: B, exponent: 0): B extends UnknownUnit ? Unit<{}> : B extends UnknownAbstractUnit ? AbstractUnit<{}> : 1;
|
|
45
66
|
/**
|
|
46
67
|
* Put a number to the power of 1/2.
|
|
68
|
+
*
|
|
69
|
+
* @category Math
|
|
47
70
|
*/
|
|
48
|
-
declare function pow<B extends number>(base:
|
|
71
|
+
declare function pow<B extends number>(base: B, exponent: 0.5): DivideUnitExponents<B, 2>;
|
|
49
72
|
/**
|
|
50
73
|
* Put a number to the power of 1.
|
|
74
|
+
*
|
|
75
|
+
* @category Math
|
|
51
76
|
*/
|
|
52
|
-
declare function pow<E extends number>(base:
|
|
77
|
+
declare function pow<E extends number>(base: E, exponent: 1): E;
|
|
53
78
|
/**
|
|
54
79
|
* Put a number to the power of 2.
|
|
80
|
+
*
|
|
81
|
+
* @category Math
|
|
55
82
|
*/
|
|
56
|
-
declare function pow<B extends number>(base:
|
|
83
|
+
declare function pow<B extends number>(base: B, exponent: 2): Multiply<B, B>;
|
|
57
84
|
/**
|
|
58
85
|
* Put a number to the power of 3.
|
|
86
|
+
*
|
|
87
|
+
* @category Math
|
|
59
88
|
*/
|
|
60
|
-
declare function pow<B extends number>(base:
|
|
89
|
+
declare function pow<B extends number>(base: B, exponent: 3): Multiply<B, Multiply<B, B>>;
|
|
61
90
|
/**
|
|
62
91
|
* Put a number to the power of 4.
|
|
92
|
+
*
|
|
93
|
+
* @category Math
|
|
63
94
|
*/
|
|
64
|
-
declare function pow<B extends number>(base:
|
|
95
|
+
declare function pow<B extends number>(base: B, exponent: 4): Multiply<B, Multiply<B, Multiply<B, B>>>;
|
|
65
96
|
/**
|
|
66
97
|
* Put one number to the power of the other.
|
|
98
|
+
*
|
|
99
|
+
* @category Math
|
|
67
100
|
*/
|
|
68
|
-
declare function pow<B extends number, E extends number>(base:
|
|
101
|
+
declare function pow<B extends number, E extends number>(base: B, exponent: E extends UnknownUnit ? never : E extends UnknownAbstractUnit ? never : E): number;
|
|
69
102
|
/**
|
|
70
103
|
* Take the square root of the given value.
|
|
104
|
+
*
|
|
105
|
+
* @category Math
|
|
71
106
|
*/
|
|
72
|
-
declare function sqrt<T extends number>(value:
|
|
107
|
+
declare function sqrt<T extends number>(value: T): DivideUnitExponents<T, 2>;
|
|
73
108
|
/**
|
|
74
109
|
* Inverse the given value.
|
|
110
|
+
*
|
|
111
|
+
* @category Math
|
|
75
112
|
*/
|
|
76
|
-
declare function inverse<T extends number>(value:
|
|
113
|
+
declare function inverse<T extends number>(value: T): Inverse<T>;
|
|
77
114
|
/**
|
|
78
|
-
*
|
|
115
|
+
* Returns the negative of the given value.
|
|
116
|
+
*
|
|
117
|
+
* @category Math
|
|
79
118
|
*/
|
|
80
119
|
declare function negate<T extends number>(value: OperationIO<T>): OperationIO<T>;
|
|
81
120
|
/**
|
|
82
|
-
* Returns the absolute value of
|
|
121
|
+
* Returns the absolute value of the given value.
|
|
122
|
+
*
|
|
123
|
+
* @category Math
|
|
83
124
|
*/
|
|
84
125
|
declare function abs<T extends number>(value: OperationIO<T>): OperationIO<T>;
|
|
85
126
|
/**
|
|
86
127
|
* Returns the greatest integer less than or equal to the given value.
|
|
128
|
+
*
|
|
129
|
+
* @category Math
|
|
87
130
|
*/
|
|
88
131
|
declare function floor<T extends number>(value: OperationIO<T>): OperationIO<T>;
|
|
89
132
|
/**
|
|
90
133
|
* Returns the smallest integer greater than or equal the given value.
|
|
134
|
+
*
|
|
135
|
+
* @category Math
|
|
91
136
|
*/
|
|
92
137
|
declare function ceil<T extends number>(value: OperationIO<T>): OperationIO<T>;
|
|
93
138
|
/**
|
|
94
139
|
* Returns the given value rounded to the nearest integer.
|
|
140
|
+
*
|
|
141
|
+
* @category Math
|
|
95
142
|
*/
|
|
96
143
|
declare function round<T extends number>(value: OperationIO<T>): OperationIO<T>;
|
|
97
144
|
/**
|
|
98
145
|
* Returns the larger value in the given collection.
|
|
146
|
+
*
|
|
147
|
+
* @category Math
|
|
99
148
|
*/
|
|
100
149
|
declare function max<T extends number>(values: Iterable<T>): OperationIO<T>;
|
|
101
150
|
/**
|
|
102
151
|
* Returns the smallest value in the given collection.
|
|
152
|
+
*
|
|
153
|
+
* @category Math
|
|
103
154
|
*/
|
|
104
155
|
declare function min<T extends number>(values: Iterable<T>): OperationIO<T>;
|
|
105
156
|
/**
|
|
106
157
|
* Takes the sum of all the values in the given collection.
|
|
158
|
+
*
|
|
159
|
+
* @category Math
|
|
107
160
|
*/
|
|
108
|
-
declare function sum<T extends number>(values:
|
|
161
|
+
declare function sum<T extends number>(values: Iterable<T>): OperationIO<T>;
|
|
109
162
|
/**
|
|
110
163
|
* Equal: Compare if two values are equal.
|
|
164
|
+
*
|
|
165
|
+
* @category Math
|
|
111
166
|
*/
|
|
112
|
-
declare function eq<
|
|
167
|
+
declare function eq<T extends number>(a: OperationIO<T>, b: OperationIO<T>): boolean;
|
|
113
168
|
/**
|
|
114
169
|
* Greater Than: Compare if the first value is greater than the second.
|
|
170
|
+
*
|
|
171
|
+
* @category Math
|
|
115
172
|
*/
|
|
116
|
-
declare function gt<
|
|
173
|
+
declare function gt<T extends number>(a: OperationIO<T>, b: OperationIO<T>): boolean;
|
|
117
174
|
/**
|
|
118
175
|
* Greater Than or Equal: Compare if the first value is greater than or equal to the second.
|
|
176
|
+
*
|
|
177
|
+
* @category Math
|
|
119
178
|
*/
|
|
120
|
-
declare function gte<
|
|
179
|
+
declare function gte<T extends number>(a: OperationIO<T>, b: OperationIO<T>): boolean;
|
|
121
180
|
/**
|
|
122
181
|
* Less Than: Compare if the first value is less than the second.
|
|
182
|
+
*
|
|
183
|
+
* @category Math
|
|
123
184
|
*/
|
|
124
|
-
declare function lt<
|
|
185
|
+
declare function lt<T extends number>(a: OperationIO<T>, b: OperationIO<T>): boolean;
|
|
125
186
|
/**
|
|
126
187
|
* Less Than or Equal: Compare if the first value is less than or equal to the second.
|
|
188
|
+
*
|
|
189
|
+
* @category Math
|
|
190
|
+
*/
|
|
191
|
+
declare function lte<T extends number>(a: OperationIO<T>, b: OperationIO<T>): boolean;
|
|
192
|
+
/**
|
|
193
|
+
* Returns the sine of a number.
|
|
194
|
+
*
|
|
195
|
+
* @category Math
|
|
196
|
+
*/
|
|
197
|
+
declare function sin(angle: Radian): Unitless;
|
|
198
|
+
/**
|
|
199
|
+
* Returns the cosine of a number.
|
|
200
|
+
*
|
|
201
|
+
* @category Math
|
|
202
|
+
*/
|
|
203
|
+
declare function cos(angle: Radian): Unitless;
|
|
204
|
+
/**
|
|
205
|
+
* Returns the tangent of a number.
|
|
206
|
+
*
|
|
207
|
+
* @category Math
|
|
208
|
+
*/
|
|
209
|
+
declare function tan(angle: Radian): Unitless;
|
|
210
|
+
/**
|
|
211
|
+
* Returns the arcsine of a number.
|
|
212
|
+
*
|
|
213
|
+
* @category Math
|
|
214
|
+
*/
|
|
215
|
+
declare function asin(value: Unitless): Radian;
|
|
216
|
+
/**
|
|
217
|
+
* Returns the arc cosine (or inverse cosine) of a number.
|
|
218
|
+
*
|
|
219
|
+
* @category Math
|
|
220
|
+
*/
|
|
221
|
+
declare function acos(value: Unitless): Radian;
|
|
222
|
+
/**
|
|
223
|
+
* Returns the arctangent of a number.
|
|
224
|
+
*
|
|
225
|
+
* @category Math
|
|
226
|
+
*/
|
|
227
|
+
declare function atan(value: Unitless): Radian;
|
|
228
|
+
/**
|
|
229
|
+
* Returns the angle (in radians) from the X axis to a point.
|
|
230
|
+
*
|
|
231
|
+
* @category Math
|
|
232
|
+
* @param x - A number representing the cartesian x-coordinate.
|
|
233
|
+
* @param y - A number representing the cartesian y-coordinate.
|
|
234
|
+
*/
|
|
235
|
+
declare function atan2<T extends number>(x: T, y: T): Radian;
|
|
236
|
+
/**
|
|
237
|
+
* Returns the hyperbolic sine of a number.
|
|
238
|
+
*
|
|
239
|
+
* @category Math
|
|
240
|
+
*/
|
|
241
|
+
declare function sinh(angle: Radian): Unitless;
|
|
242
|
+
/**
|
|
243
|
+
* Returns the hyperbolic cosine of a number.
|
|
244
|
+
*
|
|
245
|
+
* @category Math
|
|
246
|
+
*/
|
|
247
|
+
declare function cosh(angle: Radian): Unitless;
|
|
248
|
+
/**
|
|
249
|
+
* Returns the hyperbolic tangent of a number.
|
|
250
|
+
*
|
|
251
|
+
* @category Math
|
|
252
|
+
*/
|
|
253
|
+
declare function tanh(angle: Radian): Unitless;
|
|
254
|
+
/**
|
|
255
|
+
* Returns the inverse hyperbolic sine of a number.
|
|
256
|
+
*
|
|
257
|
+
* @category Math
|
|
258
|
+
*/
|
|
259
|
+
declare function asinh(value: Unitless): Radian;
|
|
260
|
+
/**
|
|
261
|
+
* Returns the inverse hyperbolic cosine of a number.
|
|
262
|
+
*
|
|
263
|
+
* @category Math
|
|
264
|
+
*/
|
|
265
|
+
declare function acosh(value: Unitless): Radian;
|
|
266
|
+
/**
|
|
267
|
+
* Returns the inverse hyperbolic tangent of a number.
|
|
268
|
+
*
|
|
269
|
+
* @category Math
|
|
127
270
|
*/
|
|
128
|
-
declare function
|
|
271
|
+
declare function atanh(value: Unitless): Radian;
|
|
129
272
|
|
|
130
|
-
export { abs, add, ceil, div, eq, floor, gt, gte, inverse, lt, lte, max, min, mod, modSafe, mul, negate, pow, round, sqrt, sub, sum };
|
|
273
|
+
export { abs, acos, acosh, add, asin, asinh, atan, atan2, atanh, ceil, cos, cosh, div, eq, floor, gt, gte, inverse, lt, lte, max, min, mod, modSafe, mul, negate, pow, round, sin, sinh, sqrt, sub, sum, tan, tanh };
|
package/dist/functions.d.mts
CHANGED
|
@@ -1,26 +1,42 @@
|
|
|
1
|
-
import { Multiply, Divide, Inverse, UnknownUnit, DivideUnitExponents } from './
|
|
2
|
-
import {
|
|
1
|
+
import { M as Multiply, D as Divide, I as Inverse, U as UnknownUnit, a as Unit, b as UnknownAbstractUnit, A as AbstractUnit, c as DivideUnitExponents } from './_index.mjs';
|
|
2
|
+
import { R as Radian } from './_angle-plane.mjs';
|
|
3
|
+
import { U as Unitless } from './_identity.mjs';
|
|
3
4
|
|
|
4
|
-
type OperationIO<T extends number> = T extends UnknownUnit ? T : number;
|
|
5
5
|
/**
|
|
6
|
-
*
|
|
6
|
+
* @module uom-types/functions
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
type OperationIO<T extends number> = [T] extends [
|
|
10
|
+
UnknownUnit | UnknownAbstractUnit
|
|
11
|
+
] ? T : number;
|
|
12
|
+
/**
|
|
13
|
+
* Add two values with the same units together.
|
|
14
|
+
*
|
|
15
|
+
* @category Math
|
|
7
16
|
*/
|
|
8
17
|
declare function add<T extends number>(a: OperationIO<T>, b: OperationIO<T>): OperationIO<T>;
|
|
9
18
|
/**
|
|
10
|
-
* Subtract one value from another.
|
|
19
|
+
* Subtract one value from another with the same units.
|
|
20
|
+
*
|
|
21
|
+
* @category Math
|
|
11
22
|
*/
|
|
12
23
|
declare function sub<T extends number>(a: OperationIO<T>, b: OperationIO<T>): OperationIO<T>;
|
|
13
24
|
/**
|
|
14
25
|
* Multiple two values together.
|
|
26
|
+
*
|
|
27
|
+
* @category Math
|
|
15
28
|
*/
|
|
16
|
-
declare function mul<A extends number, B extends number>(a:
|
|
29
|
+
declare function mul<A extends number, B extends number>(a: A, b: B): Multiply<A, B>;
|
|
17
30
|
/**
|
|
18
31
|
* Divide one value by another.
|
|
32
|
+
*
|
|
33
|
+
* @category Math
|
|
19
34
|
*/
|
|
20
|
-
declare function div<A extends number, B extends number>(a:
|
|
35
|
+
declare function div<A extends number, B extends number>(a: A, b: B): Divide<A, B>;
|
|
21
36
|
/**
|
|
22
37
|
* Modulo operator.
|
|
23
38
|
*
|
|
39
|
+
* @category Math
|
|
24
40
|
* @param a - Must be an integer.
|
|
25
41
|
* @param b - Must be an integer.
|
|
26
42
|
* @returns `a % b`
|
|
@@ -29,6 +45,7 @@ declare function mod<T extends number>(a: OperationIO<T>, b: OperationIO<T>): Op
|
|
|
29
45
|
/**
|
|
30
46
|
* Perform mathematic modular arithmetic.
|
|
31
47
|
*
|
|
48
|
+
* @category Math
|
|
32
49
|
* @param a - Must be an integer.
|
|
33
50
|
* @param b - Must be a positive integer.
|
|
34
51
|
* @returns An integer between zero (inclusive) and `b` (exclusive).
|
|
@@ -36,95 +53,221 @@ declare function mod<T extends number>(a: OperationIO<T>, b: OperationIO<T>): Op
|
|
|
36
53
|
declare function modSafe<T extends number>(a: OperationIO<T>, b: OperationIO<T>): OperationIO<T>;
|
|
37
54
|
/**
|
|
38
55
|
* Put a number to the power of -1.
|
|
56
|
+
*
|
|
57
|
+
* @category Math
|
|
39
58
|
*/
|
|
40
|
-
declare function pow<B extends number>(base:
|
|
59
|
+
declare function pow<B extends number>(base: B, exponent: -1): Inverse<B>;
|
|
41
60
|
/**
|
|
42
61
|
* Put a number to the power of 0.
|
|
62
|
+
*
|
|
63
|
+
* @category Math
|
|
43
64
|
*/
|
|
44
|
-
declare function pow<B extends number>(base:
|
|
65
|
+
declare function pow<B extends number>(base: B, exponent: 0): B extends UnknownUnit ? Unit<{}> : B extends UnknownAbstractUnit ? AbstractUnit<{}> : 1;
|
|
45
66
|
/**
|
|
46
67
|
* Put a number to the power of 1/2.
|
|
68
|
+
*
|
|
69
|
+
* @category Math
|
|
47
70
|
*/
|
|
48
|
-
declare function pow<B extends number>(base:
|
|
71
|
+
declare function pow<B extends number>(base: B, exponent: 0.5): DivideUnitExponents<B, 2>;
|
|
49
72
|
/**
|
|
50
73
|
* Put a number to the power of 1.
|
|
74
|
+
*
|
|
75
|
+
* @category Math
|
|
51
76
|
*/
|
|
52
|
-
declare function pow<E extends number>(base:
|
|
77
|
+
declare function pow<E extends number>(base: E, exponent: 1): E;
|
|
53
78
|
/**
|
|
54
79
|
* Put a number to the power of 2.
|
|
80
|
+
*
|
|
81
|
+
* @category Math
|
|
55
82
|
*/
|
|
56
|
-
declare function pow<B extends number>(base:
|
|
83
|
+
declare function pow<B extends number>(base: B, exponent: 2): Multiply<B, B>;
|
|
57
84
|
/**
|
|
58
85
|
* Put a number to the power of 3.
|
|
86
|
+
*
|
|
87
|
+
* @category Math
|
|
59
88
|
*/
|
|
60
|
-
declare function pow<B extends number>(base:
|
|
89
|
+
declare function pow<B extends number>(base: B, exponent: 3): Multiply<B, Multiply<B, B>>;
|
|
61
90
|
/**
|
|
62
91
|
* Put a number to the power of 4.
|
|
92
|
+
*
|
|
93
|
+
* @category Math
|
|
63
94
|
*/
|
|
64
|
-
declare function pow<B extends number>(base:
|
|
95
|
+
declare function pow<B extends number>(base: B, exponent: 4): Multiply<B, Multiply<B, Multiply<B, B>>>;
|
|
65
96
|
/**
|
|
66
97
|
* Put one number to the power of the other.
|
|
98
|
+
*
|
|
99
|
+
* @category Math
|
|
67
100
|
*/
|
|
68
|
-
declare function pow<B extends number, E extends number>(base:
|
|
101
|
+
declare function pow<B extends number, E extends number>(base: B, exponent: E extends UnknownUnit ? never : E extends UnknownAbstractUnit ? never : E): number;
|
|
69
102
|
/**
|
|
70
103
|
* Take the square root of the given value.
|
|
104
|
+
*
|
|
105
|
+
* @category Math
|
|
71
106
|
*/
|
|
72
|
-
declare function sqrt<T extends number>(value:
|
|
107
|
+
declare function sqrt<T extends number>(value: T): DivideUnitExponents<T, 2>;
|
|
73
108
|
/**
|
|
74
109
|
* Inverse the given value.
|
|
110
|
+
*
|
|
111
|
+
* @category Math
|
|
75
112
|
*/
|
|
76
|
-
declare function inverse<T extends number>(value:
|
|
113
|
+
declare function inverse<T extends number>(value: T): Inverse<T>;
|
|
77
114
|
/**
|
|
78
|
-
*
|
|
115
|
+
* Returns the negative of the given value.
|
|
116
|
+
*
|
|
117
|
+
* @category Math
|
|
79
118
|
*/
|
|
80
119
|
declare function negate<T extends number>(value: OperationIO<T>): OperationIO<T>;
|
|
81
120
|
/**
|
|
82
|
-
* Returns the absolute value of
|
|
121
|
+
* Returns the absolute value of the given value.
|
|
122
|
+
*
|
|
123
|
+
* @category Math
|
|
83
124
|
*/
|
|
84
125
|
declare function abs<T extends number>(value: OperationIO<T>): OperationIO<T>;
|
|
85
126
|
/**
|
|
86
127
|
* Returns the greatest integer less than or equal to the given value.
|
|
128
|
+
*
|
|
129
|
+
* @category Math
|
|
87
130
|
*/
|
|
88
131
|
declare function floor<T extends number>(value: OperationIO<T>): OperationIO<T>;
|
|
89
132
|
/**
|
|
90
133
|
* Returns the smallest integer greater than or equal the given value.
|
|
134
|
+
*
|
|
135
|
+
* @category Math
|
|
91
136
|
*/
|
|
92
137
|
declare function ceil<T extends number>(value: OperationIO<T>): OperationIO<T>;
|
|
93
138
|
/**
|
|
94
139
|
* Returns the given value rounded to the nearest integer.
|
|
140
|
+
*
|
|
141
|
+
* @category Math
|
|
95
142
|
*/
|
|
96
143
|
declare function round<T extends number>(value: OperationIO<T>): OperationIO<T>;
|
|
97
144
|
/**
|
|
98
145
|
* Returns the larger value in the given collection.
|
|
146
|
+
*
|
|
147
|
+
* @category Math
|
|
99
148
|
*/
|
|
100
149
|
declare function max<T extends number>(values: Iterable<T>): OperationIO<T>;
|
|
101
150
|
/**
|
|
102
151
|
* Returns the smallest value in the given collection.
|
|
152
|
+
*
|
|
153
|
+
* @category Math
|
|
103
154
|
*/
|
|
104
155
|
declare function min<T extends number>(values: Iterable<T>): OperationIO<T>;
|
|
105
156
|
/**
|
|
106
157
|
* Takes the sum of all the values in the given collection.
|
|
158
|
+
*
|
|
159
|
+
* @category Math
|
|
107
160
|
*/
|
|
108
|
-
declare function sum<T extends number>(values:
|
|
161
|
+
declare function sum<T extends number>(values: Iterable<T>): OperationIO<T>;
|
|
109
162
|
/**
|
|
110
163
|
* Equal: Compare if two values are equal.
|
|
164
|
+
*
|
|
165
|
+
* @category Math
|
|
111
166
|
*/
|
|
112
|
-
declare function eq<
|
|
167
|
+
declare function eq<T extends number>(a: OperationIO<T>, b: OperationIO<T>): boolean;
|
|
113
168
|
/**
|
|
114
169
|
* Greater Than: Compare if the first value is greater than the second.
|
|
170
|
+
*
|
|
171
|
+
* @category Math
|
|
115
172
|
*/
|
|
116
|
-
declare function gt<
|
|
173
|
+
declare function gt<T extends number>(a: OperationIO<T>, b: OperationIO<T>): boolean;
|
|
117
174
|
/**
|
|
118
175
|
* Greater Than or Equal: Compare if the first value is greater than or equal to the second.
|
|
176
|
+
*
|
|
177
|
+
* @category Math
|
|
119
178
|
*/
|
|
120
|
-
declare function gte<
|
|
179
|
+
declare function gte<T extends number>(a: OperationIO<T>, b: OperationIO<T>): boolean;
|
|
121
180
|
/**
|
|
122
181
|
* Less Than: Compare if the first value is less than the second.
|
|
182
|
+
*
|
|
183
|
+
* @category Math
|
|
123
184
|
*/
|
|
124
|
-
declare function lt<
|
|
185
|
+
declare function lt<T extends number>(a: OperationIO<T>, b: OperationIO<T>): boolean;
|
|
125
186
|
/**
|
|
126
187
|
* Less Than or Equal: Compare if the first value is less than or equal to the second.
|
|
188
|
+
*
|
|
189
|
+
* @category Math
|
|
190
|
+
*/
|
|
191
|
+
declare function lte<T extends number>(a: OperationIO<T>, b: OperationIO<T>): boolean;
|
|
192
|
+
/**
|
|
193
|
+
* Returns the sine of a number.
|
|
194
|
+
*
|
|
195
|
+
* @category Math
|
|
196
|
+
*/
|
|
197
|
+
declare function sin(angle: Radian): Unitless;
|
|
198
|
+
/**
|
|
199
|
+
* Returns the cosine of a number.
|
|
200
|
+
*
|
|
201
|
+
* @category Math
|
|
202
|
+
*/
|
|
203
|
+
declare function cos(angle: Radian): Unitless;
|
|
204
|
+
/**
|
|
205
|
+
* Returns the tangent of a number.
|
|
206
|
+
*
|
|
207
|
+
* @category Math
|
|
208
|
+
*/
|
|
209
|
+
declare function tan(angle: Radian): Unitless;
|
|
210
|
+
/**
|
|
211
|
+
* Returns the arcsine of a number.
|
|
212
|
+
*
|
|
213
|
+
* @category Math
|
|
214
|
+
*/
|
|
215
|
+
declare function asin(value: Unitless): Radian;
|
|
216
|
+
/**
|
|
217
|
+
* Returns the arc cosine (or inverse cosine) of a number.
|
|
218
|
+
*
|
|
219
|
+
* @category Math
|
|
220
|
+
*/
|
|
221
|
+
declare function acos(value: Unitless): Radian;
|
|
222
|
+
/**
|
|
223
|
+
* Returns the arctangent of a number.
|
|
224
|
+
*
|
|
225
|
+
* @category Math
|
|
226
|
+
*/
|
|
227
|
+
declare function atan(value: Unitless): Radian;
|
|
228
|
+
/**
|
|
229
|
+
* Returns the angle (in radians) from the X axis to a point.
|
|
230
|
+
*
|
|
231
|
+
* @category Math
|
|
232
|
+
* @param x - A number representing the cartesian x-coordinate.
|
|
233
|
+
* @param y - A number representing the cartesian y-coordinate.
|
|
234
|
+
*/
|
|
235
|
+
declare function atan2<T extends number>(x: T, y: T): Radian;
|
|
236
|
+
/**
|
|
237
|
+
* Returns the hyperbolic sine of a number.
|
|
238
|
+
*
|
|
239
|
+
* @category Math
|
|
240
|
+
*/
|
|
241
|
+
declare function sinh(angle: Radian): Unitless;
|
|
242
|
+
/**
|
|
243
|
+
* Returns the hyperbolic cosine of a number.
|
|
244
|
+
*
|
|
245
|
+
* @category Math
|
|
246
|
+
*/
|
|
247
|
+
declare function cosh(angle: Radian): Unitless;
|
|
248
|
+
/**
|
|
249
|
+
* Returns the hyperbolic tangent of a number.
|
|
250
|
+
*
|
|
251
|
+
* @category Math
|
|
252
|
+
*/
|
|
253
|
+
declare function tanh(angle: Radian): Unitless;
|
|
254
|
+
/**
|
|
255
|
+
* Returns the inverse hyperbolic sine of a number.
|
|
256
|
+
*
|
|
257
|
+
* @category Math
|
|
258
|
+
*/
|
|
259
|
+
declare function asinh(value: Unitless): Radian;
|
|
260
|
+
/**
|
|
261
|
+
* Returns the inverse hyperbolic cosine of a number.
|
|
262
|
+
*
|
|
263
|
+
* @category Math
|
|
264
|
+
*/
|
|
265
|
+
declare function acosh(value: Unitless): Radian;
|
|
266
|
+
/**
|
|
267
|
+
* Returns the inverse hyperbolic tangent of a number.
|
|
268
|
+
*
|
|
269
|
+
* @category Math
|
|
127
270
|
*/
|
|
128
|
-
declare function
|
|
271
|
+
declare function atanh(value: Unitless): Radian;
|
|
129
272
|
|
|
130
|
-
export { abs, add, ceil, div, eq, floor, gt, gte, inverse, lt, lte, max, min, mod, modSafe, mul, negate, pow, round, sqrt, sub, sum };
|
|
273
|
+
export { abs, acos, acosh, add, asin, asinh, atan, atan2, atanh, ceil, cos, cosh, div, eq, floor, gt, gte, inverse, lt, lte, max, min, mod, modSafe, mul, negate, pow, round, sin, sinh, sqrt, sub, sum, tan, tanh };
|