@pawells/math-extended 1.1.1 → 3.0.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.
Files changed (113) hide show
  1. package/README.md +15 -21
  2. package/build/angles.d.ts +28 -18
  3. package/build/angles.d.ts.map +1 -1
  4. package/build/angles.js +28 -18
  5. package/build/angles.js.map +1 -1
  6. package/build/clamp.d.ts +2 -0
  7. package/build/clamp.d.ts.map +1 -1
  8. package/build/clamp.js +2 -0
  9. package/build/clamp.js.map +1 -1
  10. package/build/core.d.ts +23 -0
  11. package/build/core.d.ts.map +1 -0
  12. package/build/core.js +25 -0
  13. package/build/core.js.map +1 -0
  14. package/build/index.d.ts +1 -4
  15. package/build/index.d.ts.map +1 -1
  16. package/build/index.js +1 -6
  17. package/build/index.js.map +1 -1
  18. package/build/interpolation.d.ts +62 -13
  19. package/build/interpolation.d.ts.map +1 -1
  20. package/build/interpolation.js +66 -23
  21. package/build/interpolation.js.map +1 -1
  22. package/build/matrices/arithmetic.d.ts +65 -76
  23. package/build/matrices/arithmetic.d.ts.map +1 -1
  24. package/build/matrices/arithmetic.js +65 -107
  25. package/build/matrices/arithmetic.js.map +1 -1
  26. package/build/matrices/asserts.d.ts +26 -273
  27. package/build/matrices/asserts.d.ts.map +1 -1
  28. package/build/matrices/asserts.js +106 -350
  29. package/build/matrices/asserts.js.map +1 -1
  30. package/build/matrices/core.d.ts +150 -79
  31. package/build/matrices/core.d.ts.map +1 -1
  32. package/build/matrices/core.js +128 -104
  33. package/build/matrices/core.js.map +1 -1
  34. package/build/matrices/decompositions.d.ts +41 -44
  35. package/build/matrices/decompositions.d.ts.map +1 -1
  36. package/build/matrices/decompositions.js +51 -94
  37. package/build/matrices/decompositions.js.map +1 -1
  38. package/build/matrices/index.d.ts +2 -2
  39. package/build/matrices/index.d.ts.map +1 -1
  40. package/build/matrices/index.js +2 -2
  41. package/build/matrices/index.js.map +1 -1
  42. package/build/matrices/linear-algebra.d.ts +56 -19
  43. package/build/matrices/linear-algebra.d.ts.map +1 -1
  44. package/build/matrices/linear-algebra.js +80 -36
  45. package/build/matrices/linear-algebra.js.map +1 -1
  46. package/build/matrices/normalization.d.ts +36 -15
  47. package/build/matrices/normalization.d.ts.map +1 -1
  48. package/build/matrices/normalization.js +32 -23
  49. package/build/matrices/normalization.js.map +1 -1
  50. package/build/matrices/transformations.d.ts +39 -52
  51. package/build/matrices/transformations.d.ts.map +1 -1
  52. package/build/matrices/transformations.js +8 -11
  53. package/build/matrices/transformations.js.map +1 -1
  54. package/build/matrices/types.d.ts +39 -67
  55. package/build/matrices/types.d.ts.map +1 -1
  56. package/build/matrices/types.js +63 -1
  57. package/build/matrices/types.js.map +1 -1
  58. package/build/quaternions/asserts.d.ts +114 -15
  59. package/build/quaternions/asserts.d.ts.map +1 -1
  60. package/build/quaternions/asserts.js +189 -51
  61. package/build/quaternions/asserts.js.map +1 -1
  62. package/build/quaternions/conversions.d.ts +18 -8
  63. package/build/quaternions/conversions.d.ts.map +1 -1
  64. package/build/quaternions/conversions.js +14 -4
  65. package/build/quaternions/conversions.js.map +1 -1
  66. package/build/quaternions/core.d.ts +31 -2
  67. package/build/quaternions/core.d.ts.map +1 -1
  68. package/build/quaternions/core.js +32 -4
  69. package/build/quaternions/core.js.map +1 -1
  70. package/build/quaternions/index.d.ts +2 -2
  71. package/build/quaternions/index.d.ts.map +1 -1
  72. package/build/quaternions/index.js +3 -2
  73. package/build/quaternions/index.js.map +1 -1
  74. package/build/quaternions/interpolation.d.ts +7 -1
  75. package/build/quaternions/interpolation.d.ts.map +1 -1
  76. package/build/quaternions/interpolation.js +12 -6
  77. package/build/quaternions/interpolation.js.map +1 -1
  78. package/build/quaternions/predefined.d.ts +7 -1
  79. package/build/quaternions/predefined.d.ts.map +1 -1
  80. package/build/quaternions/predefined.js +6 -0
  81. package/build/quaternions/predefined.js.map +1 -1
  82. package/build/quaternions/types.d.ts +24 -13
  83. package/build/quaternions/types.d.ts.map +1 -1
  84. package/build/quaternions/types.js +51 -1
  85. package/build/quaternions/types.js.map +1 -1
  86. package/build/random.d.ts +66 -20
  87. package/build/random.d.ts.map +1 -1
  88. package/build/random.js +73 -20
  89. package/build/random.js.map +1 -1
  90. package/build/vectors/asserts.d.ts +33 -99
  91. package/build/vectors/asserts.d.ts.map +1 -1
  92. package/build/vectors/asserts.js +145 -181
  93. package/build/vectors/asserts.js.map +1 -1
  94. package/build/vectors/core.d.ts +76 -44
  95. package/build/vectors/core.d.ts.map +1 -1
  96. package/build/vectors/core.js +128 -119
  97. package/build/vectors/core.js.map +1 -1
  98. package/build/vectors/index.d.ts.map +1 -1
  99. package/build/vectors/index.js +1 -0
  100. package/build/vectors/index.js.map +1 -1
  101. package/build/vectors/interpolation.d.ts +13 -1
  102. package/build/vectors/interpolation.d.ts.map +1 -1
  103. package/build/vectors/interpolation.js +48 -47
  104. package/build/vectors/interpolation.js.map +1 -1
  105. package/build/vectors/predefined.d.ts +73 -25
  106. package/build/vectors/predefined.d.ts.map +1 -1
  107. package/build/vectors/predefined.js +62 -18
  108. package/build/vectors/predefined.js.map +1 -1
  109. package/build/vectors/types.d.ts +26 -4
  110. package/build/vectors/types.d.ts.map +1 -1
  111. package/build/vectors/types.js +50 -1
  112. package/build/vectors/types.js.map +1 -1
  113. package/package.json +4 -3
