toosoon-utils 1.1.0 → 1.3.0

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/lib/maths.d.ts CHANGED
@@ -30,10 +30,10 @@ export declare function toPowerOf2(value: number, mode?: 'floor' | 'ceil' | 'rou
30
30
  /**
31
31
  * Return the sign (positive or negative) of a number
32
32
  *
33
- * @param {number} number Value to check
33
+ * @param {number} value Value to check
34
34
  * @returns {number} 1 if the given number is positive, -1 if it is negative, otherwise 0
35
35
  */
36
- export declare function sign(number: number): number;
36
+ export declare function sign(value: number): number;
37
37
  /**
38
38
  * Clamp a value between two bounds
39
39
  *
@@ -65,12 +65,14 @@ export declare function triLerp(value: number, min: number, max: number, target:
65
65
  /**
66
66
  * Exponential interpolation between two values
67
67
  *
68
- * @param {number} value Normalized value to interpolate
69
- * @param {number} min Minimum value
70
- * @param {number} max Maximum value
68
+ * @param {number} value Value to interpolate
69
+ * @param {number} currentMin Lower bound of the value's current range
70
+ * @param {number} currentMax Upper bound of the value's current range
71
+ * @param {number} targetMin Lower bound of the value's target range
72
+ * @param {number} targetMax Upper bound of the value's target range
71
73
  * @returns {number} Interpolated value
72
74
  */
73
- export declare function expLerp(value: number, min: number, max: number): number;
75
+ export declare function expLerp(value: number, currentMin: number, currentMax: number, targetMin: number, targetMax: number): number;
74
76
  /**
75
77
  * Normalize a value between two bounds
76
78
  *
@@ -95,7 +97,7 @@ export declare function map(value: number, currentMin: number, currentMax: numbe
95
97
  * Round a number up to a nearest multiple
96
98
  *
97
99
  * @param {number} value Value to round
98
- * @param {number} [multiple=1] Multiple
100
+ * @param {number} [multiple=1] Multiple to round to
99
101
  * @returns {number} Closest multiple
100
102
  */
101
103
  export declare function roundTo(value: number, multiple?: number): number;
@@ -136,14 +138,14 @@ export declare function parabola(x: number, power?: number): number;
136
138
  /**
137
139
  * Return the sum of numbers
138
140
  *
139
- * @param {number[]} array Array of number
141
+ * @param {number[]} array Array of numbers
140
142
  * @returns {number} Total sum
141
143
  */
142
144
  export declare function sum(array: number[]): number;
143
145
  /**
144
146
  * Return the average of numbers
145
147
  *
146
- * @param {number[]} array Array of number
148
+ * @param {number[]} array Array of numbers
147
149
  * @returns {number} Total average
148
150
  */
149
151
  export declare function average(array: number[]): number;
package/lib/maths.js CHANGED
@@ -1,36 +1,30 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.damp = exports.average = exports.sum = exports.parabola = exports.smoothstep = exports.pingPong = exports.modAbs = exports.roundTo = exports.map = exports.normalize = exports.expLerp = exports.triLerp = exports.lerp = exports.clamp = exports.sign = exports.toPowerOf2 = exports.isPowerOf2 = exports.isOdd = exports.isEven = void 0;
4
1
  /**
5
2
  * Check if a number is even
6
3
  *
7
4
  * @param {number} value Value to check
8
5
  * @returns {boolean} True if the given number is even, false otherwise
9
6
  */
10
- function isEven(value) {
7
+ export function isEven(value) {
11
8
  return !(value & 1);
12
9
  }
13
- exports.isEven = isEven;
14
10
  /**
15
11
  * Check if a number is odd
16
12
  *
17
13
  * @param {number} value Value to check
18
14
  * @returns {boolean} True if the given number is odd, false otherwise
19
15
  */
20
- function isOdd(value) {
16
+ export function isOdd(value) {
21
17
  return !!(value & 1);
22
18
  }
23
- exports.isOdd = isOdd;
24
19
  /**
25
20
  * Check if a number is a power of 2
26
21
  *
27
22
  * @param {number} value Value to check
28
23
  * @returns {boolean} True if the given number is a power of 2, false otherwise
29
24
  */
30
- function isPowerOf2(value) {
25
+ export function isPowerOf2(value) {
31
26
  return (value & (value - 1)) === 0;
32
27
  }
33
- exports.isPowerOf2 = isPowerOf2;
34
28
  /**
35
29
  * Find closest power of 2 that fits a number
36
30
  *
@@ -38,25 +32,23 @@ exports.isPowerOf2 = isPowerOf2;
38
32
  * @param {string} [mode='ceil'] Can be 'floor' | 'ceil' | 'round'
39
33
  * @returns {number} Power of 2
40
34
  */
41
- function toPowerOf2(value, mode) {
35
+ export function toPowerOf2(value, mode) {
42
36
  if (mode === void 0) { mode = 'ceil'; }
43
37
  return Math.pow(2, Math[mode](Math.log(value) / Math.log(2)));
44
38
  }
45
- exports.toPowerOf2 = toPowerOf2;
46
39
  /**
47
40
  * Return the sign (positive or negative) of a number
48
41
  *
49
- * @param {number} number Value to check
42
+ * @param {number} value Value to check
50
43
  * @returns {number} 1 if the given number is positive, -1 if it is negative, otherwise 0
51
44
  */
52
- function sign(number) {
53
- if (number > 0)
45
+ export function sign(value) {
46
+ if (value > 0)
54
47
  return 1;
55
- else if (number < 0)
48
+ else if (value < 0)
56
49
  return -1;
57
50
  return 0;
58
51
  }
59
- exports.sign = sign;
60
52
  /**
61
53
  * Clamp a value between two bounds
62
54
  *
@@ -65,12 +57,11 @@ exports.sign = sign;
65
57
  * @param {number} [max=1] Maximum boundary
66
58
  * @returns {number} Clamped value
67
59
  */
68
- function clamp(value, min, max) {
60
+ export function clamp(value, min, max) {
69
61
  if (min === void 0) { min = 0; }
70
62
  if (max === void 0) { max = 1; }
71
63
  return Math.min(max, Math.max(min, value));
72
64
  }
73
- exports.clamp = clamp;
74
65
  /**
75
66
  * Linear interpolation between two values (lerping)
76
67
  *
@@ -79,10 +70,9 @@ exports.clamp = clamp;
79
70
  * @param {number} max Maximum value
80
71
  * @returns {number} Lerped value
81
72
  */
82
- function lerp(value, min, max) {
73
+ export function lerp(value, min, max) {
83
74
  return min + (max - min) * value;
84
75
  }
85
- exports.lerp = lerp;
86
76
  /**
87
77
  * Triangular interpolation between two values
88
78
  *
@@ -92,23 +82,24 @@ exports.lerp = lerp;
92
82
  * @param {number} target Triangle target value
93
83
  * @returns {number} Interpolated value
94
84
  */
95
- function triLerp(value, min, max, target) {
85
+ export function triLerp(value, min, max, target) {
96
86
  var x = Math.pow(1 + Math.abs(target - max) / Math.abs(target - min), -1);
97
87
  return value <= x ? min - (min - target) * (value / x) : target - (target - max) * ((value - x) / (1 - x));
98
88
  }
99
- exports.triLerp = triLerp;
100
89
  /**
101
90
  * Exponential interpolation between two values
102
91
  *
103
- * @param {number} value Normalized value to interpolate
104
- * @param {number} min Minimum value
105
- * @param {number} max Maximum value
92
+ * @param {number} value Value to interpolate
93
+ * @param {number} currentMin Lower bound of the value's current range
94
+ * @param {number} currentMax Upper bound of the value's current range
95
+ * @param {number} targetMin Lower bound of the value's target range
96
+ * @param {number} targetMax Upper bound of the value's target range
106
97
  * @returns {number} Interpolated value
107
98
  */
108
- function expLerp(value, min, max) {
109
- return Math.pow(min, 1 - value) * Math.pow(max, value);
99
+ export function expLerp(value, currentMin, currentMax, targetMin, targetMax) {
100
+ return (targetMin *
101
+ Math.pow(targetMax / targetMin, (clamp(value, currentMin, currentMax) - currentMin) / (currentMax - currentMin)));
110
102
  }
111
- exports.expLerp = expLerp;
112
103
  /**
113
104
  * Normalize a value between two bounds
114
105
  *
@@ -117,10 +108,9 @@ exports.expLerp = expLerp;
117
108
  * @param {number} max Maximum boundary
118
109
  * @returns {number} Normalized value
119
110
  */
120
- function normalize(value, min, max) {
111
+ export function normalize(value, min, max) {
121
112
  return (value - min) / (max - min);
122
113
  }
123
- exports.normalize = normalize;
124
114
  /**
125
115
  * Re-map a number from one range to another
126
116
  *
@@ -131,24 +121,22 @@ exports.normalize = normalize;
131
121
  * @param {number} targetMax Upper bound of the value's target range
132
122
  * @returns {number} Re-mapped value
133
123
  */
134
- function map(value, currentMin, currentMax, targetMin, targetMax) {
124
+ export function map(value, currentMin, currentMax, targetMin, targetMax) {
135
125
  return ((value - currentMin) / (currentMax - currentMin)) * (targetMax - targetMin) + targetMin;
136
126
  }
137
- exports.map = map;
138
127
  /**
139
128
  * Round a number up to a nearest multiple
140
129
  *
141
130
  * @param {number} value Value to round
142
- * @param {number} [multiple=1] Multiple
131
+ * @param {number} [multiple=1] Multiple to round to
143
132
  * @returns {number} Closest multiple
144
133
  */
145
- function roundTo(value, multiple) {
134
+ export function roundTo(value, multiple) {
146
135
  if (multiple === void 0) { multiple = 1; }
147
136
  if (multiple === 0)
148
137
  return value;
149
138
  return Math.round(value / multiple) * multiple;
150
139
  }
151
- exports.roundTo = roundTo;
152
140
  /**
153
141
  * Modulo absolute a value based on a length
154
142
  *
@@ -156,13 +144,12 @@ exports.roundTo = roundTo;
156
144
  * @param {number} length Total length
157
145
  * @returns {number} Modulated value
158
146
  */
159
- function modAbs(value, length) {
147
+ export function modAbs(value, length) {
160
148
  if (value < 0) {
161
149
  return length + (value % length);
162
150
  }
163
151
  return value % length;
164
152
  }
165
- exports.modAbs = modAbs;
166
153
  /**
167
154
  * Move back and forth a value between 0 and length, so that it is never larger than length and never smaller than 0
168
155
  *
@@ -170,11 +157,10 @@ exports.modAbs = modAbs;
170
157
  * @param {number} length Total length
171
158
  * @returns {number} PingPonged value
172
159
  */
173
- function pingPong(value, length) {
160
+ export function pingPong(value, length) {
174
161
  value = modAbs(value, length * 2);
175
162
  return length - Math.abs(value - length);
176
163
  }
177
- exports.pingPong = pingPong;
178
164
  /**
179
165
  * Smooth a value using cubic Hermite interpolation
180
166
  *
@@ -183,13 +169,12 @@ exports.pingPong = pingPong;
183
169
  * @param {number} [max=1] Maximum boundary
184
170
  * @returns {number} Normalized smoothed value
185
171
  */
186
- function smoothstep(value, min, max) {
172
+ export function smoothstep(value, min, max) {
187
173
  if (min === void 0) { min = 0; }
188
174
  if (max === void 0) { max = 1; }
189
175
  var x = clamp(normalize(value, min, max));
190
176
  return x * x * (3 - 2 * x);
191
177
  }
192
- exports.smoothstep = smoothstep;
193
178
  /**
194
179
  * Re-map the [0, 1] interval into [0, 1] parabola, such that corners are remaped to 0 and the center to 1
195
180
  * -> parabola(0) = parabola(1) = 0, and parabola(0.5) = 1
@@ -198,31 +183,28 @@ exports.smoothstep = smoothstep;
198
183
  * @param {number} [power=1] Parabola power
199
184
  * @returns {number} Normalized re-mapped value
200
185
  */
201
- function parabola(x, power) {
186
+ export function parabola(x, power) {
202
187
  if (power === void 0) { power = 1; }
203
188
  return Math.pow(4 * x * (1 - x), power);
204
189
  }
205
- exports.parabola = parabola;
206
190
  /**
207
191
  * Return the sum of numbers
208
192
  *
209
- * @param {number[]} array Array of number
193
+ * @param {number[]} array Array of numbers
210
194
  * @returns {number} Total sum
211
195
  */
212
- function sum(array) {
196
+ export function sum(array) {
213
197
  return array.reduce(function (previous, current) { return previous + current; });
214
198
  }
215
- exports.sum = sum;
216
199
  /**
217
200
  * Return the average of numbers
218
201
  *
219
- * @param {number[]} array Array of number
202
+ * @param {number[]} array Array of numbers
220
203
  * @returns {number} Total average
221
204
  */
222
- function average(array) {
205
+ export function average(array) {
223
206
  return sum(array) / array.length;
224
207
  }
225
- exports.average = average;
226
208
  /**
227
209
  * Smoothly interpolate a number toward another
228
210
  *
@@ -232,7 +214,6 @@ exports.average = average;
232
214
  * @param {number} delta Delta time (in seconds)
233
215
  * @returns {number} Interpolated number
234
216
  */
235
- function damp(value, target, damping, delta) {
217
+ export function damp(value, target, damping, delta) {
236
218
  return lerp(1 - Math.exp(-damping * delta), value, target);
237
219
  }
238
- exports.damp = damp;
package/lib/prng.d.ts ADDED
@@ -0,0 +1,45 @@
1
+ /**
2
+ * Produce a 128-bit hash value from a seed
3
+ *
4
+ * @param {string} seed Initial seed state
5
+ * @returns {[number, number, number, number]} Hash numbers
6
+ */
7
+ export declare function cyrb128(seed: string): [number, number, number, number];
8
+ /**
9
+ * Simple Fast Counter, Generator with a 128-bit state
10
+ *
11
+ * @param {number} a
12
+ * @param {number} b
13
+ * @param {number} c
14
+ * @param {number} d
15
+ * @returns {number} Pseudo-random number
16
+ */
17
+ export declare function sfc32(a: number, b: number, c: number, d: number): number;
18
+ /**
19
+ * SplitMix32, Generator with a 32-bit state
20
+ *
21
+ * @param {number} a
22
+ * @returns {number} Pseudo-random number
23
+ */
24
+ export declare function splitmix32(a: number): number;
25
+ /**
26
+ * Mulberry32, Generator with a 32-bit state
27
+ *
28
+ * @param {number} a
29
+ * @returns {number} Pseudo-random number
30
+ */
31
+ export declare function mulberry32(a: number): number;
32
+ /**
33
+ * Jenkins' Small Fast, Generator with a 32-bit state
34
+ *
35
+ * @param {number} a
36
+ * @returns {number} Pseudo-random number
37
+ */
38
+ export declare function jsf32(a: number, b: number, c: number, d: number): number;
39
+ /**
40
+ * xoshiro128**, Generator with a 128-bit state
41
+ *
42
+ * @param {number} a
43
+ * @returns {number} Pseudo-random number
44
+ */
45
+ export declare function xoshiro128ss(a: number, b: number, c: number, d: number): number;
package/lib/prng.js ADDED
@@ -0,0 +1,113 @@
1
+ /**
2
+ * Produce a 128-bit hash value from a seed
3
+ *
4
+ * @param {string} seed Initial seed state
5
+ * @returns {[number, number, number, number]} Hash numbers
6
+ */
7
+ export function cyrb128(seed) {
8
+ var h1 = 1779033703;
9
+ var h2 = 3144134277;
10
+ var h3 = 1013904242;
11
+ var h4 = 2773480762;
12
+ for (var i = 0, k = void 0; i < seed.length; i++) {
13
+ k = seed.charCodeAt(i);
14
+ h1 = h2 ^ Math.imul(h1 ^ k, 597399067);
15
+ h2 = h3 ^ Math.imul(h2 ^ k, 2869860233);
16
+ h3 = h4 ^ Math.imul(h3 ^ k, 951274213);
17
+ h4 = h1 ^ Math.imul(h4 ^ k, 2716044179);
18
+ }
19
+ h1 = Math.imul(h3 ^ (h1 >>> 18), 597399067);
20
+ h2 = Math.imul(h4 ^ (h2 >>> 22), 2869860233);
21
+ h3 = Math.imul(h1 ^ (h3 >>> 17), 951274213);
22
+ h4 = Math.imul(h2 ^ (h4 >>> 19), 2716044179);
23
+ return [(h1 ^ h2 ^ h3 ^ h4) >>> 0, (h2 ^ h1) >>> 0, (h3 ^ h1) >>> 0, (h4 ^ h1) >>> 0];
24
+ }
25
+ // *********************
26
+ // PRNG Algorithms
27
+ // *********************
28
+ /**
29
+ * Simple Fast Counter, Generator with a 128-bit state
30
+ *
31
+ * @param {number} a
32
+ * @param {number} b
33
+ * @param {number} c
34
+ * @param {number} d
35
+ * @returns {number} Pseudo-random number
36
+ */
37
+ export function sfc32(a, b, c, d) {
38
+ a >>>= 0;
39
+ b >>>= 0;
40
+ c >>>= 0;
41
+ d >>>= 0;
42
+ var t = (a + b) | 0;
43
+ a = b ^ (b >>> 9);
44
+ b = (c + (c << 3)) | 0;
45
+ c = (c << 21) | (c >>> 11);
46
+ d = (d + 1) | 0;
47
+ t = (t + d) | 0;
48
+ c = (c + t) | 0;
49
+ return (t >>> 0) / 4294967296;
50
+ }
51
+ /**
52
+ * SplitMix32, Generator with a 32-bit state
53
+ *
54
+ * @param {number} a
55
+ * @returns {number} Pseudo-random number
56
+ */
57
+ export function splitmix32(a) {
58
+ a |= 0;
59
+ a = (a + 0x9e3779b9) | 0;
60
+ var t = a ^ (a >>> 16);
61
+ t = Math.imul(t, 0x21f0aaad);
62
+ t = t ^ (t >>> 15);
63
+ t = Math.imul(t, 0x735a2d97);
64
+ return ((t = t ^ (t >>> 15)) >>> 0) / 4294967296;
65
+ }
66
+ /**
67
+ * Mulberry32, Generator with a 32-bit state
68
+ *
69
+ * @param {number} a
70
+ * @returns {number} Pseudo-random number
71
+ */
72
+ export function mulberry32(a) {
73
+ var t = (a += 0x6d2b79f5);
74
+ t = Math.imul(t ^ (t >>> 15), t | 1);
75
+ t ^= t + Math.imul(t ^ (t >>> 7), t | 61);
76
+ return ((t ^ (t >>> 14)) >>> 0) / 4294967296;
77
+ }
78
+ /**
79
+ * Jenkins' Small Fast, Generator with a 32-bit state
80
+ *
81
+ * @param {number} a
82
+ * @returns {number} Pseudo-random number
83
+ */
84
+ export function jsf32(a, b, c, d) {
85
+ a |= 0;
86
+ b |= 0;
87
+ c |= 0;
88
+ d |= 0;
89
+ var t = (a - ((b << 27) | (b >>> 5))) | 0;
90
+ a = b ^ ((c << 17) | (c >>> 15));
91
+ b = (c + d) | 0;
92
+ c = (d + t) | 0;
93
+ d = (a + t) | 0;
94
+ return (d >>> 0) / 4294967296;
95
+ }
96
+ /**
97
+ * xoshiro128**, Generator with a 128-bit state
98
+ *
99
+ * @param {number} a
100
+ * @returns {number} Pseudo-random number
101
+ */
102
+ export function xoshiro128ss(a, b, c, d) {
103
+ var t = b << 9;
104
+ var r = a * 5;
105
+ r = ((r << 7) | (r >>> 25)) * 9;
106
+ c ^= a;
107
+ d ^= b;
108
+ b ^= c;
109
+ a ^= d;
110
+ c ^= t;
111
+ d = (d << 11) | (d >>> 21);
112
+ return (r >>> 0) / 4294967296;
113
+ }
package/lib/random.d.ts CHANGED
@@ -1,9 +1,9 @@
1
1
  import { Vector2, Vector3 } from './types';
2
2
  /**
3
- * Generate a random boolean (true or false)
3
+ * Generate a random boolean (`true` or `false`)
4
4
  *
5
- * @param {number} [probability=0.5] Probability to get true
6
- * @returns {boolean} Either true or false
5
+ * @param {number} [probability=0.5] Probability to get `true`
6
+ * @returns {boolean} Either `true` or `false`
7
7
  */
8
8
  export declare function randomBoolean(probability?: number): boolean;
9
9
  /**
@@ -14,16 +14,16 @@ export declare function randomBoolean(probability?: number): boolean;
14
14
  */
15
15
  export declare function randomSign(probability?: number): number;
16
16
  /**
17
- * Generate a random float number
17
+ * Generate a random floating-point number within a specified range
18
18
  *
19
- * @param {number} [min=0] Minimum boundary
20
- * @param {number} [max=1] Maximum boundary
21
- * @param {number} [precision=2] Number of digits after the decimal point
19
+ * @param {number} [min=0] Minimum boundary
20
+ * @param {number} [max=1] Maximum boundary
21
+ * @param {number} [precision=2] Number of digits after the decimal point
22
22
  * @returns {number} Generated float
23
23
  */
24
24
  export declare function randomFloat(min?: number, max?: number, precision?: number): number;
25
25
  /**
26
- * Generate a random integer number
26
+ * Generate a random integer number within a specified range
27
27
  *
28
28
  * @param {number} min Minimum boundary
29
29
  * @param {number} max Maximum boundary
@@ -33,61 +33,61 @@ export declare function randomInt(min: number, max: number): number;
33
33
  /**
34
34
  * Generate a random hexadecimal color
35
35
  *
36
- * @returns {string} Hexadecimal color
36
+ * @returns {string} Generated hexadecimal color
37
37
  */
38
38
  export declare function randomHexColor(): string;
39
39
  /**
40
- * Pick a random item from an array
40
+ * Pick a random item from a given array
41
41
  *
42
- * @param {T[]} [array=[]] Array to pick the item from
42
+ * @param {T[]} array Array to pick the item from
43
43
  * @returns {T|undefined} Random item picked
44
44
  */
45
- export declare function randomItem<T = unknown>(array?: T[]): T | undefined;
45
+ export declare function randomItem<T = unknown>(array: T[]): T | undefined;
46
46
  /**
47
- * Pick a random property from an object
47
+ * Pick a random property value from a given object
48
48
  *
49
49
  * @param {object} object Object to pick the property from
50
- * @returns {unknown|undefined} Random item picked
50
+ * @returns {T|undefined} Random item picked
51
51
  */
52
52
  export declare function randomObjectProperty<T = unknown>(object: {
53
53
  [key: string]: T;
54
54
  }): T | undefined;
55
55
  /**
56
- * Return a random index from an array of weights
56
+ * Select a random index from an array of weighted items
57
57
  *
58
58
  * @param {number[]} weights Array of weights
59
59
  * @returns {number} Random index based on weights
60
60
  */
61
- export declare function randomIndex(weights?: number[]): number;
61
+ export declare function randomIndex(weights: number[]): number;
62
62
  /**
63
63
  * Produce a random 2D point around the perimiter of a unit circle
64
64
  *
65
- * @param {number} [radius=1] Radius of the circle
66
- * @param {Vector2} target Target vector
65
+ * @param {number} [radius=1] Radius of the circle
66
+ * @param {Vector2} [target] Target vector
67
67
  * @returns {Vector2} Random 2D point on circle
68
68
  */
69
69
  export declare function onCircle(radius?: number, target?: Vector2): Vector2;
70
70
  /**
71
71
  * Produce a random 2D point inside a unit circle
72
72
  *
73
- * @param {number} [radius=1] Radius of the circle
74
- * @param {Vector2} target Target vector
73
+ * @param {number} [radius=1] Radius of the circle
74
+ * @param {Vector2} [target] Target vector
75
75
  * @returns {Vector2} Random 2D point inside circle
76
76
  */
77
77
  export declare function insideCircle(radius?: number, target?: Vector2): Vector2;
78
78
  /**
79
79
  * Produce a random 3D point on the surface of a unit sphere
80
80
  *
81
- * @param {number} [radius=1] Radius of the sphere
82
- * @param {Vector3} target Target vector
81
+ * @param {number} [radius=1] Radius of the sphere
82
+ * @param {Vector3} [target] Target vector
83
83
  * @returns {Vector3} Random 3D point on sphere
84
84
  */
85
85
  export declare function onSphere(radius?: number, target?: Vector3): Vector3;
86
86
  /**
87
87
  * Produce a random 3D point inside a unit sphere
88
88
  *
89
- * @param {number} [radius=1] Radius of the sphere
90
- * @param {Vector3} target Target vector
89
+ * @param {number} [radius=1] Radius of the sphere
90
+ * @param {Vector3} [target] Target vector
91
91
  * @returns {Vector3} Random 3D point inside sphere
92
92
  */
93
93
  export declare function insideSphere(radius?: number, target?: Vector3): Vector3;