@lakuna/umath 1.3.9 → 1.4.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 (162) hide show
  1. package/README.md +1 -1
  2. package/dist/algorithms/approx.d.ts +9 -0
  3. package/dist/algorithms/approx.d.ts.map +1 -0
  4. package/dist/algorithms/approx.js +12 -0
  5. package/dist/algorithms/approx.js.map +1 -0
  6. package/dist/algorithms/approxRelative.d.ts +9 -0
  7. package/dist/algorithms/approxRelative.d.ts.map +1 -0
  8. package/dist/algorithms/approxRelative.js +12 -0
  9. package/dist/algorithms/approxRelative.js.map +1 -0
  10. package/dist/algorithms/combinations.d.ts +2 -1
  11. package/dist/algorithms/combinations.d.ts.map +1 -1
  12. package/dist/algorithms/combinations.js +2 -1
  13. package/dist/algorithms/combinations.js.map +1 -1
  14. package/dist/algorithms/degreesToRadians.d.ts +3 -2
  15. package/dist/algorithms/degreesToRadians.d.ts.map +1 -1
  16. package/dist/algorithms/degreesToRadians.js +5 -3
  17. package/dist/algorithms/degreesToRadians.js.map +1 -1
  18. package/dist/algorithms/factorial.d.ts +2 -1
  19. package/dist/algorithms/factorial.d.ts.map +1 -1
  20. package/dist/algorithms/factorial.js +2 -1
  21. package/dist/algorithms/factorial.js.map +1 -1
  22. package/dist/algorithms/fibonacci.d.ts +2 -1
  23. package/dist/algorithms/fibonacci.d.ts.map +1 -1
  24. package/dist/algorithms/fibonacci.js +6 -2
  25. package/dist/algorithms/fibonacci.js.map +1 -1
  26. package/dist/algorithms/greatestCommonDivisor.d.ts +4 -2
  27. package/dist/algorithms/greatestCommonDivisor.d.ts.map +1 -1
  28. package/dist/algorithms/greatestCommonDivisor.js +5 -2
  29. package/dist/algorithms/greatestCommonDivisor.js.map +1 -1
  30. package/dist/algorithms/hypergeometricPmf.d.ts +3 -2
  31. package/dist/algorithms/hypergeometricPmf.d.ts.map +1 -1
  32. package/dist/algorithms/hypergeometricPmf.js +3 -2
  33. package/dist/algorithms/hypergeometricPmf.js.map +1 -1
  34. package/dist/algorithms/isPrime.d.ts +2 -1
  35. package/dist/algorithms/isPrime.d.ts.map +1 -1
  36. package/dist/algorithms/isPrime.js +2 -1
  37. package/dist/algorithms/isPrime.js.map +1 -1
  38. package/dist/algorithms/permutations.d.ts +2 -1
  39. package/dist/algorithms/permutations.d.ts.map +1 -1
  40. package/dist/algorithms/permutations.js +2 -1
  41. package/dist/algorithms/permutations.js.map +1 -1
  42. package/dist/algorithms/primeFactorization.d.ts +2 -1
  43. package/dist/algorithms/primeFactorization.d.ts.map +1 -1
  44. package/dist/algorithms/primeFactorization.js +2 -1
  45. package/dist/algorithms/primeFactorization.js.map +1 -1
  46. package/dist/algorithms/radiansToDegrees.d.ts +3 -2
  47. package/dist/algorithms/radiansToDegrees.d.ts.map +1 -1
  48. package/dist/algorithms/radiansToDegrees.js +5 -3
  49. package/dist/algorithms/radiansToDegrees.js.map +1 -1
  50. package/dist/algorithms/summation.d.ts +2 -1
  51. package/dist/algorithms/summation.d.ts.map +1 -1
  52. package/dist/algorithms/summation.js +2 -1
  53. package/dist/algorithms/summation.js.map +1 -1
  54. package/dist/linalg/DualQuaternion.d.ts +102 -32
  55. package/dist/linalg/DualQuaternion.d.ts.map +1 -1
  56. package/dist/linalg/DualQuaternion.js +243 -272
  57. package/dist/linalg/DualQuaternion.js.map +1 -1
  58. package/dist/linalg/Matrix.d.ts +14 -10
  59. package/dist/linalg/Matrix.d.ts.map +1 -1
  60. package/dist/linalg/Matrix2.d.ts +74 -51
  61. package/dist/linalg/Matrix2.d.ts.map +1 -1
  62. package/dist/linalg/Matrix2.js +95 -171
  63. package/dist/linalg/Matrix2.js.map +1 -1
  64. package/dist/linalg/Matrix3.d.ts +122 -72
  65. package/dist/linalg/Matrix3.d.ts.map +1 -1
  66. package/dist/linalg/Matrix3.js +186 -355
  67. package/dist/linalg/Matrix3.js.map +1 -1
  68. package/dist/linalg/Matrix4.d.ts +266 -149
  69. package/dist/linalg/Matrix4.d.ts.map +1 -1
  70. package/dist/linalg/Matrix4.js +512 -852
  71. package/dist/linalg/Matrix4.js.map +1 -1
  72. package/dist/linalg/Quaternion.d.ts +252 -34
  73. package/dist/linalg/Quaternion.d.ts.map +1 -1
  74. package/dist/linalg/Quaternion.js +436 -166
  75. package/dist/linalg/Quaternion.js.map +1 -1
  76. package/dist/linalg/SlowMatrix.d.ts +10 -9
  77. package/dist/linalg/SlowMatrix.d.ts.map +1 -1
  78. package/dist/linalg/SlowMatrix.js +10 -9
  79. package/dist/linalg/SlowMatrix.js.map +1 -1
  80. package/dist/linalg/SlowSquareMatrix.d.ts +10 -9
  81. package/dist/linalg/SlowSquareMatrix.d.ts.map +1 -1
  82. package/dist/linalg/SlowSquareMatrix.js +10 -9
  83. package/dist/linalg/SlowSquareMatrix.js.map +1 -1
  84. package/dist/linalg/SquareMatrix.d.ts +6 -5
  85. package/dist/linalg/SquareMatrix.d.ts.map +1 -1
  86. package/dist/linalg/Vector.d.ts +8 -4
  87. package/dist/linalg/Vector.d.ts.map +1 -1
  88. package/dist/linalg/Vector2.d.ts +82 -31
  89. package/dist/linalg/Vector2.d.ts.map +1 -1
  90. package/dist/linalg/Vector2.js +112 -154
  91. package/dist/linalg/Vector2.js.map +1 -1
  92. package/dist/linalg/Vector3.d.ts +93 -41
  93. package/dist/linalg/Vector3.d.ts.map +1 -1
  94. package/dist/linalg/Vector3.js +171 -282
  95. package/dist/linalg/Vector3.js.map +1 -1
  96. package/dist/linalg/Vector4.d.ts +71 -21
  97. package/dist/linalg/Vector4.d.ts.map +1 -1
  98. package/dist/linalg/Vector4.js +121 -195
  99. package/dist/linalg/Vector4.js.map +1 -1
  100. package/dist/types/AxisAngle.d.ts +4 -1
  101. package/dist/types/AxisAngle.d.ts.map +1 -1
  102. package/dist/types/FieldOfView.d.ts +4 -1
  103. package/dist/types/FieldOfView.d.ts.map +1 -1
  104. package/dist/utility/BigNumber.d.ts +4 -1
  105. package/dist/utility/BigNumber.d.ts.map +1 -1
  106. package/dist/utility/BigNumber.js +4 -1
  107. package/dist/utility/BigNumber.js.map +1 -1
  108. package/dist/utility/MagnitudeError.d.ts +4 -1
  109. package/dist/utility/MagnitudeError.d.ts.map +1 -1
  110. package/dist/utility/MagnitudeError.js +4 -1
  111. package/dist/utility/MagnitudeError.js.map +1 -1
  112. package/dist/utility/MatrixSizeError.d.ts +4 -1
  113. package/dist/utility/MatrixSizeError.d.ts.map +1 -1
  114. package/dist/utility/MatrixSizeError.js +4 -1
  115. package/dist/utility/MatrixSizeError.js.map +1 -1
  116. package/dist/utility/PartialMatrixError.d.ts +4 -1
  117. package/dist/utility/PartialMatrixError.d.ts.map +1 -1
  118. package/dist/utility/PartialMatrixError.js +4 -1
  119. package/dist/utility/PartialMatrixError.js.map +1 -1
  120. package/dist/utility/SingularMatrixError.d.ts +2 -1
  121. package/dist/utility/SingularMatrixError.d.ts.map +1 -1
  122. package/dist/utility/SingularMatrixError.js +2 -1
  123. package/dist/utility/SingularMatrixError.js.map +1 -1
  124. package/dist/utility/epsilon.d.ts +4 -1
  125. package/dist/utility/epsilon.d.ts.map +1 -1
  126. package/dist/utility/epsilon.js +4 -1
  127. package/dist/utility/epsilon.js.map +1 -1
  128. package/package.json +9 -9
  129. package/src/algorithms/approx.ts +12 -0
  130. package/src/algorithms/approxRelative.ts +12 -0
  131. package/src/algorithms/combinations.ts +2 -1
  132. package/src/algorithms/degreesToRadians.ts +6 -3
  133. package/src/algorithms/factorial.ts +3 -1
  134. package/src/algorithms/fibonacci.ts +7 -2
  135. package/src/algorithms/greatestCommonDivisor.ts +9 -4
  136. package/src/algorithms/hypergeometricPmf.ts +3 -2
  137. package/src/algorithms/isPrime.ts +2 -1
  138. package/src/algorithms/permutations.ts +2 -1
  139. package/src/algorithms/primeFactorization.ts +2 -1
  140. package/src/algorithms/radiansToDegrees.ts +6 -3
  141. package/src/algorithms/summation.ts +2 -1
  142. package/src/linalg/DualQuaternion.ts +424 -289
  143. package/src/linalg/Matrix.ts +14 -10
  144. package/src/linalg/Matrix2.ts +141 -188
  145. package/src/linalg/Matrix3.ts +400 -375
  146. package/src/linalg/Matrix4.ts +1083 -905
  147. package/src/linalg/Quaternion.ts +706 -188
  148. package/src/linalg/SlowMatrix.ts +10 -9
  149. package/src/linalg/SlowSquareMatrix.ts +10 -9
  150. package/src/linalg/SquareMatrix.ts +6 -5
  151. package/src/linalg/Vector.ts +8 -4
  152. package/src/linalg/Vector2.ts +146 -173
  153. package/src/linalg/Vector3.ts +293 -326
  154. package/src/linalg/Vector4.ts +227 -215
  155. package/src/types/AxisAngle.ts +4 -1
  156. package/src/types/FieldOfView.ts +4 -1
  157. package/src/utility/BigNumber.ts +6 -3
  158. package/src/utility/MagnitudeError.ts +4 -1
  159. package/src/utility/MatrixSizeError.ts +4 -1
  160. package/src/utility/PartialMatrixError.ts +4 -1
  161. package/src/utility/SingularMatrixError.ts +2 -1
  162. package/src/utility/epsilon.ts +4 -1