@@ -10,7 +10,9 @@ import { QuaternionFromAxisAngle } from './core.js';
10
10
  * @returns Quaternion representing rotation around X-axis
11
11
  *
12
12
  * @example
13
+ * ```typescript
13
14
  * const q = QuaternionRotationX(Math.PI / 2); // 90° rotation around X-axis
15
+ * ```
14
16
  */
15
17
  export function QuaternionRotationX(angle) {
16
18
  return QuaternionFromAxisAngle([1, 0, 0], angle);
@@ -22,7 +24,9 @@ export function QuaternionRotationX(angle) {
22
24
  * @returns Quaternion representing rotation around Y-axis
23
25
  *
24
26
  * @example
27
+ * ```typescript
25
28
  * const q = QuaternionRotationY(Math.PI / 4); // 45° rotation around Y-axis
29
+ * ```
26
30
  */
27
31
  export function QuaternionRotationY(angle) {
28
32
  return QuaternionFromAxisAngle([0, 1, 0], angle);
@@ -34,7 +38,9 @@ export function QuaternionRotationY(angle) {
34
38
  * @returns Quaternion representing rotation around Z-axis
35
39
  *
36
40
  * @example
41
+ * ```typescript
37
42
  * const q = QuaternionRotationZ(Math.PI); // 180° rotation around Z-axis
43
+ * ```
38
44
  */
39
45
  export function QuaternionRotationZ(angle) {
40
46
  return QuaternionFromAxisAngle([0, 0, 1], angle);
@@ -1 +1 @@
1
- {"version":3,"file":"predefined.js","sourceRoot":"","sources":["../../src/quaternions/predefined.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,uBAAuB,EAAE,MAAM,WAAW,CAAC;AAEpD;;;;;;;;GAQG;AACH,MAAM,UAAU,mBAAmB,CAAC,KAAa;IAChD,OAAO,uBAAuB,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC;AAClD,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,UAAU,mBAAmB,CAAC,KAAa;IAChD,OAAO,uBAAuB,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC;AAClD,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,UAAU,mBAAmB,CAAC,KAAa;IAChD,OAAO,uBAAuB,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC;AAClD,CAAC"}
1
+ {"version":3,"file":"predefined.js","sourceRoot":"","sources":["../../src/quaternions/predefined.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,uBAAuB,EAAE,MAAM,WAAW,CAAC;AAEpD;;;;;;;;;;GAUG;AACH,MAAM,UAAU,mBAAmB,CAAC,KAAa;IAChD,OAAO,uBAAuB,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC;AAClD,CAAC;AAED;;;;;;;;;;GAUG;AACH,MAAM,UAAU,mBAAmB,CAAC,KAAa;IAChD,OAAO,uBAAuB,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC;AAClD,CAAC;AAED;;;;;;;;;;GAUG;AACH,MAAM,UAAU,mBAAmB,CAAC,KAAa;IAChD,OAAO,uBAAuB,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC;AAClD,CAAC"}
@@ -3,8 +3,7 @@
3
3
  * Quaternions provide a mathematically robust way to represent rotations in 3D space,
4
4
  * avoiding gimbal lock and providing smooth interpolation capabilities.
5
5
  */
6
- import { TVector3, TVector4 } from '../vectors/types.js';
7
- import { IMatrix3 } from '../matrices/types.js';
6
+ import z from 'zod';
8
7
  /**
9
8
  * Quaternion type representing a rotation in 3D space as [x, y, z, w].
10
9
  * The first three components (x, y, z) represent the vector part (rotation axis scaled by sin(θ/2)),
@@ -13,40 +12,52 @@ import { IMatrix3 } from '../matrices/types.js';
13
12
  * Quaternions extend IVector4 to leverage vector operations while maintaining semantic meaning.
14
13
  *
15
14
  * @example
16
- * const identity: IQuaternion = [0, 0, 0, 1]; // No rotation
17
- * const rotationX: IQuaternion = [1, 0, 0, 0]; // 180° rotation around X-axis
18
- * const rotation90Y: IQuaternion = [0, 0.707, 0, 0.707]; // 90° rotation around Y-axis
15
+ * ```typescript
16
+ * const identity: TQuaternion = [0, 0, 0, 1]; // No rotation
17
+ * const rotationX: TQuaternion = [1, 0, 0, 0]; // 180° rotation around X-axis
18
+ * const rotation90Y: TQuaternion = [0, 0.707, 0, 0.707]; // 90° rotation around Y-axis
19
+ * ```
19
20
  */
20
- export type TQuaternion = TVector4;
21
+ export declare const QUATERNION_SCHEMA: z.ZodArray<z.ZodUnknown>;
22
+ export type TQuaternion = [number, number, number, number];
21
23
  /**
22
24
  * Euler angles representation as [x, y, z] rotations in radians.
23
25
  * Order of rotation is typically Z-Y-X (yaw-pitch-roll) unless specified otherwise.
24
26
  *
25
27
  * @example
26
- * const euler: IEulerAngles = [0, Math.PI/4, 0]; // 45° pitch rotation
28
+ * ```typescript
29
+ * const euler: TEulerAngles = [0, Math.PI/4, 0]; // 45° pitch rotation
30
+ * ```
27
31
  */
28
- export type TEulerAngles = TVector3;
32
+ export declare const EULER_ANGLES_SCHEMA: z.ZodArray<z.ZodUnknown>;
33
+ export type TEulerAngles = [number, number, number];
29
34
  /**
30
35
  * Axis-angle representation as [axis_x, axis_y, axis_z, angle].
31
36
  * The first three components define a normalized rotation axis,
32
37
  * and the fourth component is the rotation angle in radians.
33
38
  *
34
39
  * @example
35
- * const axisAngle: IAxisAngle = [0, 1, 0, Math.PI/2]; // 90° rotation around Y-axis
40
+ * ```typescript
41
+ * const axisAngle: TAxisAngle = [0, 1, 0, Math.PI/2]; // 90° rotation around Y-axis
42
+ * ```
36
43
  */
37
- export type TAxisAngle = TVector4;
44
+ export declare const AXIS_ANGLE_SCHEMA: z.ZodArray<z.ZodUnknown>;
45
+ export type TAxisAngle = [number, number, number, number];
38
46
  /**
39
47
  * Rotation matrix representation as a 3x3 matrix.
40
- * Uses the standard IMatrix3 type for better integration with matrix operations.
48
+ * Uses the standard TMatrix3 type for better integration with matrix operations.
41
49
  *
42
50
  * @example
43
- * const identity: IRotationMatrix = [
51
+ * ```typescript
52
+ * const identity: TRotationMatrix = [
44
53
  * [1, 0, 0], // First row
45
54
  * [0, 1, 0], // Second row
46
55
  * [0, 0, 1] // Third row
47
56
  * ];
57
+ * ```
48
58
  */
49
- export type TRotationMatrix = IMatrix3;
59
+ export declare const ROTATION_MATRIX_SCHEMA: z.ZodArray<z.ZodArray<z.ZodUnknown>>;
60
+ export type TRotationMatrix = [[number, number, number], [number, number, number], [number, number, number]];
50
61
  /**
51
62
  * Union type representing any supported rotation representation.
52
63
  * Useful for functions that can accept multiple rotation formats.
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/quaternions/types.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAEhD;;;;;;;;;;;GAWG;AACH,MAAM,MAAM,WAAW,GAAG,QAAQ,CAAC;AAEnC;;;;;;GAMG;AACH,MAAM,MAAM,YAAY,GAAG,QAAQ,CAAC;AAEpC;;;;;;;GAOG;AACH,MAAM,MAAM,UAAU,GAAG,QAAQ,CAAC;AAElC;;;;;;;;;;GAUG;AACH,MAAM,MAAM,eAAe,GAAG,QAAQ,CAAC;AAEvC;;;GAGG;AACH,MAAM,MAAM,SAAS,GAAG,WAAW,GAAG,YAAY,GAAG,UAAU,GAAG,eAAe,CAAC"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/quaternions/types.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,CAAC,MAAM,KAAK,CAAC;AAEpB;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,iBAAiB,0BAQ7B,CAAC;AACF,MAAM,MAAM,WAAW,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;AAE3D;;;;;;;;GAQG;AACH,eAAO,MAAM,mBAAmB,0BAQ/B,CAAC;AACF,MAAM,MAAM,YAAY,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;AAEpD;;;;;;;;;GASG;AACH,eAAO,MAAM,iBAAiB,0BAQ7B,CAAC;AACF,MAAM,MAAM,UAAU,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;AAE1D;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,sBAAsB,sCAUlC,CAAC;AACF,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;AAE7G;;;GAGG;AACH,MAAM,MAAM,SAAS,GAAG,WAAW,GAAG,YAAY,GAAG,UAAU,GAAG,eAAe,CAAC"}
@@ -3,5 +3,55 @@
3
3
  * Quaternions provide a mathematically robust way to represent rotations in 3D space,
4
4
  * avoiding gimbal lock and providing smooth interpolation capabilities.
5
5
  */
6
- export {};
6
+ import z from 'zod';
7
+ /**
8
+ * Quaternion type representing a rotation in 3D space as [x, y, z, w].
9
+ * The first three components (x, y, z) represent the vector part (rotation axis scaled by sin(θ/2)),
10
+ * and the fourth component (w) represents the scalar part (cos(θ/2)).
11
+ *
12
+ * Quaternions extend IVector4 to leverage vector operations while maintaining semantic meaning.
13
+ *
14
+ * @example
15
+ * ```typescript
16
+ * const identity: TQuaternion = [0, 0, 0, 1]; // No rotation
17
+ * const rotationX: TQuaternion = [1, 0, 0, 0]; // 180° rotation around X-axis
18
+ * const rotation90Y: TQuaternion = [0, 0.707, 0, 0.707]; // 90° rotation around Y-axis
19
+ * ```
20
+ */
21
+ export const QUATERNION_SCHEMA = z.array(z.unknown().refine(val => typeof val === 'number' && !Number.isNaN(val), { message: 'Component must be a number' })).refine(arr => arr.length === 4, { message: 'Quaternion must have exactly 4 components' });
22
+ /**
23
+ * Euler angles representation as [x, y, z] rotations in radians.
24
+ * Order of rotation is typically Z-Y-X (yaw-pitch-roll) unless specified otherwise.
25
+ *
26
+ * @example
27
+ * ```typescript
28
+ * const euler: TEulerAngles = [0, Math.PI/4, 0]; // 45° pitch rotation
29
+ * ```
30
+ */
31
+ export const EULER_ANGLES_SCHEMA = z.array(z.unknown().refine(val => typeof val === 'number' && !Number.isNaN(val), { message: 'Component must be a number' })).refine(arr => arr.length === 3, { message: 'Euler angles must have exactly 3 components' });
32
+ /**
33
+ * Axis-angle representation as [axis_x, axis_y, axis_z, angle].
34
+ * The first three components define a normalized rotation axis,
35
+ * and the fourth component is the rotation angle in radians.
36
+ *
37
+ * @example
38
+ * ```typescript
39
+ * const axisAngle: TAxisAngle = [0, 1, 0, Math.PI/2]; // 90° rotation around Y-axis
40
+ * ```
41
+ */
42
+ export const AXIS_ANGLE_SCHEMA = z.array(z.unknown().refine(val => typeof val === 'number' && !Number.isNaN(val), { message: 'Component must be a number' })).refine(arr => arr.length === 4, { message: 'Axis-angle must have exactly 4 components' });
43
+ /**
44
+ * Rotation matrix representation as a 3x3 matrix.
45
+ * Uses the standard TMatrix3 type for better integration with matrix operations.
46
+ *
47
+ * @example
48
+ * ```typescript
49
+ * const identity: TRotationMatrix = [
50
+ * [1, 0, 0], // First row
51
+ * [0, 1, 0], // Second row
52
+ * [0, 0, 1] // Third row
53
+ * ];
54
+ * ```
55
+ */
56
+ export const ROTATION_MATRIX_SCHEMA = z.array(z.array(z.unknown().refine(val => typeof val === 'number' && !Number.isNaN(val), { message: 'Component must be a number' }))).refine(arr => arr.length === 3 && arr.every(row => row.length === 3), { message: 'Rotation matrix must be 3x3' });
7
57
  //# sourceMappingURL=types.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/quaternions/types.ts"],"names":[],"mappings":"AAAA;;;;GAIG"}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/quaternions/types.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,CAAC,MAAM,KAAK,CAAC;AAEpB;;;;;;;;;;;;;GAaG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CACvC,CAAC,CAAC,OAAO,EAAE,CAAC,MAAM,CACjB,GAAG,CAAC,EAAE,CAAC,OAAO,GAAG,KAAK,QAAQ,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,EACpD,EAAE,OAAO,EAAE,4BAA4B,EAAE,CACzC,CACD,CAAC,MAAM,CACP,GAAG,CAAC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AAC,MAAM,KAAK,CAAC,IAAI,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,MAAM,KAAK,CAAC,CAAC,EAC7D,EAAE,OAAO,EAAE,6BAA6B,EAAE,CAC1C,CAAC"}
package/build/random.d.ts CHANGED
@@ -2,11 +2,19 @@
2
2
  * Generates a random integer within the specified range (inclusive).
3
3
  * @param min - Minimum value (inclusive)
4
4
  * @param max - Maximum value (inclusive)
5
- * @returns Random integer between min and max, or NaN if min > max
6
- * @throws Returns `Number.NaN` when `min > max`
7
- * @example RandomInt(1, 6) // Returns 1, 2, 3, 4, 5, or 6 (dice roll)
8
- * @example RandomInt(-5, 5) // Returns any integer from -5 to 5
9
- * @example RandomInt(10, 5) // Returns Number.NaN (invalid range)
5
+ * @returns Random integer between min and max. Returns Number.NaN when min > max.
6
+ * @example
7
+ * ```typescript
8
+ * RandomInt(1, 6) // Returns 1, 2, 3, 4, 5, or 6 (dice roll)
9
+ * ```
10
+ * @example
11
+ * ```typescript
12
+ * RandomInt(-5, 5) // Returns any integer from -5 to 5
13
+ * ```
14
+ * @example
15
+ * ```typescript
16
+ * RandomInt(10, 5) // Returns Number.NaN (invalid range)
17
+ * ```
10
18
  */
11
19
  export declare function RandomInt(min: number, max: number): number;
12
20
  /**
@@ -14,11 +22,19 @@ export declare function RandomInt(min: number, max: number): number;
14
22
  * Note: Asymmetry with RandomInt — this function returns NaN when min >= max (not just min > max).
15
23
  * @param min - Minimum value (inclusive)
16
24
  * @param max - Maximum value (exclusive)
17
- * @returns Random float between min (inclusive) and max (exclusive), or NaN if min >= max
18
- * @throws Returns `Number.NaN` when `min >= max`
19
- * @example RandomFloat(0, 1) // Returns 0.0 to 0.999...
20
- * @example RandomFloat(-1.5, 1.5) // Returns any float from -1.5 to 1.499...
21
- * @example RandomFloat(5, 5) // Returns Number.NaN (min equals max)
25
+ * @returns Random float between min (inclusive) and max (exclusive). Returns Number.NaN when min >= max.
26
+ * @example
27
+ * ```typescript
28
+ * RandomFloat(0, 1) // Returns 0.0 to 0.999...
29
+ * ```
30
+ * @example
31
+ * ```typescript
32
+ * RandomFloat(-1.5, 1.5) // Returns any float from -1.5 to 1.499...
33
+ * ```
34
+ * @example
35
+ * ```typescript
36
+ * RandomFloat(5, 5) // Returns Number.NaN (min equals max)
37
+ * ```
22
38
  */
23
39
  export declare function RandomFloat(min: number, max: number): number;
24
40
  /**
@@ -26,8 +42,14 @@ export declare function RandomFloat(min: number, max: number): number;
26
42
  * @template T - The type of elements in the array
27
43
  * @param array - Array to choose from
28
44
  * @returns Random element from the array, or undefined if array is empty
29
- * @example RandomChoice([1, 2, 3, 4, 5]) // Returns one of the numbers
30
- * @example RandomChoice(['red', 'green', 'blue']) // Returns one of the colors
45
+ * @example
46
+ * ```typescript
47
+ * RandomChoice([1, 2, 3, 4, 5]) // Returns one of the numbers
48
+ * ```
49
+ * @example
50
+ * ```typescript
51
+ * RandomChoice(['red', 'green', 'blue']) // Returns one of the colors
52
+ * ```
31
53
  */
32
54
  export declare function RandomChoice<T>(array: T[]): T | undefined;
33
55
  /**
@@ -37,8 +59,14 @@ export declare function RandomChoice<T>(array: T[]): T | undefined;
37
59
  * @param array - Array to choose from
38
60
  * @param count - Number of elements to select
39
61
  * @returns Array of `count` unique randomly selected elements, or empty array if inputs are invalid
40
- * @example RandomSample([1, 2, 3, 4, 5], 3) // Returns 3 unique numbers
41
- * @example RandomSample(['a', 'b', 'c'], 2) // Returns 2 unique letters
62
+ * @example
63
+ * ```typescript
64
+ * RandomSample([1, 2, 3, 4, 5], 3) // Returns 3 unique numbers
65
+ * ```
66
+ * @example
67
+ * ```typescript
68
+ * RandomSample(['a', 'b', 'c'], 2) // Returns 2 unique letters
69
+ * ```
42
70
  */
43
71
  export declare function RandomSample<T>(array: T[], count: number): T[];
44
72
  /**
@@ -47,8 +75,14 @@ export declare function RandomSample<T>(array: T[], count: number): T[];
47
75
  * @param array - Array to shuffle
48
76
  * @param clone - If true, returns a shuffled copy; if false/undefined, modifies original array
49
77
  * @returns Shuffled array (original reference if clone=false, new array if clone=true)
50
- * @example RandomShuffle([1, 2, 3, 4, 5]) // Modifies and returns original array
51
- * @example RandomShuffle([1, 2, 3, 4, 5], true) // Returns new shuffled array, original unchanged
78
+ * @example
79
+ * ```typescript
80
+ * RandomShuffle([1, 2, 3, 4, 5]) // Modifies and returns original array
81
+ * ```
82
+ * @example
83
+ * ```typescript
84
+ * RandomShuffle([1, 2, 3, 4, 5], true) // Returns new shuffled array, original unchanged
85
+ * ```
52
86
  */
53
87
  export declare function RandomShuffle<T>(array: T[], clone?: boolean): T[];
54
88
  /**
@@ -56,8 +90,14 @@ export declare function RandomShuffle<T>(array: T[], clone?: boolean): T[];
56
90
  * @param probability - Probability of returning true (0.0 to 1.0, default: 0.5)
57
91
  * @returns Random boolean based on probability
58
92
  * @throws {RangeError} If probability is outside the range [0, 1]
59
- * @example RandomBool() // 50% chance of true
60
- * @example RandomBool(0.8) // 80% chance of true
93
+ * @example
94
+ * ```typescript
95
+ * RandomBool() // 50% chance of true
96
+ * ```
97
+ * @example
98
+ * ```typescript
99
+ * RandomBool(0.8) // 80% chance of true
100
+ * ```
61
101
  */
62
102
  export declare function RandomBool(probability?: number): boolean;
63
103
  /**
@@ -67,8 +107,14 @@ export declare function RandomBool(probability?: number): boolean;
67
107
  * @param mean - Mean of the distribution (default: 0)
68
108
  * @param standardDeviation - Standard deviation of the distribution (default: 1)
69
109
  * @returns Random number from normal distribution
70
- * @example RandomNormal() // Standard normal distribution (mean=0, std=1)
71
- * @example RandomNormal(100, 15) // IQ-like distribution (mean=100, std=15)
110
+ * @example
111
+ * ```typescript
112
+ * RandomNormal() // Standard normal distribution (mean=0, std=1)
113
+ * ```
114
+ * @example
115
+ * ```typescript
116
+ * RandomNormal(100, 15) // IQ-like distribution (mean=100, std=15)
117
+ * ```
72
118
  */
73
119
  export declare function RandomNormal(mean?: number, standardDeviation?: number): number;
74
120
  //# sourceMappingURL=random.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"random.d.ts","sourceRoot":"","sources":["../src/random.ts"],"names":[],"mappings":"AAGA;;;;;;;;;GASG;AACH,wBAAgB,SAAS,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAI1D;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,WAAW,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAI5D;AAED;;;;;;;GAOG;AACH,wBAAgB,YAAY,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,GAAG,CAAC,GAAG,SAAS,CAKzD;AAED;;;;;;;;;GASG;AACH,wBAAgB,YAAY,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,EAAE,KAAK,EAAE,MAAM,GAAG,CAAC,EAAE,CAc9D;AAED;;;;;;;;GAQG;AACH,wBAAgB,aAAa,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,EAAE,KAAK,CAAC,EAAE,OAAO,GAAG,CAAC,EAAE,CAWjE;AAED;;;;;;;GAOG;AACH,wBAAgB,UAAU,CAAC,WAAW,GAAE,MAAY,GAAG,OAAO,CAI7D;AAED;;;;;;;;;GASG;AACH,wBAAgB,YAAY,CAAC,IAAI,GAAE,MAAU,EAAE,iBAAiB,GAAE,MAAU,GAAG,MAAM,CAUpF"}
1
+ {"version":3,"file":"random.d.ts","sourceRoot":"","sources":["../src/random.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,SAAS,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAI1D;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,WAAW,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAI5D;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,YAAY,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,GAAG,CAAC,GAAG,SAAS,CAKzD;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,YAAY,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,EAAE,KAAK,EAAE,MAAM,GAAG,CAAC,EAAE,CAc9D;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,aAAa,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,EAAE,KAAK,CAAC,EAAE,OAAO,GAAG,CAAC,EAAE,CAWjE;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,UAAU,CAAC,WAAW,GAAE,MAAY,GAAG,OAAO,CAI7D;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,YAAY,CAAC,IAAI,GAAE,MAAU,EAAE,iBAAiB,GAAE,MAAU,GAAG,MAAM,CAiBpF"}
package/build/random.js CHANGED
@@ -4,11 +4,19 @@ const BOX_MULLER_MIN_U1 = Number.EPSILON; // Avoid log(0) = -Infinity in Box-Mul
4
4
  * Generates a random integer within the specified range (inclusive).
5
5
  * @param min - Minimum value (inclusive)
6
6
  * @param max - Maximum value (inclusive)
7
- * @returns Random integer between min and max, or NaN if min > max
8
- * @throws Returns `Number.NaN` when `min > max`
9
- * @example RandomInt(1, 6) // Returns 1, 2, 3, 4, 5, or 6 (dice roll)
10
- * @example RandomInt(-5, 5) // Returns any integer from -5 to 5
11
- * @example RandomInt(10, 5) // Returns Number.NaN (invalid range)
7
+ * @returns Random integer between min and max. Returns Number.NaN when min > max.
8
+ * @example
9
+ * ```typescript
10
+ * RandomInt(1, 6) // Returns 1, 2, 3, 4, 5, or 6 (dice roll)
11
+ * ```
12
+ * @example
13
+ * ```typescript
14
+ * RandomInt(-5, 5) // Returns any integer from -5 to 5
15
+ * ```
16
+ * @example
17
+ * ```typescript
18
+ * RandomInt(10, 5) // Returns Number.NaN (invalid range)
19
+ * ```
12
20
  */
13
21
  export function RandomInt(min, max) {
14
22
  if (min > max)
@@ -20,11 +28,19 @@ export function RandomInt(min, max) {
20
28
  * Note: Asymmetry with RandomInt — this function returns NaN when min >= max (not just min > max).
21
29
  * @param min - Minimum value (inclusive)
22
30
  * @param max - Maximum value (exclusive)
23
- * @returns Random float between min (inclusive) and max (exclusive), or NaN if min >= max
24
- * @throws Returns `Number.NaN` when `min >= max`
25
- * @example RandomFloat(0, 1) // Returns 0.0 to 0.999...
26
- * @example RandomFloat(-1.5, 1.5) // Returns any float from -1.5 to 1.499...
27
- * @example RandomFloat(5, 5) // Returns Number.NaN (min equals max)
31
+ * @returns Random float between min (inclusive) and max (exclusive). Returns Number.NaN when min >= max.
32
+ * @example
33
+ * ```typescript
34
+ * RandomFloat(0, 1) // Returns 0.0 to 0.999...
35
+ * ```
36
+ * @example
37
+ * ```typescript
38
+ * RandomFloat(-1.5, 1.5) // Returns any float from -1.5 to 1.499...
39
+ * ```
40
+ * @example
41
+ * ```typescript
42
+ * RandomFloat(5, 5) // Returns Number.NaN (min equals max)
43
+ * ```
28
44
  */
29
45
  export function RandomFloat(min, max) {
30
46
  if (min >= max)
@@ -36,8 +52,14 @@ export function RandomFloat(min, max) {
36
52
  * @template T - The type of elements in the array
37
53
  * @param array - Array to choose from
38
54
  * @returns Random element from the array, or undefined if array is empty
39
- * @example RandomChoice([1, 2, 3, 4, 5]) // Returns one of the numbers
40
- * @example RandomChoice(['red', 'green', 'blue']) // Returns one of the colors
55
+ * @example
56
+ * ```typescript
57
+ * RandomChoice([1, 2, 3, 4, 5]) // Returns one of the numbers
58
+ * ```
59
+ * @example
60
+ * ```typescript
61
+ * RandomChoice(['red', 'green', 'blue']) // Returns one of the colors
62
+ * ```
41
63
  */
42
64
  export function RandomChoice(array) {
43
65
  if (array.length === 0)
@@ -52,8 +74,14 @@ export function RandomChoice(array) {
52
74
  * @param array - Array to choose from
53
75
  * @param count - Number of elements to select
54
76
  * @returns Array of `count` unique randomly selected elements, or empty array if inputs are invalid
55
- * @example RandomSample([1, 2, 3, 4, 5], 3) // Returns 3 unique numbers
56
- * @example RandomSample(['a', 'b', 'c'], 2) // Returns 2 unique letters
77
+ * @example
78
+ * ```typescript
79
+ * RandomSample([1, 2, 3, 4, 5], 3) // Returns 3 unique numbers
80
+ * ```
81
+ * @example
82
+ * ```typescript
83
+ * RandomSample(['a', 'b', 'c'], 2) // Returns 2 unique letters
84
+ * ```
57
85
  */
58
86
  export function RandomSample(array, count) {
59
87
  if (array.length === 0 || count <= 0 || count > array.length)
@@ -74,8 +102,14 @@ export function RandomSample(array, count) {
74
102
  * @param array - Array to shuffle
75
103
  * @param clone - If true, returns a shuffled copy; if false/undefined, modifies original array
76
104
  * @returns Shuffled array (original reference if clone=false, new array if clone=true)
77
- * @example RandomShuffle([1, 2, 3, 4, 5]) // Modifies and returns original array
78
- * @example RandomShuffle([1, 2, 3, 4, 5], true) // Returns new shuffled array, original unchanged
105
+ * @example
106
+ * ```typescript
107
+ * RandomShuffle([1, 2, 3, 4, 5]) // Modifies and returns original array
108
+ * ```
109
+ * @example
110
+ * ```typescript
111
+ * RandomShuffle([1, 2, 3, 4, 5], true) // Returns new shuffled array, original unchanged
112
+ * ```
79
113
  */
80
114
  export function RandomShuffle(array, clone) {
81
115
  const targetArray = clone ? [...array] : array;
@@ -92,8 +126,14 @@ export function RandomShuffle(array, clone) {
92
126
  * @param probability - Probability of returning true (0.0 to 1.0, default: 0.5)
93
127
  * @returns Random boolean based on probability
94
128
  * @throws {RangeError} If probability is outside the range [0, 1]
95
- * @example RandomBool() // 50% chance of true
96
- * @example RandomBool(0.8) // 80% chance of true
129
+ * @example
130
+ * ```typescript
131
+ * RandomBool() // 50% chance of true
132
+ * ```
133
+ * @example
134
+ * ```typescript
135
+ * RandomBool(0.8) // 80% chance of true
136
+ * ```
97
137
  */
98
138
  export function RandomBool(probability = 0.5) {
99
139
  if (probability < 0 || probability > 1)
@@ -107,12 +147,25 @@ export function RandomBool(probability = 0.5) {
107
147
  * @param mean - Mean of the distribution (default: 0)
108
148
  * @param standardDeviation - Standard deviation of the distribution (default: 1)
109
149
  * @returns Random number from normal distribution
110
- * @example RandomNormal() // Standard normal distribution (mean=0, std=1)
111
- * @example RandomNormal(100, 15) // IQ-like distribution (mean=100, std=15)
150
+ * @example
151
+ * ```typescript
152
+ * RandomNormal() // Standard normal distribution (mean=0, std=1)
153
+ * ```
154
+ * @example
155
+ * ```typescript
156
+ * RandomNormal(100, 15) // IQ-like distribution (mean=100, std=15)
157
+ * ```
112
158
  */
113
159
  export function RandomNormal(mean = 0, standardDeviation = 1) {
114
160
  // Box-Muller transform — u1 must be > 0 to avoid log(0) = -Infinity
115
161
  let u1 = Math.random();
162
+ /**
163
+ * Avoid log(0) → -Infinity by rejecting u1 too close to 0.
164
+ * BOX_MULLER_MIN_U1 = Number.EPSILON ≈ 2.22e-16.
165
+ * Expected retry probability per call: ~2.22e-16 (effectively never executed).
166
+ * Box-Muller with u1 >= Number.EPSILON is statistically sound and produces
167
+ * valid normal-distributed values.
168
+ */
116
169
  while (u1 < BOX_MULLER_MIN_U1) {
117
170
  u1 = Math.random();
118
171
  }
@@ -1 +1 @@
1
- {"version":3,"file":"random.js","sourceRoot":"","sources":["../src/random.ts"],"names":[],"mappings":"AAAA,MAAM,sBAAsB,GAAG,CAAC,CAAC,CAAC;AAClC,MAAM,iBAAiB,GAAG,MAAM,CAAC,OAAO,CAAC,CAAC,mDAAmD;AAE7F;;;;;;;;;GASG;AACH,MAAM,UAAU,SAAS,CAAC,GAAW,EAAE,GAAW;IACjD,IAAI,GAAG,GAAG,GAAG;QAAE,OAAO,MAAM,CAAC,GAAG,CAAC;IAEjC,OAAO,IAAI,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,GAAG,GAAG,GAAG,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC,CAAC;AAC5D,CAAC;AAED;;;;;;;;;;GAUG;AACH,MAAM,UAAU,WAAW,CAAC,GAAW,EAAE,GAAW;IACnD,IAAI,GAAG,IAAI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