pimath 0.2.11 → 0.2.13
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/dist/pimath.js +882 -907
- package/dist/pimath.js.map +1 -1
- package/package.json +3 -2
- package/src/algebra/equation.ts +3 -2
- package/src/algebra/equationSolver.ts +2 -1
- package/src/algebra/factor.ts +10 -9
- package/src/algebra/linearSystem.ts +10 -9
- package/src/algebra/logicalset.ts +8 -3
- package/src/algebra/matrix.ts +10 -9
- package/src/algebra/monom.ts +10 -4
- package/src/algebra/operations.ts +3 -2
- package/src/algebra/polyFactor.ts +5 -4
- package/src/algebra/polynom.ts +30 -30
- package/src/coefficients/fraction.ts +6 -5
- package/src/coefficients/root.ts +5 -4
- package/src/errors.ts +45 -0
- package/src/geometry/TupleN.ts +4 -3
- package/src/geometry/geomMath.ts +3 -2
- package/src/geometry/line.ts +4 -2
- package/src/geometry/line3.ts +7 -6
- package/src/geometry/plane3.ts +3 -2
- package/src/geometry/point.ts +5 -4
- package/src/geometry/sphere3.ts +6 -5
- package/src/geometry/triangle.ts +3 -2
- package/src/geometry/vector.ts +6 -5
- package/src/helpers.ts +3 -1
- package/src/index.ts +23 -0
- package/src/numeric.ts +2 -1
- package/src/randomization/rndHelpers.ts +2 -1
- package/types/algebra/equation.d.ts.map +1 -1
- package/types/algebra/equationSolver.d.ts.map +1 -1
- package/types/algebra/factor.d.ts.map +1 -1
- package/types/algebra/linearSystem.d.ts.map +1 -1
- package/types/algebra/logicalset.d.ts.map +1 -1
- package/types/algebra/matrix.d.ts.map +1 -1
- package/types/algebra/monom.d.ts.map +1 -1
- package/types/algebra/operations.d.ts.map +1 -1
- package/types/algebra/polyFactor.d.ts.map +1 -1
- package/types/algebra/polynom.d.ts.map +1 -1
- package/types/coefficients/fraction.d.ts.map +1 -1
- package/types/coefficients/root.d.ts.map +1 -1
- package/types/errors.d.ts +20 -0
- package/types/errors.d.ts.map +1 -0
- package/types/geometry/TupleN.d.ts.map +1 -1
- package/types/geometry/geomMath.d.ts.map +1 -1
- package/types/geometry/line.d.ts.map +1 -1
- package/types/geometry/line3.d.ts.map +1 -1
- package/types/geometry/plane3.d.ts.map +1 -1
- package/types/geometry/point.d.ts.map +1 -1
- package/types/geometry/sphere3.d.ts.map +1 -1
- package/types/geometry/triangle.d.ts.map +1 -1
- package/types/geometry/vector.d.ts.map +1 -1
- package/types/helpers.d.ts.map +1 -1
- package/types/index.d.ts +12 -0
- package/types/index.d.ts.map +1 -1
- package/types/numeric.d.ts.map +1 -1
- package/types/randomization/rndHelpers.d.ts.map +1 -1
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type {compareSign, IExpression, InputValue, IPiMathObject} from "../pimath.interface"
|
|
2
2
|
import {Numeric} from "../numeric"
|
|
3
|
+
import {InvalidArgumentError, MathError} from "../errors"
|
|
3
4
|
|
|
4
5
|
export enum FRAC_TYPE {
|
|
5
6
|
frac = 'frac',
|
|
@@ -263,7 +264,7 @@ export class Fraction implements IPiMathObject<Fraction>, IExpression<Fraction>
|
|
|
263
264
|
|
|
264
265
|
public amplify = (k: number): this => {
|
|
265
266
|
if (!Number.isSafeInteger(k)) {
|
|
266
|
-
throw new
|
|
267
|
+
throw new InvalidArgumentError("The amplification factor must be a safe integer.")
|
|
267
268
|
}
|
|
268
269
|
|
|
269
270
|
this.#numerator *= k
|
|
@@ -405,11 +406,11 @@ export class Fraction implements IPiMathObject<Fraction>, IExpression<Fraction>
|
|
|
405
406
|
const p: number = decimal ? decimal.length : 0
|
|
406
407
|
|
|
407
408
|
if (!Number.isSafeInteger(length) || length <= 0) {
|
|
408
|
-
throw new
|
|
409
|
+
throw new InvalidArgumentError("The periodic length must be a positive integer.")
|
|
409
410
|
}
|
|
410
411
|
|
|
411
412
|
if (length > p) {
|
|
412
|
-
throw new
|
|
413
|
+
throw new InvalidArgumentError(`The periodic length (${length}) cannot exceed the number of decimal digits (${p}).`)
|
|
413
414
|
}
|
|
414
415
|
|
|
415
416
|
const power = Math.pow(10, p)
|
|
@@ -661,7 +662,7 @@ export class Fraction implements IPiMathObject<Fraction>, IExpression<Fraction>
|
|
|
661
662
|
|
|
662
663
|
// if p is not a safe integer, throw error
|
|
663
664
|
if (!Number.isSafeInteger(p)) {
|
|
664
|
-
throw new
|
|
665
|
+
throw new InvalidArgumentError("The root must be an integer.")
|
|
665
666
|
}
|
|
666
667
|
|
|
667
668
|
// If negative, inverse the fraction
|
|
@@ -672,7 +673,7 @@ export class Fraction implements IPiMathObject<Fraction>, IExpression<Fraction>
|
|
|
672
673
|
|
|
673
674
|
// if the fraction is negative and the root is even, throw error
|
|
674
675
|
if (this.isNegative() && p % 2 === 0) {
|
|
675
|
-
throw new
|
|
676
|
+
throw new MathError("The root of a negative number must be odd.")
|
|
676
677
|
}
|
|
677
678
|
|
|
678
679
|
// get the sign of the fraction and make it positive
|
package/src/coefficients/root.ts
CHANGED
|
@@ -2,6 +2,7 @@ import {Fraction} from "./fraction"
|
|
|
2
2
|
import type {IExpression, InputValue, IPiMathObject} from "../pimath.interface"
|
|
3
3
|
import {stripParenthesis} from "../helpers"
|
|
4
4
|
import {Numeric} from "../numeric"
|
|
5
|
+
import {InvalidArgumentError, MathError, ParseError} from "../errors"
|
|
5
6
|
|
|
6
7
|
export class Root implements IPiMathObject<Root>, IExpression<Root> {
|
|
7
8
|
#factor: Fraction
|
|
@@ -109,7 +110,7 @@ export class Root implements IPiMathObject<Root>, IExpression<Root> {
|
|
|
109
110
|
this.index !== rt.index ||
|
|
110
111
|
!this.radical.isEqual(rt.radical)
|
|
111
112
|
) {
|
|
112
|
-
throw new
|
|
113
|
+
throw new MathError("Add can only be done with two same index and radical")
|
|
113
114
|
}
|
|
114
115
|
|
|
115
116
|
this.factor.add(rt.factor)
|
|
@@ -158,7 +159,7 @@ export class Root implements IPiMathObject<Root>, IExpression<Root> {
|
|
|
158
159
|
|
|
159
160
|
set index(value: number) {
|
|
160
161
|
if (!Number.isSafeInteger(value) || value <= 0) {
|
|
161
|
-
throw new
|
|
162
|
+
throw new InvalidArgumentError("Index must be a strictly positive integer.")
|
|
162
163
|
}
|
|
163
164
|
this.#index = value
|
|
164
165
|
}
|
|
@@ -212,7 +213,7 @@ export class Root implements IPiMathObject<Root>, IExpression<Root> {
|
|
|
212
213
|
return this
|
|
213
214
|
}
|
|
214
215
|
|
|
215
|
-
throw new
|
|
216
|
+
throw new MathError('Multiply can only be done if radical or index as equals.')
|
|
216
217
|
}
|
|
217
218
|
|
|
218
219
|
one(): this {
|
|
@@ -334,7 +335,7 @@ export class Root implements IPiMathObject<Root>, IExpression<Root> {
|
|
|
334
335
|
#parse_root(value: string): this {
|
|
335
336
|
// Format: [factor]root([index])[radical] or [factor]root([index])([radical])
|
|
336
337
|
const match = /^(.*?)root\((\d+)\)\(?([^)]+)/.exec(value)
|
|
337
|
-
if (!match) throw new
|
|
338
|
+
if (!match) throw new ParseError(`Invalid root format: "${value}"`)
|
|
338
339
|
|
|
339
340
|
const [, factor, index, radical] = match
|
|
340
341
|
this.index = +index
|
package/src/errors.ts
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Typed error hierarchy for PiMath.
|
|
3
|
+
*
|
|
4
|
+
* All PiMath errors extend {@link PiMathError}, so a consumer can catch every
|
|
5
|
+
* library error at once with `catch (e) { if (e instanceof PiMathError) ... }`,
|
|
6
|
+
* or discriminate a specific kind with `instanceof ParseError`, etc.
|
|
7
|
+
*
|
|
8
|
+
* The original error (e.g. piexpression's ParseError) is chained through the
|
|
9
|
+
* standard ES2022 `cause` option.
|
|
10
|
+
*/
|
|
11
|
+
export class PiMathError extends Error {
|
|
12
|
+
constructor(message: string, options?: { cause?: unknown }) {
|
|
13
|
+
super(message, options)
|
|
14
|
+
// Use the concrete subclass name (ParseError, MathError, ...).
|
|
15
|
+
this.name = new.target.name
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/** The input string cannot be parsed into the target object. */
|
|
20
|
+
export class ParseError extends PiMathError {
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/** Incompatible dimensions (matrix, vector, point, ...). */
|
|
24
|
+
export class DimensionError extends PiMathError {
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/** Mathematically invalid operation on otherwise valid inputs. */
|
|
28
|
+
export class MathError extends PiMathError {
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/** An argument is invalid (outside of string parsing). */
|
|
32
|
+
export class InvalidArgumentError extends PiMathError {
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/** The called method is not implemented yet. */
|
|
36
|
+
export class NotImplementedError extends PiMathError {
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/** An index is out of range. */
|
|
40
|
+
export class IndexError extends PiMathError {
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/** An operation was attempted on an object in an invalid/uninitialized state. */
|
|
44
|
+
export class StateError extends PiMathError {
|
|
45
|
+
}
|
package/src/geometry/TupleN.ts
CHANGED
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
import {Fraction} from "../coefficients"
|
|
8
8
|
import type {InputValue} from "../pimath.interface"
|
|
9
|
+
import {DimensionError} from "../errors"
|
|
9
10
|
|
|
10
11
|
export abstract class TupleN {
|
|
11
12
|
#array: Fraction[] = []
|
|
@@ -72,7 +73,7 @@ export abstract class TupleN {
|
|
|
72
73
|
|
|
73
74
|
setDimension(value = 2): this {
|
|
74
75
|
if (value < 2) {
|
|
75
|
-
throw new
|
|
76
|
+
throw new DimensionError('Dimension must be at least 2')
|
|
76
77
|
}
|
|
77
78
|
|
|
78
79
|
if (value < this.dimension) {
|
|
@@ -106,14 +107,14 @@ export abstract class TupleN {
|
|
|
106
107
|
|
|
107
108
|
get z(): Fraction {
|
|
108
109
|
if (this.dimension < 3) {
|
|
109
|
-
throw new
|
|
110
|
+
throw new DimensionError('Vector is not 3D')
|
|
110
111
|
}
|
|
111
112
|
return this.#array[2]
|
|
112
113
|
}
|
|
113
114
|
|
|
114
115
|
set z(value: Fraction | number | string) {
|
|
115
116
|
if (this.dimension < 3) {
|
|
116
|
-
throw new
|
|
117
|
+
throw new DimensionError('Vector is not 3D')
|
|
117
118
|
}
|
|
118
119
|
this.#array[2] = new Fraction(value)
|
|
119
120
|
this.#onChange?.()
|
package/src/geometry/geomMath.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import {Fraction} from "../coefficients"
|
|
2
2
|
import type {Vector} from "./vector"
|
|
3
3
|
import type {Point} from "./point"
|
|
4
|
+
import {DimensionError} from "../errors"
|
|
4
5
|
|
|
5
6
|
type V = Vector | Point
|
|
6
7
|
export function areVectorsEquals(v1: V, v2: V): boolean {
|
|
@@ -39,12 +40,12 @@ export function determinantFromVectors(...values: V[]): Fraction {
|
|
|
39
40
|
// TODO: Make it work for vectors of dimension n
|
|
40
41
|
// Check if the vectors are in the same dimension
|
|
41
42
|
if (values.some((value) => value.dimension !== values[0].dimension)) {
|
|
42
|
-
throw new
|
|
43
|
+
throw new DimensionError('All vectors must have the same dimension')
|
|
43
44
|
}
|
|
44
45
|
|
|
45
46
|
// Check if the vectors are in dimension 2 or 3 and that the number of values is correct
|
|
46
47
|
if (values[0].dimension !== values.length ) {
|
|
47
|
-
throw new
|
|
48
|
+
throw new DimensionError(`The determinant of dimension ${values[0].dimension} must have the same number of vectors (${values.length} given)`)
|
|
48
49
|
}
|
|
49
50
|
|
|
50
51
|
// Calculate the determinant 2x2
|
package/src/geometry/line.ts
CHANGED
|
@@ -10,6 +10,7 @@ import {type InputValue, type IPiMathObject, LinePropriety} from "../pimath.inte
|
|
|
10
10
|
import {randomIntSym} from "../randomization/rndHelpers"
|
|
11
11
|
import {Point} from "./point"
|
|
12
12
|
import {Root} from "../coefficients/root"
|
|
13
|
+
import {ParseError} from "../errors"
|
|
13
14
|
|
|
14
15
|
enum LINE_DISPLAY {
|
|
15
16
|
CARTESIAN,
|
|
@@ -83,12 +84,13 @@ export class Line implements IPiMathObject<Line> {
|
|
|
83
84
|
|
|
84
85
|
if (typeof values[0] === "string") {
|
|
85
86
|
// It's a string - create an Equation from it.
|
|
87
|
+
// A malformed string throws (ParseError) instead of silently
|
|
88
|
+
// returning a half-built Line.
|
|
86
89
|
try {
|
|
87
90
|
const E = new Equation(values[0])
|
|
88
91
|
return this.parse(E)
|
|
89
92
|
} catch (e) {
|
|
90
|
-
|
|
91
|
-
return this
|
|
93
|
+
throw new ParseError(`Cannot parse "${values[0]}" as a Line`, {cause: e})
|
|
92
94
|
}
|
|
93
95
|
}
|
|
94
96
|
}
|
package/src/geometry/line3.ts
CHANGED
|
@@ -6,6 +6,7 @@ import {Fraction} from "../coefficients/fraction"
|
|
|
6
6
|
import {Polynom} from "../algebra/polynom"
|
|
7
7
|
import {Monom} from "../algebra/monom"
|
|
8
8
|
import {randomIntSym} from "../randomization/rndHelpers"
|
|
9
|
+
import {NotImplementedError} from "../errors"
|
|
9
10
|
import {Vector} from "./vector"
|
|
10
11
|
import {Point} from "./point"
|
|
11
12
|
import {Line3Propriety} from "../pimath.interface"
|
|
@@ -134,7 +135,7 @@ export class Line3 {
|
|
|
134
135
|
|
|
135
136
|
intersection = (line: Line3): { point: Vector, hasIntersection: boolean, isParallel: boolean, isSame: boolean } => {
|
|
136
137
|
|
|
137
|
-
throw new
|
|
138
|
+
throw new NotImplementedError('Method not implemented.')
|
|
138
139
|
}
|
|
139
140
|
|
|
140
141
|
// ------------------------------------------
|
|
@@ -144,19 +145,19 @@ export class Line3 {
|
|
|
144
145
|
|
|
145
146
|
isParallelTo = (line: Line3): boolean => {
|
|
146
147
|
// Do they have the isSame direction ?
|
|
147
|
-
throw new
|
|
148
|
+
throw new NotImplementedError('Method not implemented.')
|
|
148
149
|
}
|
|
149
150
|
|
|
150
151
|
isPerpendicularTo = (line: Line3): boolean => {
|
|
151
|
-
throw new
|
|
152
|
+
throw new NotImplementedError('Method not implemented.')
|
|
152
153
|
}
|
|
153
154
|
|
|
154
155
|
isSameAs = (line: Line3): boolean => {
|
|
155
|
-
throw new
|
|
156
|
+
throw new NotImplementedError('Method not implemented.')
|
|
156
157
|
}
|
|
157
158
|
|
|
158
159
|
isVertical = (): boolean => {
|
|
159
|
-
throw new
|
|
160
|
+
throw new NotImplementedError('Method not implemented.')
|
|
160
161
|
}
|
|
161
162
|
|
|
162
163
|
get point(): Point {
|
|
@@ -196,7 +197,7 @@ export class Line3 {
|
|
|
196
197
|
// }
|
|
197
198
|
|
|
198
199
|
simplify = (): this => {
|
|
199
|
-
throw new
|
|
200
|
+
throw new NotImplementedError('Method not implemented.')
|
|
200
201
|
// const lcm = Numeric.lcm(this.#a.denominator, this.#b.denominator, this.#c.denominator),
|
|
201
202
|
// gcd = Numeric.gcd(this.#a.numerator, this.#b.numerator, this.#c.numerator)
|
|
202
203
|
|
package/src/geometry/plane3.ts
CHANGED
|
@@ -5,6 +5,7 @@ import {Line3} from "./line3"
|
|
|
5
5
|
import {Point} from "./point"
|
|
6
6
|
import {Vector} from "./vector"
|
|
7
7
|
import type {Plane3Config} from "../pimath.interface"
|
|
8
|
+
import {DimensionError, NotImplementedError} from "../errors"
|
|
8
9
|
|
|
9
10
|
|
|
10
11
|
export class Plane3 {
|
|
@@ -110,7 +111,7 @@ export class Plane3 {
|
|
|
110
111
|
let direction: Vector
|
|
111
112
|
if (value instanceof Vector) {
|
|
112
113
|
if (value.dimension !== 3) {
|
|
113
|
-
throw new
|
|
114
|
+
throw new DimensionError('Vector is not 3D')
|
|
114
115
|
}
|
|
115
116
|
|
|
116
117
|
direction = value
|
|
@@ -153,7 +154,7 @@ export class Plane3 {
|
|
|
153
154
|
// Solve the asSystem:
|
|
154
155
|
// p1 // p2 // z=0
|
|
155
156
|
const pt = new Point(0, 0, 0)
|
|
156
|
-
throw new
|
|
157
|
+
throw new NotImplementedError('Intersection with plane not yet implemented !')
|
|
157
158
|
return new Line3(pt, direction)
|
|
158
159
|
}
|
|
159
160
|
|
package/src/geometry/point.ts
CHANGED
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
import {Fraction} from "../coefficients"
|
|
8
8
|
import type {InputValue} from "../pimath.interface"
|
|
9
|
+
import {DimensionError, InvalidArgumentError, ParseError} from "../errors"
|
|
9
10
|
import {Root} from "../coefficients/root"
|
|
10
11
|
import {TupleN} from "./TupleN"
|
|
11
12
|
import type {Vector} from "./vector"
|
|
@@ -37,13 +38,13 @@ export class Point extends TupleN {
|
|
|
37
38
|
|
|
38
39
|
if (values.length > 1) {
|
|
39
40
|
if (values.some(x => x instanceof Point)) {
|
|
40
|
-
throw new
|
|
41
|
+
throw new InvalidArgumentError('Creating a point with multiple argument requires an input fraction')
|
|
41
42
|
}
|
|
42
43
|
|
|
43
44
|
const nbs: Fraction[] = values.map(x => new Fraction(x as InputValue<Fraction>))
|
|
44
45
|
|
|
45
46
|
if (nbs.some(x => x.isNaN())) {
|
|
46
|
-
throw new
|
|
47
|
+
throw new ParseError('The given values are not a valid point string (a,b): ')
|
|
47
48
|
}
|
|
48
49
|
|
|
49
50
|
this.array = nbs
|
|
@@ -66,7 +67,7 @@ export class Point extends TupleN {
|
|
|
66
67
|
|
|
67
68
|
distanceTo(B: Point): Root {
|
|
68
69
|
if (this.dimension !== B.dimension) {
|
|
69
|
-
throw new
|
|
70
|
+
throw new DimensionError('The two points must have the same dimensions.')
|
|
70
71
|
}
|
|
71
72
|
|
|
72
73
|
const AB = this.array
|
|
@@ -91,7 +92,7 @@ export class Point extends TupleN {
|
|
|
91
92
|
|
|
92
93
|
middleOf(V1: Point, V2: Point): this {
|
|
93
94
|
if (V1.dimension !== V2.dimension) {
|
|
94
|
-
throw new
|
|
95
|
+
throw new DimensionError('Vectors must be the same dimension')
|
|
95
96
|
}
|
|
96
97
|
|
|
97
98
|
this.array = []
|
package/src/geometry/sphere3.ts
CHANGED
|
@@ -2,6 +2,7 @@ import {Point} from "./point"
|
|
|
2
2
|
import {Fraction} from "../coefficients"
|
|
3
3
|
import {Equation, Polynom} from "../algebra"
|
|
4
4
|
import type {InputValue} from "../pimath.interface"
|
|
5
|
+
import {StateError} from "../errors"
|
|
5
6
|
|
|
6
7
|
enum SPHERE3_FORMAT {
|
|
7
8
|
DEVELOPPED,
|
|
@@ -66,21 +67,21 @@ export class Sphere3 {
|
|
|
66
67
|
|
|
67
68
|
get center(): Point {
|
|
68
69
|
if (this.#center === undefined) {
|
|
69
|
-
throw new
|
|
70
|
+
throw new StateError('Sphere3 is undefined')
|
|
70
71
|
}
|
|
71
72
|
return this.#center
|
|
72
73
|
}
|
|
73
74
|
|
|
74
75
|
get squareRadius(): Fraction {
|
|
75
76
|
if (this.#squareRadius === undefined) {
|
|
76
|
-
throw new
|
|
77
|
+
throw new StateError('Sphere3 is undefined')
|
|
77
78
|
}
|
|
78
79
|
return this.#squareRadius
|
|
79
80
|
}
|
|
80
81
|
|
|
81
82
|
get radius(): { tex: string, display: string, value: number } {
|
|
82
83
|
if (this.#squareRadius === undefined) {
|
|
83
|
-
throw new
|
|
84
|
+
throw new StateError('Sphere3 is undefined')
|
|
84
85
|
}
|
|
85
86
|
|
|
86
87
|
if (this.#squareRadius.isSquare()) {
|
|
@@ -100,7 +101,7 @@ export class Sphere3 {
|
|
|
100
101
|
|
|
101
102
|
get equation(): Equation {
|
|
102
103
|
if (this.#equation === undefined) {
|
|
103
|
-
throw new
|
|
104
|
+
throw new StateError('Sphere3 is undefined')
|
|
104
105
|
}
|
|
105
106
|
return this.#equation
|
|
106
107
|
}
|
|
@@ -133,7 +134,7 @@ export class Sphere3 {
|
|
|
133
134
|
|
|
134
135
|
#output = (asTex: boolean): string => {
|
|
135
136
|
if (this.#equation === undefined) {
|
|
136
|
-
throw new
|
|
137
|
+
throw new StateError('Sphere3 is undefined')
|
|
137
138
|
}
|
|
138
139
|
|
|
139
140
|
if (this.#format === SPHERE3_FORMAT.DEVELOPPED) {
|
package/src/geometry/triangle.ts
CHANGED
|
@@ -4,6 +4,7 @@ import {Vector} from "./vector"
|
|
|
4
4
|
import {Point} from "./point"
|
|
5
5
|
import type {InputValue, remarquableLines} from "../pimath.interface"
|
|
6
6
|
import {Numeric} from "../numeric"
|
|
7
|
+
import {IndexError, InvalidArgumentError} from "../errors"
|
|
7
8
|
|
|
8
9
|
type TRIANGLE_SIDES = 'AB' | 'AC' | 'BC'
|
|
9
10
|
|
|
@@ -62,7 +63,7 @@ export class Triangle {
|
|
|
62
63
|
const v: Fraction[] = values.map((x: unknown) => new Fraction(x as string))
|
|
63
64
|
|
|
64
65
|
if (v.some(x => x.isNaN())) {
|
|
65
|
-
throw new
|
|
66
|
+
throw new InvalidArgumentError('One of the values is not a valid number')
|
|
66
67
|
}
|
|
67
68
|
|
|
68
69
|
return this.fromCoordinates(v[0], v[1], v[2], v[3], v[4], v[5])
|
|
@@ -436,7 +437,7 @@ export class Triangle {
|
|
|
436
437
|
}
|
|
437
438
|
|
|
438
439
|
if (d1 === undefined || d2 === undefined) {
|
|
439
|
-
throw new
|
|
440
|
+
throw new IndexError(`The point ${pt} does not exist`)
|
|
440
441
|
}
|
|
441
442
|
|
|
442
443
|
const director = internal
|
package/src/geometry/vector.ts
CHANGED
|
@@ -6,6 +6,7 @@ import type {InputValue, IPiMathObject} from "../pimath.interface"
|
|
|
6
6
|
import {Fraction} from "../coefficients"
|
|
7
7
|
import {Numeric} from "../numeric"
|
|
8
8
|
import {areVectorsColinears, areVectorsEquals, dotProduct} from "./geomMath"
|
|
9
|
+
import {DimensionError, InvalidArgumentError} from "../errors"
|
|
9
10
|
import {TupleN} from "./TupleN"
|
|
10
11
|
import {type Point} from "./point"
|
|
11
12
|
|
|
@@ -25,7 +26,7 @@ export class Vector extends TupleN implements IPiMathObject<Vector> {
|
|
|
25
26
|
|
|
26
27
|
public parse(...values: (Vector | Point)[] | InputValue<Fraction>[]): this {
|
|
27
28
|
if (values.length === 0) {
|
|
28
|
-
throw new
|
|
29
|
+
throw new InvalidArgumentError(`Invalid value`)
|
|
29
30
|
}
|
|
30
31
|
|
|
31
32
|
if (values.length === 1) {
|
|
@@ -38,7 +39,7 @@ export class Vector extends TupleN implements IPiMathObject<Vector> {
|
|
|
38
39
|
return this.fromString(values[0])
|
|
39
40
|
}
|
|
40
41
|
|
|
41
|
-
throw new
|
|
42
|
+
throw new InvalidArgumentError(`Invalid value`)
|
|
42
43
|
}
|
|
43
44
|
|
|
44
45
|
// Two values are given
|
|
@@ -48,7 +49,7 @@ export class Vector extends TupleN implements IPiMathObject<Vector> {
|
|
|
48
49
|
// The two values are vectors
|
|
49
50
|
if (A instanceof TupleN && B instanceof TupleN) {
|
|
50
51
|
if (A.dimension !== B.dimension) {
|
|
51
|
-
throw new
|
|
52
|
+
throw new DimensionError('Vectors must have the same dimension')
|
|
52
53
|
}
|
|
53
54
|
|
|
54
55
|
this.array = B.array.map((x, index) => x.clone().subtract(A.array[index]))
|
|
@@ -100,7 +101,7 @@ export class Vector extends TupleN implements IPiMathObject<Vector> {
|
|
|
100
101
|
|
|
101
102
|
cross(value: Vector): Vector {
|
|
102
103
|
if (this.dimension !== 3 || value.dimension !== 3) {
|
|
103
|
-
throw new
|
|
104
|
+
throw new DimensionError('Cross product can only be determined in 3D')
|
|
104
105
|
}
|
|
105
106
|
|
|
106
107
|
return new Vector(
|
|
@@ -171,7 +172,7 @@ export class Vector extends TupleN implements IPiMathObject<Vector> {
|
|
|
171
172
|
|
|
172
173
|
normal = (): this => {
|
|
173
174
|
if (this.dimension >= 3) {
|
|
174
|
-
throw new
|
|
175
|
+
throw new DimensionError('Normal vector can only be determined in 2D')
|
|
175
176
|
}
|
|
176
177
|
|
|
177
178
|
const x = this.x.clone().opposite()
|
package/src/helpers.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import {InvalidArgumentError} from "./errors"
|
|
2
|
+
|
|
1
3
|
export function wrapParenthesis(str: string, tex = true): string {
|
|
2
4
|
return tex ? `\\left( ${str} \\right)` : `(${str})`
|
|
3
5
|
}
|
|
@@ -40,7 +42,7 @@ export function splitIfOutsideParentheses(
|
|
|
40
42
|
splitChar: string,
|
|
41
43
|
): string[] {
|
|
42
44
|
if (splitChar.length !== 1) {
|
|
43
|
-
throw new
|
|
45
|
+
throw new InvalidArgumentError(`splitChar must be a single character, got: "${splitChar}"`)
|
|
44
46
|
}
|
|
45
47
|
|
|
46
48
|
let depth = 0,
|
package/src/index.ts
CHANGED
|
@@ -17,11 +17,24 @@ import {NumExp} from "piexpression"
|
|
|
17
17
|
// randomization
|
|
18
18
|
import {Random} from "./randomization/random"
|
|
19
19
|
|
|
20
|
+
// Errors
|
|
21
|
+
import {
|
|
22
|
+
PiMathError,
|
|
23
|
+
ParseError,
|
|
24
|
+
DimensionError,
|
|
25
|
+
MathError,
|
|
26
|
+
InvalidArgumentError,
|
|
27
|
+
NotImplementedError,
|
|
28
|
+
IndexError,
|
|
29
|
+
StateError
|
|
30
|
+
} from "./errors"
|
|
31
|
+
|
|
20
32
|
// export everything to make them available as module
|
|
21
33
|
export * from "./coefficients"
|
|
22
34
|
export * from "./algebra"
|
|
23
35
|
export * from "./geometry"
|
|
24
36
|
export * from "./analyze"
|
|
37
|
+
export * from "./errors"
|
|
25
38
|
|
|
26
39
|
export {Numeric}
|
|
27
40
|
export {NumExp}
|
|
@@ -55,6 +68,16 @@ const PiMath = {
|
|
|
55
68
|
Plane3,
|
|
56
69
|
Sphere3
|
|
57
70
|
},
|
|
71
|
+
Errors: {
|
|
72
|
+
PiMathError,
|
|
73
|
+
ParseError,
|
|
74
|
+
DimensionError,
|
|
75
|
+
MathError,
|
|
76
|
+
InvalidArgumentError,
|
|
77
|
+
NotImplementedError,
|
|
78
|
+
IndexError,
|
|
79
|
+
StateError
|
|
80
|
+
},
|
|
58
81
|
NumExp
|
|
59
82
|
}
|
|
60
83
|
|
package/src/numeric.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import {NotImplementedError} from "./errors"
|
|
1
2
|
|
|
2
3
|
function decompose(value: number): number[][] {
|
|
3
4
|
const divs: number[] = dividers(value)
|
|
@@ -131,7 +132,7 @@ function periodic(value: number): number {
|
|
|
131
132
|
}
|
|
132
133
|
|
|
133
134
|
// Find the periodic if it exists.
|
|
134
|
-
throw new
|
|
135
|
+
throw new NotImplementedError('Periodic value: Not implemented yet')
|
|
135
136
|
}
|
|
136
137
|
|
|
137
138
|
/**
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
* Random helpers
|
|
3
3
|
*/
|
|
4
4
|
import {Numeric} from "../numeric"
|
|
5
|
+
import {InvalidArgumentError} from "../errors"
|
|
5
6
|
|
|
6
7
|
|
|
7
8
|
/**
|
|
@@ -38,7 +39,7 @@ export function randomInt(a: number, b?: number, exclude?: number[]): number {
|
|
|
38
39
|
|
|
39
40
|
// With exclusion
|
|
40
41
|
if (Math.abs(b - a) <= exclude.length) {
|
|
41
|
-
throw new
|
|
42
|
+
throw new InvalidArgumentError('The number of excluded values is too high.')
|
|
42
43
|
}
|
|
43
44
|
|
|
44
45
|
let r = randomInt(a, b)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"equation.d.ts","sourceRoot":"","sources":["../../src/algebra/equation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACR,aAAa,EACb,QAAQ,EACR,SAAS,EACT,YAAY,EACZ,UAAU,EACV,aAAa,EACb,WAAW,EACd,MAAM,qBAAqB,CAAA;AAC5B,OAAO,EAAC,QAAQ,EAAC,MAAM,iBAAiB,CAAA;
|
|
1
|
+
{"version":3,"file":"equation.d.ts","sourceRoot":"","sources":["../../src/algebra/equation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACR,aAAa,EACb,QAAQ,EACR,SAAS,EACT,YAAY,EACZ,UAAU,EACV,aAAa,EACb,WAAW,EACd,MAAM,qBAAqB,CAAA;AAC5B,OAAO,EAAC,QAAQ,EAAC,MAAM,iBAAiB,CAAA;AAKxC,OAAO,EAAC,OAAO,EAAC,MAAM,WAAW,CAAA;AACjC,OAAO,KAAK,EAAC,QAAQ,EAAC,MA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],"names":[],"mappings":"AACA,OAAO,KAAK,EAAC,OAAO,EAAC,MAAM,WAAW,CAAA;AAGtC,OAAO,KAAK,EAAC,QAAQ,EAAC,MAAM,YAAY,CAAA;AACxC,OAAO,EAAC,QAAQ,EAAC,MAAM,YAAY,CAAA;
|
|
1
|
+
{"version":3,"file":"equationSolver.d.ts","sourceRoot":"","sources":["../../src/algebra/equationSolver.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAC,OAAO,EAAC,MAAM,WAAW,CAAA;AAGtC,OAAO,KAAK,EAAC,QAAQ,EAAC,MAAM,YAAY,CAAA;AACxC,OAAO,EAAC,QAAQ,EAAC,MAAM,YAAY,CAAA;AAGnC,qBAAa,cAAc;;IACvB,CAAC,EAAE,MAAM,CAAA;gBAKG,IAAI,EAAE,OAAO,GAAG,QAAQ,EAAE,KAAK,CAAC,EAAE,OAAO,EAAE,QAAQ,SAAM;IAgBrE,IAAI,2BAA2B,WAE9B;IAED,IAAI,gBAAgB,IAIQ,MAAM,CAFjC;IAED,IAAI,gBAAgB,CAAC,KAAK,EAAE,MAAM,EAEjC;IAEM,KAAK,IAAI,QAAQ,EAAE;IAqCnB,aAAa,IAAI,QAAQ,EAAE;CAyZrC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"factor.d.ts","sourceRoot":"","sources":["../../src/algebra/factor.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACR,QAAQ,EACR,WAAW,EACX,YAAY,EACZ,UAAU,EACV,aAAa,EACb,WAAW,EACX,cAAc,EACjB,MAAM,qBAAqB,CAAA;AAC5B,OAAO,EAAC,QAAQ,EAAC,MAAM,0BAA0B,CAAA;AACjD,OAAO,EAAC,OAAO,EAAC,MAAM,WAAW,CAAA;
|
|
1
|
+
{"version":3,"file":"factor.d.ts","sourceRoot":"","sources":["../../src/algebra/factor.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACR,QAAQ,EACR,WAAW,EACX,YAAY,EACZ,UAAU,EACV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C,EAAE;IA2B/D,QAAQ,CAAC,KAAK,EAAE,UAAU,CAAC,YAAY,GAAG,QAAQ,GAAG,OAAO,CAAC,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI;IAqB3F,IAAW,SAAS,IAAI,MAAM,EAAE,CAE/B;IAED,IAAW,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,EAI5C;CA4DJ"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logicalset.d.ts","sourceRoot":"","sources":["../../src/algebra/logicalset.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"logicalset.d.ts","sourceRoot":"","sources":["../../src/algebra/logicalset.ts"],"names":[],"mappings":"AAUA,qBAAa,UAAU;;gBAOP,KAAK,CAAC,EAAE,MAAM;IAU1B,KAAK,GAAI,OAAO,MAAM,KAAG,IAAI,CAW5B;IAED,IAAI,GAAG,IAAI,MAAM,CAsEhB;IAED,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,OAAO;IA+ClD,IAAI,GAAG,IAAI;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,MAAM,CAAA;KAAE,EAAE,CAEhD;IAED,IAAI,SAAS,IAAI,MAAM,EAAE,CAIxB;IAED,MAAM,IAAI,MAAM,EAAE;IASlB,OAAO,IAAI,MAAM,EAAE;CAiFtB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"matrix.d.ts","sourceRoot":"","sources":["../../src/algebra/matrix.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,mBAAmB,EAAE,YAAY,EAAE,UAAU,EAAE,aAAa,EAAC,MAAM,qBAAqB,CAAA;AACrG,OAAO,EAAC,OAAO,EAAC,MAAM,WAAW,CAAA;AACjC,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,aAAa,CAAA;
|
|
1
|
+
{"version":3,"file":"matrix.d.ts","sourceRoot":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CAAC,GAAG,IAAI;IAWzE,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAYpC,OAAO,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAKrB,SAAS,IAAI,IAAI;IAUxB,IAAI,MAAM,IAAI,OAAO,EAAE,EAAE,CAExB;IAEM,IAAI,IAAI,IAAI;CAItB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"monom.d.ts","sourceRoot":"","sources":["../../src/algebra/monom.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACR,QAAQ,EACR,QAAQ,EACR,WAAW,EACX,YAAY,EACZ,UAAU,EACV,aAAa,EACb,WAAW,EACd,MAAM,qBAAqB,CAAA;AAC5B,OAAO,EAAC,QAAQ,EAAC,MAAM,iBAAiB,CAAA;
|
|
1
|
+
{"version":3,"file":"monom.d.ts","sourceRoot":"","sources":["../../src/algebra/monom.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACR,QAAQ,EACR,QAAQ,EACR,WAAW,EACX,YAAY,EACZ,UAAU,EACV,aAAa,EACb,WAAW,EACd,MAAM,qBAAqB,CAAA;AAC5B,OAAO,EAAC,QAAQ,EAAC,MAAM,iBAAiB,CAAA;AAMxC,qBAAa,KAAM,YAAW,aAAa,CAAC,KAAK,CAAC,EAAE,WAAW,CAAC,KAAK,CAAC,EAAE,QAAQ,CAAC,KAAK,CAAC,EAAE,QAAQ,CAAC,KAAK,CAAC;;gBAIxF,KAAK,CAAC,EAAE,UAAU,CAAC,QAAQ,CAAC;gBAC5B,KAAK,CAAC,EAAE,KAAK;IAkBlB,KAAK,CAAC,QAAQ,EAAE,YAAY,CAAC,KAAK,CAAC,GAAG,IAAI;IAmC1C,KAAK,QAAO,KAAK,CAUvB;IAKD,IAAW,GAAG,IAAI,MAAM,CAEvB;IAMD,IAAW,OAAO,IAAI,MAAM,CAE3B;IAED,OAAc,GAAG,GAAI,GAAG,QAAQ,KAAK,EAAE,KAAG,KAAK,CAiC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AAO,CAAC,CAAC,EAAE,WAAW,CAAC,QAAQ,CAAC,EAE1C;IAMD,IAAW,UAAU,CAAC,QAAQ,EAAE,MAAM,EAsBrC;IAMM,QAAQ,GAAI,GAAG,GAAG,YAAY,CAAC,QAAQ,CAAC,EAAE,KAAG,IAAI,CAkBvD;IAKM,GAAG,QAAO,IAAI,CAIpB;IAMM,QAAQ,QAAO,IAAI,CAGzB;IAED,IAAW,YAAY,IAAI,MAAM,CAEhC;IAMM,GAAG,GAAI,IAAI,MAAM,GAAG,QAAQ,KAAG,IAAI,CAMzC;IAEM,SAAS,GAAI,eAAY,KAAG,KAAK,CAoBvC;IAEM,MAAM,QAAO,IAAI,CAWvB;IAEM,cAAc,CAAC,MAAM,EAAE,MAAM;IAU7B,IAAI,QAAO,IAAI,CAGrB;IAOM,SAAS,GAAI,QAAQ,MAAM,EAAE,KAAK,UAAU,CAAC,QAAQ,CAAC,KAAG,IAAI,CAenE;IAKM,IAAI,QAAO,IAAI,CAUrB;IAMM,QAAQ,GAAI,GAAG,GAAG,YAAY,CAAC,QAAQ,CAAC,EAAE,KAAG,IAAI,CAgBvD;IAMD,IAAW,SAAS,IAAI,MAAM,EAAE,CAa/B;IAKM,IAAI,QAAO,IAAI,CAIrB;CA0LJ"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"operations.d.ts","sourceRoot":"","sources":["../../src/algebra/operations.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,mBAAmB,EAAE,aAAa,EAAC,MAAM,qBAAqB,CAAA;
|
|
1
|
+
{"version":3,"file":"operations.d.ts","sourceRoot":"","sources":["../../src/algebra/operations.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,mBAAmB,EAAE,aAAa,EAAC,MAAM,qBAAqB,CAAA;AAI3E,wBAAgB,aAAa,CAAC,CAAC,SAAS,aAAa,CAAC,CAAC,CAAC,GAAG,mBAAmB,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,GAAG,CAAC,CAmB5G"}
|