package/README.md CHANGED
@@ -41,4 +41,4 @@ const b = [4, 5, 6, 7];
41
41
  const c = multiply(a, b, [0, 0, 0, 0]);
42
42
  ```
43
43
 
44
- You can compare the performance of the raw functions versus the convenience classes on jsPerf.app [here](https://jsperf.app/qubahu/2).
44
+ The majority of the algorithms used in the linear algebra API are adapted from [glMatrix](https://github.com/toji/gl-matrix/).
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Determine whether or not two numbers are approximately equivalent (no greater than `epsilon` apart).
3
+ * @param a - The first number.
4
+ * @param b - The second number.
5
+ * @returns Whether or not the two numbers are approximately equivalent.
6
+ * @public
7
+ */
8
+ export default function approx(a: number, b: number): boolean;
9
+ //# sourceMappingURL=approx.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"approx.d.ts","sourceRoot":"","sources":["../../src/algorithms/approx.ts"],"names":[],"mappings":"AAEA;;;;;;GAMG;AACH,MAAM,CAAC,OAAO,UAAU,MAAM,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,OAAO,CAE5D"}
@@ -0,0 +1,12 @@
1
+ import epsilon from "../utility/epsilon.js";
2
+ /**
3
+ * Determine whether or not two numbers are approximately equivalent (no greater than `epsilon` apart).
4
+ * @param a - The first number.
5
+ * @param b - The second number.
6
+ * @returns Whether or not the two numbers are approximately equivalent.
7
+ * @public
8
+ */
9
+ export default function approx(a, b) {
10
+ return Math.abs(a - b) <= epsilon;
11
+ }
12
+ //# sourceMappingURL=approx.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"approx.js","sourceRoot":"","sources":["../../src/algorithms/approx.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,uBAAuB,CAAC;AAE5C;;;;;;GAMG;AACH,MAAM,CAAC,OAAO,UAAU,MAAM,CAAC,CAAS,EAAE,CAAS;IAClD,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,OAAO,CAAC;AACnC,CAAC"}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Determine whether or not two numbers are approximately equivalent relative to the size of the numbers (no greater than `epsilon * Math.max(1, Math.abs(a), Math.abs(b))` apart).
3
+ * @param a - The first number.
4
+ * @param b - The second number.
5
+ * @returns Whether or not the two numbers are approximately equivalent.
6
+ * @public
7
+ */
8
+ export default function approxRelative(a: number, b: number): boolean;
9
+ //# sourceMappingURL=approxRelative.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"approxRelative.d.ts","sourceRoot":"","sources":["../../src/algorithms/approxRelative.ts"],"names":[],"mappings":"AAEA;;;;;;GAMG;AACH,MAAM,CAAC,OAAO,UAAU,cAAc,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,OAAO,CAEpE"}
@@ -0,0 +1,12 @@
1
+ import epsilon from "../utility/epsilon.js";
2
+ /**
3
+ * Determine whether or not two numbers are approximately equivalent relative to the size of the numbers (no greater than `epsilon * Math.max(1, Math.abs(a), Math.abs(b))` apart).
4
+ * @param a - The first number.
5
+ * @param b - The second number.
6
+ * @returns Whether or not the two numbers are approximately equivalent.
7
+ * @public
8
+ */
9
+ export default function approxRelative(a, b) {
10
+ return Math.abs(a - b) <= epsilon * Math.max(1, Math.abs(a), Math.abs(b));
11
+ }
12
+ //# sourceMappingURL=approxRelative.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"approxRelative.js","sourceRoot":"","sources":["../../src/algorithms/approxRelative.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,uBAAuB,CAAC;AAE5C;;;;;;GAMG;AACH,MAAM,CAAC,OAAO,UAAU,cAAc,CAAC,CAAS,EAAE,CAAS;IAC1D,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,OAAO,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;AAC3E,CAAC"}
@@ -3,7 +3,8 @@
3
3
  * @param n - The total number of units.
4
4
  * @param r - The number of units taken at a time.
5
5
  * @returns The number of combinations.
6
- * @see [Combination](https://en.wikipedia.org/wiki/Combination)
6
+ * @see {@link https://en.wikipedia.org/wiki/Combination | Combination}
7
+ * @public
7
8
  */
8
9
  export default function combinations(n: number, r: number): number;
9
10
  //# sourceMappingURL=combinations.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"combinations.d.ts","sourceRoot":"","sources":["../../src/algorithms/combinations.ts"],"names":[],"mappings":"AAEA;;;;;;GAMG;AACH,MAAM,CAAC,OAAO,UAAU,YAAY,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAEjE"}
1
+ {"version":3,"file":"combinations.d.ts","sourceRoot":"","sources":["../../src/algorithms/combinations.ts"],"names":[],"mappings":"AAEA;;;;;;;GAOG;AACH,MAAM,CAAC,OAAO,UAAU,YAAY,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAEjE"}
@@ -4,7 +4,8 @@ import factorial from "./factorial.js";
4
4
  * @param n - The total number of units.
5
5
  * @param r - The number of units taken at a time.
6
6
  * @returns The number of combinations.
7
- * @see [Combination](https://en.wikipedia.org/wiki/Combination)
7
+ * @see {@link https://en.wikipedia.org/wiki/Combination | Combination}
8
+ * @public
8
9
  */
9
10
  export default function combinations(n, r) {
10
11
  return factorial(n) / (factorial(r) * factorial(n - r));
@@ -1 +1 @@
1
- {"version":3,"file":"combinations.js","sourceRoot":"","sources":["../../src/algorithms/combinations.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,gBAAgB,CAAC;AAEvC;;;;;;GAMG;AACH,MAAM,CAAC,OAAO,UAAU,YAAY,CAAC,CAAS,EAAE,CAAS;IACxD,OAAO,SAAS,CAAC,CAAC,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC,CAAC,GAAG,SAAS,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;AACzD,CAAC"}
1
+ {"version":3,"file":"combinations.js","sourceRoot":"","sources":["../../src/algorithms/combinations.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,gBAAgB,CAAC;AAEvC;;;;;;;GAOG;AACH,MAAM,CAAC,OAAO,UAAU,YAAY,CAAC,CAAS,EAAE,CAAS;IACxD,OAAO,SAAS,CAAC,CAAC,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC,CAAC,GAAG,SAAS,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;AACzD,CAAC"}
@@ -2,8 +2,9 @@
2
2
  * Convert a number of degrees to an equivalent number of radians.
3
3
  * @param degrees - The number of degrees.
4
4
  * @returns A number of radians.
5
- * @see [Degree](https://en.wikipedia.org/wiki/Degree_(angle))
6
- * @see [Radian](https://en.wikipedia.org/wiki/Radian)
5
+ * @see {@link https://en.wikipedia.org/wiki/Degree_(angle) | Degree}
6
+ * @see {@link https://en.wikipedia.org/wiki/Radian | Radian}
7
+ * @public
7
8
  */
8
9
  export default function degreesToRadians(degrees: number): number;
9
10
  //# sourceMappingURL=degreesToRadians.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"degreesToRadians.d.ts","sourceRoot":"","sources":["../../src/algorithms/degreesToRadians.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,MAAM,CAAC,OAAO,UAAU,gBAAgB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAEhE"}
1
+ {"version":3,"file":"degreesToRadians.d.ts","sourceRoot":"","sources":["../../src/algorithms/degreesToRadians.ts"],"names":[],"mappings":"AAEA;;;;;;;GAOG;AACH,MAAM,CAAC,OAAO,UAAU,gBAAgB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAEhE"}
@@ -1,11 +1,13 @@
1
+ const ratio = Math.PI / 180;
1
2
  /**
2
3
  * Convert a number of degrees to an equivalent number of radians.
3
4
  * @param degrees - The number of degrees.
4
5
  * @returns A number of radians.
5
- * @see [Degree](https://en.wikipedia.org/wiki/Degree_(angle))
6
- * @see [Radian](https://en.wikipedia.org/wiki/Radian)
6
+ * @see {@link https://en.wikipedia.org/wiki/Degree_(angle) | Degree}
7
+ * @see {@link https://en.wikipedia.org/wiki/Radian | Radian}
8
+ * @public
7
9
  */
8
10
  export default function degreesToRadians(degrees) {
9
- return (degrees * Math.PI) / 180;
11
+ return degrees * ratio;
10
12
  }
11
13
  //# sourceMappingURL=degreesToRadians.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"degreesToRadians.js","sourceRoot":"","sources":["../../src/algorithms/degreesToRadians.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,MAAM,CAAC,OAAO,UAAU,gBAAgB,CAAC,OAAe;IACvD,OAAO,CAAC,OAAO,GAAG,IAAI,CAAC,EAAE,CAAC,GAAG,GAAG,CAAC;AAClC,CAAC"}
1
+ {"version":3,"file":"degreesToRadians.js","sourceRoot":"","sources":["../../src/algorithms/degreesToRadians.ts"],"names":[],"mappings":"AAAA,MAAM,KAAK,GAAG,IAAI,CAAC,EAAE,GAAG,GAAG,CAAC;AAE5B;;;;;;;GAOG;AACH,MAAM,CAAC,OAAO,UAAU,gBAAgB,CAAC,OAAe;IACvD,OAAO,OAAO,GAAG,KAAK,CAAC;AACxB,CAAC"}
@@ -2,7 +2,8 @@
2
2
  * Calculate the factorial of a number.
3
3
  * @param n - The number.
4
4
  * @returns The factorial.
5
- * @see [Factorial](https://en.wikipedia.org/wiki/Factorial)
5
+ * @see {@link https://en.wikipedia.org/wiki/Factorial | Factorial}
6
+ * @public
6
7
  */
7
8
  export default function factorial(n: number): number;
8
9
  //# sourceMappingURL=factorial.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"factorial.d.ts","sourceRoot":"","sources":["../../src/algorithms/factorial.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,CAAC,OAAO,UAAU,SAAS,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAWnD"}
1
+ {"version":3,"file":"factorial.d.ts","sourceRoot":"","sources":["../../src/algorithms/factorial.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,MAAM,CAAC,OAAO,UAAU,SAAS,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAYnD"}
@@ -2,7 +2,8 @@
2
2
  * Calculate the factorial of a number.
3
3
  * @param n - The number.
4
4
  * @returns The factorial.
5
- * @see [Factorial](https://en.wikipedia.org/wiki/Factorial)
5
+ * @see {@link https://en.wikipedia.org/wiki/Factorial | Factorial}
6
+ * @public
6
7
  */
7
8
  export default function factorial(n) {
8
9
  if (n < 0) {
@@ -1 +1 @@
1
- {"version":3,"file":"factorial.js","sourceRoot":"","sources":["../../src/algorithms/factorial.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,CAAC,OAAO,UAAU,SAAS,CAAC,CAAS;IAC1C,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC;QACX,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,qDAAqD;IAC3F,CAAC;IAED,yEAAyE;IACzE,IAAI,GAAG,GAAG,CAAC,CAAC;IACZ,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;QAC7B,GAAG,IAAI,CAAC,CAAC;IACV,CAAC;IACD,OAAO,GAAG,CAAC;AACZ,CAAC"}
1
+ {"version":3,"file":"factorial.js","sourceRoot":"","sources":["../../src/algorithms/factorial.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,MAAM,CAAC,OAAO,UAAU,SAAS,CAAC,CAAS;IAC1C,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC;QACX,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,qDAAqD;IAC3F,CAAC;IAED,yEAAyE;IACzE,IAAI,GAAG,GAAG,CAAC,CAAC;IACZ,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;QAC7B,GAAG,IAAI,CAAC,CAAC;IACV,CAAC;IAED,OAAO,GAAG,CAAC;AACZ,CAAC"}
@@ -1,7 +1,8 @@
1
1
  /**
2
2
  * Calculate numbers in the Fibonacci sequence.
3
3
  * @returns The next value in the Fibonacci sequence.
4
- * @see [Fibonacci sequence](https://en.wikipedia.org/wiki/Fibonacci_sequence)
4
+ * @see {@link https://en.wikipedia.org/wiki/Fibonacci_sequence | Fibonacci sequence}
5
+ * @public
5
6
  */
6
7
  export default function fibonacci(): Generator<number, void>;
7
8
  //# sourceMappingURL=fibonacci.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"fibonacci.d.ts","sourceRoot":"","sources":["../../src/algorithms/fibonacci.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,CAAC,OAAO,UAAW,SAAS,IAAI,SAAS,CAAC,MAAM,EAAE,IAAI,CAAC,CAQ5D"}
1
+ {"version":3,"file":"fibonacci.d.ts","sourceRoot":"","sources":["../../src/algorithms/fibonacci.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,CAAC,OAAO,UAAW,SAAS,IAAI,SAAS,CAAC,MAAM,EAAE,IAAI,CAAC,CAY5D"}
@@ -1,14 +1,18 @@
1
1
  /**
2
2
  * Calculate numbers in the Fibonacci sequence.
3
3
  * @returns The next value in the Fibonacci sequence.
4
- * @see [Fibonacci sequence](https://en.wikipedia.org/wiki/Fibonacci_sequence)
4
+ * @see {@link https://en.wikipedia.org/wiki/Fibonacci_sequence | Fibonacci sequence}
5
+ * @public
5
6
  */
6
7
  export default function* fibonacci() {
7
8
  let a = 0;
8
9
  let b = 1;
9
10
  while (a >= 0) {
10
11
  yield a;
11
- [a, b] = [b, a + b];
12
+ // `[a, b] = [b, a + b];`
13
+ const temp = a;
14
+ a = b;
15
+ b += temp;
12
16
  }
13
17
  }
14
18
  //# sourceMappingURL=fibonacci.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"fibonacci.js","sourceRoot":"","sources":["../../src/algorithms/fibonacci.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,CAAC,OAAO,SAAS,CAAC,CAAC,SAAS;IACjC,IAAI,CAAC,GAAG,CAAC,CAAC;IACV,IAAI,CAAC,GAAG,CAAC,CAAC;IAEV,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC;QACf,MAAM,CAAC,CAAC;QACR,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IACrB,CAAC;AACF,CAAC"}
1
+ {"version":3,"file":"fibonacci.js","sourceRoot":"","sources":["../../src/algorithms/fibonacci.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,CAAC,OAAO,SAAS,CAAC,CAAC,SAAS;IACjC,IAAI,CAAC,GAAG,CAAC,CAAC;IACV,IAAI,CAAC,GAAG,CAAC,CAAC;IAEV,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC;QACf,MAAM,CAAC,CAAC;QAER,yBAAyB;QACzB,MAAM,IAAI,GAAG,CAAC,CAAC;QACf,CAAC,GAAG,CAAC,CAAC;QACN,CAAC,IAAI,IAAI,CAAC;IACX,CAAC;AACF,CAAC"}
@@ -3,7 +3,8 @@
3
3
  * @param a - The first integer.
4
4
  * @param b - The second integer.
5
5
  * @returns The greatest common divisor.
6
- * @see [Greatest common divisor](https://en.wikipedia.org/wiki/Greatest_common_divisor)
6
+ * @see {@link https://en.wikipedia.org/wiki/Greatest_common_divisor | Greatest common divisor}
7
+ * @public
7
8
  */
8
9
  export default function greatestCommonDivisor(a: bigint, b: bigint): bigint;
9
10
  /**
@@ -11,7 +12,8 @@ export default function greatestCommonDivisor(a: bigint, b: bigint): bigint;
11
12
  * @param a - The first integer.
12
13
  * @param b - The second integer.
13
14
  * @returns The greatest common divisor.
14
- * @see [Greatest common divisor](https://en.wikipedia.org/wiki/Greatest_common_divisor)
15
+ * @see {@link https://en.wikipedia.org/wiki/Greatest_common_divisor | Greatest common divisor}
16
+ * @public
15
17
  */
16
18
  export default function greatestCommonDivisor(a: number, b: number): number;
17
19
  //# sourceMappingURL=greatestCommonDivisor.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"greatestCommonDivisor.d.ts","sourceRoot":"","sources":["../../src/algorithms/greatestCommonDivisor.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,MAAM,CAAC,OAAO,UAAU,qBAAqB,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;AAE5E;;;;;;GAMG;AACH,MAAM,CAAC,OAAO,UAAU,qBAAqB,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC"}
1
+ {"version":3,"file":"greatestCommonDivisor.d.ts","sourceRoot":"","sources":["../../src/algorithms/greatestCommonDivisor.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,MAAM,CAAC,OAAO,UAAU,qBAAqB,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;AAE5E;;;;;;;GAOG;AACH,MAAM,CAAC,OAAO,UAAU,qBAAqB,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC"}
@@ -1,10 +1,13 @@
1
1
  export default function greatestCommonDivisor(a, b) {
2
- // Ensure that both of the integers are positive.
2
+ // Ensure that both of the integers are positive. Can't use `Math.abs` in case `a` and `b` are `bigint`s.
3
3
  let c = a < 0 ? -a : a;
4
4
  let d = b < 0 ? -b : b;
5
5
  // Apply the Euclidean algorithm.
6
6
  while (d) {
7
- [c, d] = [d, c % d];
7
+ // `[c, d] = [d, (c as number) % (d as number)];`
8
+ const temp = c;
9
+ c = d;
10
+ d = temp % d;
8
11
  }
9
12
  return c;
10
13
  }
@@ -1 +1 @@
1
- {"version":3,"file":"greatestCommonDivisor.js","sourceRoot":"","sources":["../../src/algorithms/greatestCommonDivisor.ts"],"names":[],"mappings":"AAkBA,MAAM,CAAC,OAAO,UAAU,qBAAqB,CAC5C,CAAkB,EAClB,CAAkB;IAElB,iDAAiD;IACjD,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IACvB,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAEvB,iCAAiC;IACjC,OAAO,CAAC,EAAE,CAAC;QACV,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,EAAG,CAAY,GAAI,CAAY,CAAC,CAAC;IAC7C,CAAC;IAED,OAAO,CAAC,CAAC;AACV,CAAC"}
1
+ {"version":3,"file":"greatestCommonDivisor.js","sourceRoot":"","sources":["../../src/algorithms/greatestCommonDivisor.ts"],"names":[],"mappings":"AAoBA,MAAM,CAAC,OAAO,UAAU,qBAAqB,CAC5C,CAAkB,EAClB,CAAkB;IAElB,yGAAyG;IACzG,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IACvB,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAEvB,iCAAiC;IACjC,OAAO,CAAC,EAAE,CAAC;QACV,iDAAiD;QACjD,MAAM,IAAI,GAAG,CAAC,CAAC;QACf,CAAC,GAAG,CAAC,CAAC;QACN,CAAC,GAAI,IAAe,GAAI,CAAY,CAAC;IACtC,CAAC;IAED,OAAO,CAAC,CAAC;AACV,CAAC"}
@@ -4,8 +4,9 @@
4
4
  * @param K - The number of objects with the desired feature in the finite population.
5
5
  * @param n - The number of draws without replacement.
6
6
  * @param k - The desired number of successes.
7
- * @see [Hypergeometric distribution](https://en.wikipedia.org/wiki/Hypergeometric_distribution)
8
- * @see [Probability mass function](https://en.wikipedia.org/wiki/Probability_mass_function)
7
+ * @see {@link https://en.wikipedia.org/wiki/Hypergeometric_distribution | Hypergeometric distribution}
8
+ * @see {@link https://en.wikipedia.org/wiki/Probability_mass_function | Probability mass function}
9
+ * @public
9
10
  */
10
11
  export default function hypergeometricPmf(N: number, K: number, n: number, k: number): number;
11
12
  //# sourceMappingURL=hypergeometricPmf.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"hypergeometricPmf.d.ts","sourceRoot":"","sources":["../../src/algorithms/hypergeometricPmf.ts"],"names":[],"mappings":"AAEA;;;;;;;;GAQG;AACH,MAAM,CAAC,OAAO,UAAU,iBAAiB,CACxC,CAAC,EAAE,MAAM,EACT,CAAC,EAAE,MAAM,EACT,CAAC,EAAE,MAAM,EACT,CAAC,EAAE,MAAM,GACP,MAAM,CAER"}
1
+ {"version":3,"file":"hypergeometricPmf.d.ts","sourceRoot":"","sources":["../../src/algorithms/hypergeometricPmf.ts"],"names":[],"mappings":"AAEA;;;;;;;;;GASG;AACH,MAAM,CAAC,OAAO,UAAU,iBAAiB,CACxC,CAAC,EAAE,MAAM,EACT,CAAC,EAAE,MAAM,EACT,CAAC,EAAE,MAAM,EACT,CAAC,EAAE,MAAM,GACP,MAAM,CAER"}
@@ -5,8 +5,9 @@ import combinations from "./combinations.js";
5
5
  * @param K - The number of objects with the desired feature in the finite population.
6
6
  * @param n - The number of draws without replacement.
7
7
  * @param k - The desired number of successes.
8
- * @see [Hypergeometric distribution](https://en.wikipedia.org/wiki/Hypergeometric_distribution)
9
- * @see [Probability mass function](https://en.wikipedia.org/wiki/Probability_mass_function)
8
+ * @see {@link https://en.wikipedia.org/wiki/Hypergeometric_distribution | Hypergeometric distribution}
9
+ * @see {@link https://en.wikipedia.org/wiki/Probability_mass_function | Probability mass function}
10
+ * @public
10
11
  */
11
12
  export default function hypergeometricPmf(N, K, n, k) {
12
13
  return (combinations(K, k) * combinations(N - K, n - k)) / combinations(N, n);
@@ -1 +1 @@
1
- {"version":3,"file":"hypergeometricPmf.js","sourceRoot":"","sources":["../../src/algorithms/hypergeometricPmf.ts"],"names":[],"mappings":"AAAA,OAAO,YAAY,MAAM,mBAAmB,CAAC;AAE7C;;;;;;;;GAQG;AACH,MAAM,CAAC,OAAO,UAAU,iBAAiB,CACxC,CAAS,EACT,CAAS,EACT,CAAS,EACT,CAAS;IAET,OAAO,CAAC,YAAY,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,YAAY,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,YAAY,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;AAC/E,CAAC"}
1
+ {"version":3,"file":"hypergeometricPmf.js","sourceRoot":"","sources":["../../src/algorithms/hypergeometricPmf.ts"],"names":[],"mappings":"AAAA,OAAO,YAAY,MAAM,mBAAmB,CAAC;AAE7C;;;;;;;;;GASG;AACH,MAAM,CAAC,OAAO,UAAU,iBAAiB,CACxC,CAAS,EACT,CAAS,EACT,CAAS,EACT,CAAS;IAET,OAAO,CAAC,YAAY,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,YAAY,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,YAAY,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;AAC/E,CAAC"}
@@ -2,7 +2,8 @@
2
2
  * Returns whether or not a number is prime.
3
3
  * @param n - The number.
4
4
  * @returns Whether or not the number is prime.
5
- * @see [Prime number](https://en.wikipedia.org/wiki/Prime_number)
5
+ * @see {@link https://en.wikipedia.org/wiki/Prime_number | Prime number}
6
+ * @public
6
7
  */
7
8
  export default function isPrime(n: number): boolean;
8
9
  //# sourceMappingURL=isPrime.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"isPrime.d.ts","sourceRoot":"","sources":["../../src/algorithms/isPrime.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,CAAC,OAAO,UAAU,OAAO,CAAC,CAAC,EAAE,MAAM,GAAG,OAAO,CAalD"}
1
+ {"version":3,"file":"isPrime.d.ts","sourceRoot":"","sources":["../../src/algorithms/isPrime.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,MAAM,CAAC,OAAO,UAAU,OAAO,CAAC,CAAC,EAAE,MAAM,GAAG,OAAO,CAalD"}
@@ -2,7 +2,8 @@
2
2
  * Returns whether or not a number is prime.
3
3
  * @param n - The number.
4
4
  * @returns Whether or not the number is prime.
5
- * @see [Prime number](https://en.wikipedia.org/wiki/Prime_number)
5
+ * @see {@link https://en.wikipedia.org/wiki/Prime_number | Prime number}
6
+ * @public
6
7
  */
7
8
  export default function isPrime(n) {
8
9
  // Negatives, zero, and one can't be prime.
@@ -1 +1 @@
1
- {"version":3,"file":"isPrime.js","sourceRoot":"","sources":["../../src/algorithms/isPrime.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,CAAC,OAAO,UAAU,OAAO,CAAC,CAAS;IACxC,2CAA2C;IAC3C,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC;QACX,OAAO,KAAK,CAAC;IACd,CAAC;IAED,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;QACjC,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC;YACjB,OAAO,KAAK,CAAC;QACd,CAAC;IACF,CAAC;IAED,OAAO,IAAI,CAAC;AACb,CAAC"}
1
+ {"version":3,"file":"isPrime.js","sourceRoot":"","sources":["../../src/algorithms/isPrime.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,MAAM,CAAC,OAAO,UAAU,OAAO,CAAC,CAAS;IACxC,2CAA2C;IAC3C,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC;QACX,OAAO,KAAK,CAAC;IACd,CAAC;IAED,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;QACjC,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC;YACjB,OAAO,KAAK,CAAC;QACd,CAAC;IACF,CAAC;IAED,OAAO,IAAI,CAAC;AACb,CAAC"}
@@ -3,7 +3,8 @@
3
3
  * @param n - The total number of units.
4
4
  * @param r - The number of units taken at a time.
5
5
  * @returns The number of permutations.
6
- * @see [Permutation](https://en.wikipedia.org/wiki/Permutation)
6
+ * @see {@link https://en.wikipedia.org/wiki/Permutation | Permutation}
7
+ * @public
7
8
  */
8
9
  export default function permutations(n: number, r: number): number;
9
10
  //# sourceMappingURL=permutations.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"permutations.d.ts","sourceRoot":"","sources":["../../src/algorithms/permutations.ts"],"names":[],"mappings":"AAEA;;;;;;GAMG;AACH,MAAM,CAAC,OAAO,UAAU,YAAY,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAEjE"}
1
+ {"version":3,"file":"permutations.d.ts","sourceRoot":"","sources":["../../src/algorithms/permutations.ts"],"names":[],"mappings":"AAEA;;;;;;;GAOG;AACH,MAAM,CAAC,OAAO,UAAU,YAAY,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAEjE"}
@@ -4,7 +4,8 @@ import factorial from "./factorial.js";
4
4
  * @param n - The total number of units.
5
5
  * @param r - The number of units taken at a time.
6
6
  * @returns The number of permutations.
7
- * @see [Permutation](https://en.wikipedia.org/wiki/Permutation)
7
+ * @see {@link https://en.wikipedia.org/wiki/Permutation | Permutation}
8
+ * @public
8
9
  */
9
10
  export default function permutations(n, r) {
10
11
  return factorial(n) / factorial(n - r);
@@ -1 +1 @@
1
- {"version":3,"file":"permutations.js","sourceRoot":"","sources":["../../src/algorithms/permutations.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,gBAAgB,CAAC;AAEvC;;;;;;GAMG;AACH,MAAM,CAAC,OAAO,UAAU,YAAY,CAAC,CAAS,EAAE,CAAS;IACxD,OAAO,SAAS,CAAC,CAAC,CAAC,GAAG,SAAS,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;AACxC,CAAC"}
1
+ {"version":3,"file":"permutations.js","sourceRoot":"","sources":["../../src/algorithms/permutations.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,gBAAgB,CAAC;AAEvC;;;;;;;GAOG;AACH,MAAM,CAAC,OAAO,UAAU,YAAY,CAAC,CAAS,EAAE,CAAS;IACxD,OAAO,SAAS,CAAC,CAAC,CAAC,GAAG,SAAS,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;AACxC,CAAC"}
@@ -2,7 +2,8 @@
2
2
  * Factor a number into a list of prime numbers.
3
3
  * @param n - The number to factor.
4
4
  * @returns A list of prime number factors of the number.
5
- * @see [Integer factorization](https://en.wikipedia.org/wiki/Integer_factorization)
5
+ * @see {@link https://en.wikipedia.org/wiki/Integer_factorization | Integer factorization}
6
+ * @public
6
7
  */
7
8
  export default function primeFactorization(n: number): number[];
8
9
  //# sourceMappingURL=primeFactorization.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"primeFactorization.d.ts","sourceRoot":"","sources":["../../src/algorithms/primeFactorization.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,CAAC,OAAO,UAAU,kBAAkB,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAe9D"}
1
+ {"version":3,"file":"primeFactorization.d.ts","sourceRoot":"","sources":["../../src/algorithms/primeFactorization.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,MAAM,CAAC,OAAO,UAAU,kBAAkB,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAe9D"}
@@ -2,7 +2,8 @@
2
2
  * Factor a number into a list of prime numbers.
3
3
  * @param n - The number to factor.
4
4
  * @returns A list of prime number factors of the number.
5
- * @see [Integer factorization](https://en.wikipedia.org/wiki/Integer_factorization)
5
+ * @see {@link https://en.wikipedia.org/wiki/Integer_factorization | Integer factorization}
6
+ * @public
6
7
  */
7
8
  export default function primeFactorization(n) {
8
9
  let m = n;
@@ -1 +1 @@
1
- {"version":3,"file":"primeFactorization.js","sourceRoot":"","sources":["../../src/algorithms/primeFactorization.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,CAAC,OAAO,UAAU,kBAAkB,CAAC,CAAS;IACnD,IAAI,CAAC,GAAG,CAAC,CAAC;IACV,MAAM,GAAG,GAAG,EAAE,CAAC;IACf,IAAI,OAAO,GAAG,CAAC,CAAC;IAChB,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC;QACf,IAAI,CAAC,GAAG,OAAO,KAAK,CAAC,EAAE,CAAC;YACvB,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;YAClB,CAAC,IAAI,OAAO,CAAC;YACb,SAAS;QACV,CAAC;QAED,OAAO,EAAE,CAAC;IACX,CAAC;IAED,OAAO,GAAG,CAAC;AACZ,CAAC"}
1
+ {"version":3,"file":"primeFactorization.js","sourceRoot":"","sources":["../../src/algorithms/primeFactorization.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,MAAM,CAAC,OAAO,UAAU,kBAAkB,CAAC,CAAS;IACnD,IAAI,CAAC,GAAG,CAAC,CAAC;IACV,MAAM,GAAG,GAAG,EAAE,CAAC;IACf,IAAI,OAAO,GAAG,CAAC,CAAC;IAChB,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC;QACf,IAAI,CAAC,GAAG,OAAO,KAAK,CAAC,EAAE,CAAC;YACvB,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;YAClB,CAAC,IAAI,OAAO,CAAC;YACb,SAAS;QACV,CAAC;QAED,OAAO,EAAE,CAAC;IACX,CAAC;IAED,OAAO,GAAG,CAAC;AACZ,CAAC"}
@@ -2,8 +2,9 @@
2
2
  * Convert a number of radians to an equivalent number of degrees.
3
3
  * @param radians - The number of radians.
4
4
  * @returns A number of degrees.
5
- * @see [Degree](https://en.wikipedia.org/wiki/Degree_(angle))
6
- * @see [Radian](https://en.wikipedia.org/wiki/Radian)
5
+ * @see {@link https://en.wikipedia.org/wiki/Degree_(angle) | Degree}
6
+ * @see {@link https://en.wikipedia.org/wiki/Radian | Radian}
7
+ * @public
7
8
  */
8
9
  export default function radiansToDegrees(radians: number): number;
9
10
  //# sourceMappingURL=radiansToDegrees.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"radiansToDegrees.d.ts","sourceRoot":"","sources":["../../src/algorithms/radiansToDegrees.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,MAAM,CAAC,OAAO,UAAU,gBAAgB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAEhE"}
1
+ {"version":3,"file":"radiansToDegrees.d.ts","sourceRoot":"","sources":["../../src/algorithms/radiansToDegrees.ts"],"names":[],"mappings":"AAEA;;;;;;;GAOG;AACH,MAAM,CAAC,OAAO,UAAU,gBAAgB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAEhE"}
@@ -1,11 +1,13 @@
1
+ const ratio = 180 / Math.PI;
1
2
  /**
2
3
  * Convert a number of radians to an equivalent number of degrees.
3
4
  * @param radians - The number of radians.
4
5
  * @returns A number of degrees.
5
- * @see [Degree](https://en.wikipedia.org/wiki/Degree_(angle))
6
- * @see [Radian](https://en.wikipedia.org/wiki/Radian)
6
+ * @see {@link https://en.wikipedia.org/wiki/Degree_(angle) | Degree}
7
+ * @see {@link https://en.wikipedia.org/wiki/Radian | Radian}
8
+ * @public
7
9
  */
8
10
  export default function radiansToDegrees(radians) {
9
- return (radians * 180) / Math.PI;
11
+ return radians * ratio;
10
12
  }
11
13
  //# sourceMappingURL=radiansToDegrees.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"radiansToDegrees.js","sourceRoot":"","sources":["../../src/algorithms/radiansToDegrees.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,MAAM,CAAC,OAAO,UAAU,gBAAgB,CAAC,OAAe;IACvD,OAAO,CAAC,OAAO,GAAG,GAAG,CAAC,GAAG,IAAI,CAAC,EAAE,CAAC;AAClC,CAAC"}
1
+ {"version":3,"file":"radiansToDegrees.js","sourceRoot":"","sources":["../../src/algorithms/radiansToDegrees.ts"],"names":[],"mappings":"AAAA,MAAM,KAAK,GAAG,GAAG,GAAG,IAAI,CAAC,EAAE,CAAC;AAE5B;;;;;;;GAOG;AACH,MAAM,CAAC,OAAO,UAAU,gBAAgB,CAAC,OAAe;IACvD,OAAO,OAAO,GAAG,KAAK,CAAC;AACxB,CAAC"}
@@ -4,7 +4,8 @@
4
4
  * @param max - The upper bound (inclusive) of the index of summation.
5
5
  * @param term - The function used to generate each term.
6
6
  * @returns The sum.
7
- * @see [Summation](https://en.wikipedia.org/wiki/Summation)
7
+ * @see {@link https://en.wikipedia.org/wiki/Summation | Summation}
8
+ * @public
8
9
  */
9
10
  export default function summation(min: number, max: number, term: (i: number) => number): number;
10
11
  //# sourceMappingURL=summation.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"summation.d.ts","sourceRoot":"","sources":["../../src/algorithms/summation.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,MAAM,CAAC,OAAO,UAAU,SAAS,CAChC,GAAG,EAAE,MAAM,EACX,GAAG,EAAE,MAAM,EACX,IAAI,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,MAAM,GACzB,MAAM,CAQR"}
1
+ {"version":3,"file":"summation.d.ts","sourceRoot":"","sources":["../../src/algorithms/summation.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,MAAM,CAAC,OAAO,UAAU,SAAS,CAChC,GAAG,EAAE,MAAM,EACX,GAAG,EAAE,MAAM,EACX,IAAI,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,MAAM,GACzB,MAAM,CAQR"}
@@ -4,7 +4,8 @@
4
4
  * @param max - The upper bound (inclusive) of the index of summation.
5
5
  * @param term - The function used to generate each term.
6
6
  * @returns The sum.
7
- * @see [Summation](https://en.wikipedia.org/wiki/Summation)
7
+ * @see {@link https://en.wikipedia.org/wiki/Summation | Summation}
8
+ * @public
8
9
  */
9
10
  export default function summation(min, max, term) {
10
11
  // Not recursive in order to avoid exceeding the maximum call stack size.
@@ -1 +1 @@
1
- {"version":3,"file":"summation.js","sourceRoot":"","sources":["../../src/algorithms/summation.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,MAAM,CAAC,OAAO,UAAU,SAAS,CAChC,GAAW,EACX,GAAW,EACX,IAA2B;IAE3B,yEAAyE;IACzE,IAAI,GAAG,GAAG,CAAC,CAAC;IACZ,KAAK,IAAI,CAAC,GAAG,GAAG,EAAE,CAAC,IAAI,GAAG,EAAE,CAAC,EAAE,EAAE,CAAC;QACjC,GAAG,IAAI,IAAI,CAAC,CAAC,CAAC,CAAC;IAChB,CAAC;IAED,OAAO,GAAG,CAAC;AACZ,CAAC"}
1
+ {"version":3,"file":"summation.js","sourceRoot":"","sources":["../../src/algorithms/summation.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,MAAM,CAAC,OAAO,UAAU,SAAS,CAChC,GAAW,EACX,GAAW,EACX,IAA2B;IAE3B,yEAAyE;IACzE,IAAI,GAAG,GAAG,CAAC,CAAC;IACZ,KAAK,IAAI,CAAC,GAAG,GAAG,EAAE,CAAC,IAAI,GAAG,EAAE,CAAC,EAAE,EAAE,CAAC;QACjC,GAAG,IAAI,IAAI,CAAC,CAAC,CAAC,CAAC;IAChB,CAAC;IAED,OAAO,GAAG,CAAC;AACZ,CAAC"}