math-exercises 2.2.21 → 2.2.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/exercises/exercise.d.ts +22 -0
- package/lib/exercises/exercise.d.ts.map +1 -1
- package/lib/exercises/math/calcul/arithmetics/divisibiltyCriteria.d.ts +8 -0
- package/lib/exercises/math/calcul/arithmetics/divisibiltyCriteria.d.ts.map +1 -0
- package/lib/exercises/math/calcul/arithmetics/divisibiltyCriteria.js +107 -0
- package/lib/exercises/math/calcul/arithmetics/index.d.ts +1 -0
- package/lib/exercises/math/calcul/arithmetics/index.d.ts.map +1 -1
- package/lib/exercises/math/calcul/arithmetics/index.js +1 -0
- package/lib/exercises/math/calcul/fractions/fractionsSumsSameDenominators.js +1 -1
- package/lib/exercises/math/calculLitteral/distributivity/canonicalFormDevelopment.js +1 -1
- package/lib/exercises/math/calculLitteral/distributivity/doubleDistributivity.js +1 -1
- package/lib/exercises/math/calculLitteral/distributivity/doubleDistributivityWithCoeff.js +1 -1
- package/lib/exercises/math/calculLitteral/distributivity/firstIdentity.js +1 -1
- package/lib/exercises/math/calculLitteral/distributivity/index.d.ts +1 -0
- package/lib/exercises/math/calculLitteral/distributivity/index.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/distributivity/index.js +1 -0
- package/lib/exercises/math/calculLitteral/distributivity/secondIdentity.js +1 -1
- package/lib/exercises/math/calculLitteral/distributivity/simpleDistriXCoeff.d.ts +9 -0
- package/lib/exercises/math/calculLitteral/distributivity/simpleDistriXCoeff.d.ts.map +1 -0
- package/lib/exercises/math/calculLitteral/distributivity/simpleDistriXCoeff.js +113 -0
- package/lib/exercises/math/calculLitteral/distributivity/simpleDistributivity.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/distributivity/simpleDistributivity.js +44 -19
- package/lib/exercises/math/calculLitteral/distributivity/thirdIdentity.js +1 -1
- package/lib/exercises/math/calculLitteral/equation/equationType1Exercise.js +1 -1
- package/lib/exercises/math/calculLitteral/equation/equationType2Exercise.js +1 -1
- package/lib/exercises/math/calculLitteral/equation/equationType3Exercise.js +1 -1
- package/lib/exercises/math/calculLitteral/equation/firstDegreeEquation.js +1 -1
- package/lib/exercises/math/calculLitteral/equation/firstDegreeEquationIntType1.js +1 -1
- package/lib/exercises/math/calculLitteral/equation/firstDegreeEquationIntType2.js +1 -1
- package/lib/exercises/math/calculLitteral/equation/fractionEquation.js +1 -1
- package/lib/exercises/math/calculLitteral/equation/multiplicationEquation.js +1 -1
- package/lib/exercises/math/calculLitteral/factorisation/factoIdRmq1.js +1 -1
- package/lib/exercises/math/calculLitteral/factorisation/factoIdRmq2.js +1 -1
- package/lib/exercises/math/calculLitteral/factorisation/factoIdRmq3.js +1 -1
- package/lib/exercises/math/calculLitteral/factorisation/factoType1Exercise.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/factorisation/factoType1Exercise.js +0 -1
- package/lib/exercises/math/calculLitteral/factorisation/factoType2.d.ts +11 -0
- package/lib/exercises/math/calculLitteral/factorisation/factoType2.d.ts.map +1 -0
- package/lib/exercises/math/calculLitteral/factorisation/factoType2.js +110 -0
- package/lib/exercises/math/calculLitteral/factorisation/factorizeCanonicalForm.js +1 -1
- package/lib/exercises/math/calculLitteral/factorisation/factorizeCanonicalFormWithSqrt.js +1 -1
- package/lib/exercises/math/calculLitteral/factorisation/index.d.ts +1 -0
- package/lib/exercises/math/calculLitteral/factorisation/index.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/factorisation/index.js +1 -0
- package/lib/exercises/math/derivation/index.d.ts +0 -1
- package/lib/exercises/math/derivation/index.d.ts.map +1 -1
- package/lib/exercises/math/derivation/index.js +0 -1
- package/lib/exercises/math/derivation/tangent/derivativeNumberReading.d.ts +8 -0
- package/lib/exercises/math/derivation/tangent/derivativeNumberReading.d.ts.map +1 -0
- package/lib/exercises/math/derivation/tangent/derivativeNumberReading.js +102 -0
- package/lib/exercises/math/derivation/tangent/derivativeTangentEquationReading.d.ts +42 -0
- package/lib/exercises/math/derivation/tangent/derivativeTangentEquationReading.d.ts.map +1 -0
- package/lib/exercises/math/derivation/tangent/derivativeTangentEquationReading.js +231 -0
- package/lib/exercises/math/derivation/tangent/index.d.ts +2 -0
- package/lib/exercises/math/derivation/tangent/index.d.ts.map +1 -1
- package/lib/exercises/math/derivation/tangent/index.js +2 -0
- package/lib/exercises/math/functions/logarithm/log10PowerSimplifying.js +1 -1
- package/lib/exercises/math/geometry/cartesian/pointCoordinates.d.ts.map +1 -1
- package/lib/exercises/math/geometry/cartesian/pointCoordinates.js +1 -0
- package/lib/exercises/math/geometry/cartesian/pointCoordinatesNoAxisNumbers.d.ts.map +1 -1
- package/lib/exercises/math/geometry/cartesian/pointCoordinatesNoAxisNumbers.js +1 -1
- package/lib/exercises/math/geometry/cartesian/pointCoordinatesNoOrthonorm.d.ts.map +1 -1
- package/lib/exercises/math/geometry/cartesian/pointCoordinatesNoOrthonorm.js +1 -0
- package/lib/exercises/math/geometry/shapes/basicShapesNaming.d.ts.map +1 -1
- package/lib/exercises/math/geometry/shapes/basicShapesNaming.js +9 -17
- package/lib/exercises/math/geometry/vectors/index.d.ts +1 -2
- package/lib/exercises/math/geometry/vectors/index.d.ts.map +1 -1
- package/lib/exercises/math/geometry/vectors/index.js +1 -2
- package/lib/exercises/math/geometry/vectors/scalarProduct/index.d.ts +3 -0
- package/lib/exercises/math/geometry/vectors/scalarProduct/index.d.ts.map +1 -0
- package/lib/exercises/math/geometry/vectors/scalarProduct/index.js +19 -0
- package/lib/exercises/math/geometry/vectors/scalarProduct/scalarProductOrthoInSquare.d.ts +9 -0
- package/lib/exercises/math/geometry/vectors/scalarProduct/scalarProductOrthoInSquare.d.ts.map +1 -0
- package/lib/exercises/math/geometry/vectors/scalarProduct/scalarProductOrthoInSquare.js +136 -0
- package/lib/exercises/math/geometry/vectors/scalarProduct/scalarProductViaCoords.d.ts +8 -0
- package/lib/exercises/math/geometry/vectors/scalarProduct/scalarProductViaCoords.d.ts.map +1 -0
- package/lib/exercises/math/geometry/vectors/scalarProduct/scalarProductViaCoords.js +60 -0
- package/lib/exercises/math/geometry/vectors/scalarProduct/scalarProductViaCos.d.ts +9 -0
- package/lib/exercises/math/geometry/vectors/scalarProduct/scalarProductViaCos.d.ts.map +1 -0
- package/lib/exercises/math/geometry/vectors/scalarProduct/scalarProductViaCos.js +67 -0
- package/lib/exercises/math/geometry/vectors/vectorCoordinatesFromTwoPoints.js +1 -1
- package/lib/exercises/math/percent/cmToEvolution.js +1 -1
- package/lib/exercises/math/powers/powersDivision.js +1 -1
- package/lib/exercises/math/powers/powersProduct.js +1 -1
- package/lib/exercises/math/probaStat/calculateProbaOfBinomialDistribution.js +1 -1
- package/lib/exercises/math/probaStat/conditionalProbability.js +1 -1
- package/lib/exercises/math/probaStat/expectedValueOfBinomialProba.js +1 -1
- package/lib/exercises/math/probaStat/varianceOfBinomialProba.js +1 -1
- package/lib/exercises/math/sequences/arithmetic/arithmeticExplicitFormulaUsage.js +1 -1
- package/lib/exercises/math/sequences/arithmetic/arithmeticFindTerm.js +1 -1
- package/lib/exercises/math/sequences/geometric/geometricExplicitFormulaUsage.js +1 -1
- package/lib/exercises/math/sequences/geometric/geometricFindTerm.js +1 -1
- package/lib/exercises/math/spaceGeometry/vectors/spaceVectorCoordinatesFromPoints.js +1 -1
- package/lib/exercises/math/spaceGeometry/vectors/spaceVectorNormCalculation.js +1 -1
- package/lib/exercises/math/trigonometry/arcValue.js +1 -1
- package/lib/exercises/pc/index.d.ts +3 -3
- package/lib/exercises/pc/index.d.ts.map +1 -1
- package/lib/exercises/pc/index.js +3 -3
- package/lib/index.d.ts +27 -9
- package/lib/index.d.ts.map +1 -1
- package/lib/math/geometry/line.d.ts +1 -0
- package/lib/math/geometry/line.d.ts.map +1 -1
- package/lib/math/geometry/line.js +3 -0
- package/lib/math/geometry/point.d.ts.map +1 -1
- package/lib/math/geometry/point.js +1 -0
- package/lib/math/polynomials/polynomial.js +1 -1
- package/lib/math/polynomials/trinom.d.ts +5 -0
- package/lib/math/polynomials/trinom.d.ts.map +1 -1
- package/lib/math/polynomials/trinom.js +12 -0
- package/lib/playground.d.ts.map +1 -1
- package/lib/playground.js +10 -12
- package/lib/prototypesEnhancement.d.ts +2 -1
- package/lib/prototypesEnhancement.d.ts.map +1 -1
- package/lib/prototypesEnhancement.js +2 -2
- package/lib/server.d.ts.map +1 -1
- package/lib/tree/nodes/node.d.ts +2 -0
- package/lib/tree/nodes/node.d.ts.map +1 -1
- package/lib/tree/nodes/numbers/numberNode.d.ts +4 -3
- package/lib/tree/nodes/numbers/numberNode.d.ts.map +1 -1
- package/lib/tree/nodes/numbers/numberNode.js +7 -3
- package/lib/tree/nodes/operators/addNode.d.ts +2 -2
- package/lib/tree/nodes/operators/addNode.d.ts.map +1 -1
- package/lib/tree/nodes/operators/addNode.js +12 -6
- package/lib/tree/nodes/operators/multiplyNode.d.ts +2 -1
- package/lib/tree/nodes/operators/multiplyNode.d.ts.map +1 -1
- package/lib/tree/nodes/operators/multiplyNode.js +16 -11
- package/lib/tree/nodes/operators/substractNode.d.ts +4 -3
- package/lib/tree/nodes/operators/substractNode.d.ts.map +1 -1
- package/lib/tree/nodes/operators/substractNode.js +12 -5
- package/lib/tree/parsers/affineParser.d.ts +3 -0
- package/lib/tree/parsers/affineParser.d.ts.map +1 -0
- package/lib/tree/parsers/affineParser.js +26 -0
- package/lib/tree/parsers/monomParser.d.ts +2 -0
- package/lib/tree/parsers/monomParser.d.ts.map +1 -0
- package/lib/tree/parsers/monomParser.js +5 -0
- package/lib/types/keyIds.d.ts +1 -1
- package/lib/types/keyIds.d.ts.map +1 -1
- package/lib/utils/latex/alignTex.d.ts +2 -0
- package/lib/utils/latex/alignTex.d.ts.map +1 -0
- package/lib/utils/latex/alignTex.js +20 -0
- package/lib/utils/latex/colorize.d.ts +2 -0
- package/lib/utils/latex/colorize.d.ts.map +1 -0
- package/lib/utils/latex/colorize.js +9 -0
- package/package.json +4 -1
|
@@ -8,7 +8,7 @@ const real_1 = require("../../../../math/numbers/reals/real");
|
|
|
8
8
|
const sqrtNode_1 = require("../../../../tree/nodes/functions/sqrtNode");
|
|
9
9
|
const addNode_1 = require("../../../../tree/nodes/operators/addNode");
|
|
10
10
|
const powerNode_1 = require("../../../../tree/nodes/operators/powerNode");
|
|
11
|
-
const alignTex_1 = require("../../../../utils/alignTex");
|
|
11
|
+
const alignTex_1 = require("../../../../utils/latex/alignTex");
|
|
12
12
|
const getSpaceVectorNormCalculationQuestion = () => {
|
|
13
13
|
const u = spaceVector_1.SpaceVectorConstructor.random("u", false);
|
|
14
14
|
const correctAnswer = u.getNorm();
|
|
@@ -12,7 +12,7 @@ const tanNode_1 = require("../../../tree/nodes/functions/tanNode");
|
|
|
12
12
|
const variableNode_1 = require("../../../tree/nodes/variables/variableNode");
|
|
13
13
|
const arcSinNode_1 = require("../../../tree/nodes/functions/arcSinNode");
|
|
14
14
|
const arccosNode_1 = require("../../../tree/nodes/functions/arccosNode");
|
|
15
|
-
const alignTex_1 = require("../../../utils/alignTex");
|
|
15
|
+
const alignTex_1 = require("../../../utils/latex/alignTex");
|
|
16
16
|
const arctanNode_1 = require("../../../tree/nodes/functions/arctanNode");
|
|
17
17
|
const getArcValueQuestion = () => {
|
|
18
18
|
const trigFunctions = ["sin", "cos", "tan"];
|
|
@@ -43,8 +43,8 @@ export * from "../math/calculLitteral/equation/equationType1Exercise";
|
|
|
43
43
|
export * from "../math/calculLitteral/equation/equationType2Exercise";
|
|
44
44
|
export * from "../math/calculLitteral/equation/equationType3Exercise";
|
|
45
45
|
export * from "../math/calculLitteral/equation/equationType4Exercise";
|
|
46
|
-
export * from "../math/geometry/vectors/scalarProductViaCoords";
|
|
47
|
-
export * from "../math/geometry/vectors/scalarProductViaCos";
|
|
46
|
+
export * from "../math/geometry/vectors/scalarProduct/scalarProductViaCoords";
|
|
47
|
+
export * from "../math/geometry/vectors/scalarProduct/scalarProductViaCos";
|
|
48
48
|
export * from "../math/geometry/vectors/coordinatesReading";
|
|
49
49
|
export * from "../math/functions/affines/affineExpressionReading";
|
|
50
50
|
export * from "../math/geometry/thales/thales";
|
|
@@ -52,7 +52,7 @@ export * from "../math/geometry/thales/thalesCalcul";
|
|
|
52
52
|
export * from "../math/equaDiff/equaDiffCheckSolutionFirstOrder";
|
|
53
53
|
export * from "../math/equaDiff/equaDiffGeneralForme";
|
|
54
54
|
export * from "../math/equaDiff/equaDiffGeneralFormeWithIC";
|
|
55
|
-
export * from "../math/derivation/derivativeNumberReading";
|
|
55
|
+
export * from "../math/derivation/tangent/derivativeNumberReading";
|
|
56
56
|
export * from "../math/derivation/derivative/usualderivative";
|
|
57
57
|
export { thirdDegreeDerivative } from "../math/derivation/derivative/thirdDegreeDerivative";
|
|
58
58
|
export { firstDegreeDerivative } from "../math/derivation/derivative/firstDegreeDerivative";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/exercises/pc/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,YAAY,CAAC;AAC3B,cAAc,0BAA0B,CAAC;AACzC,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,mBAAmB,CAAC;AAClC,cAAc,wBAAwB,CAAC;AACvC,cAAc,MAAM,CAAC;AACrB,cAAc,sBAAsB,CAAC;AACrC,cAAc,mBAAmB,CAAC;AAClC,cAAc,kBAAkB,CAAC;AACjC,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,QAAQ,CAAC;AACvB,cAAc,kBAAkB,CAAC;AACjC,cAAc,UAAU,CAAC;AACzB,cAAc,eAAe,CAAC;AAC9B,cAAc,UA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AsD,CAAC;AAC9F,cAAc,6CAA6C,CAAC;AAC5D,cAAc,8CAA8C,CAAC"}
|
|
@@ -64,8 +64,8 @@ __exportStar(require("../math/calculLitteral/equation/equationType1Exercise"), e
|
|
|
64
64
|
__exportStar(require("../math/calculLitteral/equation/equationType2Exercise"), exports);
|
|
65
65
|
__exportStar(require("../math/calculLitteral/equation/equationType3Exercise"), exports);
|
|
66
66
|
__exportStar(require("../math/calculLitteral/equation/equationType4Exercise"), exports);
|
|
67
|
-
__exportStar(require("../math/geometry/vectors/scalarProductViaCoords"), exports);
|
|
68
|
-
__exportStar(require("../math/geometry/vectors/scalarProductViaCos"), exports);
|
|
67
|
+
__exportStar(require("../math/geometry/vectors/scalarProduct/scalarProductViaCoords"), exports);
|
|
68
|
+
__exportStar(require("../math/geometry/vectors/scalarProduct/scalarProductViaCos"), exports);
|
|
69
69
|
__exportStar(require("../math/geometry/vectors/coordinatesReading"), exports);
|
|
70
70
|
__exportStar(require("../math/functions/affines/affineExpressionReading"), exports);
|
|
71
71
|
__exportStar(require("../math/geometry/thales/thales"), exports);
|
|
@@ -73,7 +73,7 @@ __exportStar(require("../math/geometry/thales/thalesCalcul"), exports);
|
|
|
73
73
|
__exportStar(require("../math/equaDiff/equaDiffCheckSolutionFirstOrder"), exports);
|
|
74
74
|
__exportStar(require("../math/equaDiff/equaDiffGeneralForme"), exports);
|
|
75
75
|
__exportStar(require("../math/equaDiff/equaDiffGeneralFormeWithIC"), exports);
|
|
76
|
-
__exportStar(require("../math/derivation/derivativeNumberReading"), exports);
|
|
76
|
+
__exportStar(require("../math/derivation/tangent/derivativeNumberReading"), exports);
|
|
77
77
|
__exportStar(require("../math/derivation/derivative/usualderivative"), exports);
|
|
78
78
|
var thirdDegreeDerivative_1 = require("../math/derivation/derivative/thirdDegreeDerivative");
|
|
79
79
|
Object.defineProperty(exports, "thirdDegreeDerivative", { enumerable: true, get: function () { return thirdDegreeDerivative_1.thirdDegreeDerivative; } });
|
package/lib/index.d.ts
CHANGED
|
@@ -20,6 +20,9 @@ declare const mathExercises: (import("./exercises/exercise").Exercise<{
|
|
|
20
20
|
}> | import("./exercises/exercise").Exercise<{
|
|
21
21
|
a: number;
|
|
22
22
|
b: number;
|
|
23
|
+
}> | import("./exercises/exercise").Exercise<{
|
|
24
|
+
nb: number;
|
|
25
|
+
divisor: number;
|
|
23
26
|
}> | import("./exercises/exercise").Exercise<{
|
|
24
27
|
integerFirst: boolean;
|
|
25
28
|
integer: number;
|
|
@@ -188,6 +191,10 @@ declare const mathExercises: (import("./exercises/exercise").Exercise<{
|
|
|
188
191
|
affine2: number[];
|
|
189
192
|
}> | import("./exercises/exercise").Exercise<{
|
|
190
193
|
coeffs: number[];
|
|
194
|
+
}> | import("./exercises/exercise").Exercise<{
|
|
195
|
+
a: number;
|
|
196
|
+
b: number;
|
|
197
|
+
c: number;
|
|
191
198
|
}> | import("./exercises/exercise").Exercise<{
|
|
192
199
|
randNbr: number;
|
|
193
200
|
}> | import("./exercises/exercise").Exercise<{
|
|
@@ -259,6 +266,12 @@ declare const mathExercises: (import("./exercises/exercise").Exercise<{
|
|
|
259
266
|
}> | import("./exercises/exercise").Exercise<{
|
|
260
267
|
a: number;
|
|
261
268
|
bOperand: number;
|
|
269
|
+
}> | import("./exercises/exercise").Exercise<{
|
|
270
|
+
a: number;
|
|
271
|
+
b: number;
|
|
272
|
+
c: number;
|
|
273
|
+
d: number;
|
|
274
|
+
isSubstract: boolean;
|
|
262
275
|
}> | import("./exercises/exercise").Exercise<{
|
|
263
276
|
b: number;
|
|
264
277
|
c: number;
|
|
@@ -480,12 +493,17 @@ declare const mathExercises: (import("./exercises/exercise").Exercise<{
|
|
|
480
493
|
}> | import("./exercises/exercise").Exercise<{
|
|
481
494
|
coeffs: number[];
|
|
482
495
|
x: number;
|
|
496
|
+
}> | import("./exercises/exercise").Exercise<{
|
|
497
|
+
abscisse: number;
|
|
498
|
+
trinome: number[];
|
|
483
499
|
}> | import("./exercises/exercise").Exercise<{
|
|
484
500
|
A: number[];
|
|
485
501
|
B: number[];
|
|
486
502
|
}> | import("./exercises/exercise").Exercise<{
|
|
487
|
-
|
|
488
|
-
|
|
503
|
+
xA: number;
|
|
504
|
+
yA: number;
|
|
505
|
+
yPrimeA: any;
|
|
506
|
+
trinomCoeffs: number[];
|
|
489
507
|
}> | import("./exercises/exercise").Exercise<{
|
|
490
508
|
a: number;
|
|
491
509
|
}> | import("./exercises/exercise").Exercise<{
|
|
@@ -851,16 +869,9 @@ declare const mathExercises: (import("./exercises/exercise").Exercise<{
|
|
|
851
869
|
}> | import("./exercises/exercise").Exercise<{
|
|
852
870
|
uCoords: string[];
|
|
853
871
|
vCoords: string[];
|
|
854
|
-
}> | import("./exercises/exercise").Exercise<{
|
|
855
|
-
uCoords: string[];
|
|
856
|
-
vCoords: string[];
|
|
857
872
|
}> | import("./exercises/exercise").Exercise<{
|
|
858
873
|
A: number[];
|
|
859
874
|
B: number[];
|
|
860
|
-
}> | import("./exercises/exercise").Exercise<{
|
|
861
|
-
AB: number;
|
|
862
|
-
AC: number;
|
|
863
|
-
trigoPoint: string;
|
|
864
875
|
}> | import("./exercises/exercise").Exercise<{
|
|
865
876
|
xu: number;
|
|
866
877
|
yu: number;
|
|
@@ -926,6 +937,13 @@ declare const mathExercises: (import("./exercises/exercise").Exercise<{
|
|
|
926
937
|
}> | import("./exercises/exercise").Exercise<{
|
|
927
938
|
x: number;
|
|
928
939
|
y: number;
|
|
940
|
+
}> | import("./exercises/exercise").Exercise<{
|
|
941
|
+
uCoords: string[];
|
|
942
|
+
vCoords: string[];
|
|
943
|
+
}> | import("./exercises/exercise").Exercise<{
|
|
944
|
+
AB: number;
|
|
945
|
+
AC: number;
|
|
946
|
+
trigoPoint: string;
|
|
929
947
|
}> | import("./exercises/exercise").Exercise<{
|
|
930
948
|
trinom: number[];
|
|
931
949
|
}> | import("./exercises/exercise").Exercise<{
|
package/lib/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3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AAE/C,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,CAAC"}
|
|
@@ -21,6 +21,7 @@ export declare class Line {
|
|
|
21
21
|
getEquation: (u: Vector, a: Point) => EqualNode;
|
|
22
22
|
getCartesianEquation(): EqualNode;
|
|
23
23
|
toTex(): string;
|
|
24
|
+
toTexNoLeftRight(): string;
|
|
24
25
|
toGGBCommands(shouldBuildPoints: boolean, { isFixed, showLabel, showUnderlyingPointsLabel, }?: ToGGBCommandsProps): string[];
|
|
25
26
|
}
|
|
26
27
|
//# sourceMappingURL=line.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"line.d.ts","sourceRoot":"","sources":["../../../src/math/geometry/line.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,mDAAmD,CAAC;AAEvF,OAAO,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAC/D,OAAO,EAAE,SAAS,EAAE,MAAM,sCAAsC,CAAC;AAQjE,OAAO,EAAE,KAAK,EAAoB,MAAM,SAAS,CAAC;AAClD,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAElC,8BAAsB,eAAe;IACnC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,MAAM;CAK5B;AACD,qBAAa,IAAI;IACf,MAAM,EAAE,KAAK,CAAC;IACd,MAAM,EAAE,KAAK,CAAC;IACd,UAAU,EAAE,OAAO,CAAC;IACpB,CAAC,EAAE,aAAa,GAAG,SAAS,CAAC;IAC7B,CAAC,EAAE,aAAa,GAAG,SAAS,CAAC;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;gBACJ,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,CAAC,EAAE,MAAM;IAoBvD,YAAY,CAAC,KAAK,EAAE,KAAK;IASzB,QAAQ,CAAC,KAAK,EAAE,KAAK,EAAE,WAAW,GAAE,OAAe;IAgBn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,GAAE,kBAAuB;CAoB7B"}
|
|
@@ -94,6 +94,9 @@ class Line {
|
|
|
94
94
|
toTex() {
|
|
95
95
|
return this.name;
|
|
96
96
|
}
|
|
97
|
+
toTexNoLeftRight() {
|
|
98
|
+
return this.name.replace("\\left", "").replace("\\right", "");
|
|
99
|
+
}
|
|
97
100
|
toGGBCommands(shouldBuildPoints, { isFixed = true, showLabel = false, showUnderlyingPointsLabel = true, } = {}) {
|
|
98
101
|
const commands = [
|
|
99
102
|
`${this.ggbName}=Line(${this.pointA.name},${this.pointB.name})`,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"point.d.ts","sourceRoot":"","sources":["../../../src/math/geometry/point.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAY,MAAM,uBAAuB,CAAC;AAI1D,OAAO,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAG/D,OAAO,EAAE,kBAAkB,EAAE,MAAM,mDAAmD,CAAC;AAEvF,8BAAsB,gBAAgB;IACpC,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,KAAK;IAMlC,MAAM,CAAC,eAAe,CAAC,KAAK,EAAE,MAAM,EAAE;IAetC,MAAM,CAAC,cAAc,CAAC,GAAG,EAAE,MAAM;CAclC;AAED,qBAAa,KAAK;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,CAAC,EAAE,aAAa,CAAC;IACjB,CAAC,EAAE,aAAa,CAAC;gBACL,IAAI,EAAE,MAAM,EAAE,CAAC,EAAE,aAAa,EAAE,CAAC,EAAE,aAAa;IAM5D,KAAK,IAAI,MAAM;IAGf,aAAa;;;;;;;;;;IAQb,eAAe,IAAI,MAAM;IAGzB,QAAQ,IAAI,MAAM;IAIlB,UAAU,IAAI,MAAM;IAMpB,UAAU,IAAI,MAAM;IAMpB,QAAQ,CAAC,CAAC,EAAE,KAAK,EAAE,IAAI,SAAM,GAAG,KAAK;IAiBrC,UAAU,CAAC,CAAC,EAAE,KA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,GAAE,kBAAuB;CAQ3E"}
|
|
@@ -101,6 +101,7 @@ class Point {
|
|
|
101
101
|
`${this.name} = (${this.x.toMathString()}, ${this.y.toMathString()})`,
|
|
102
102
|
`SetFixed(${this.name},${isFixed ? "true" : "false"})`,
|
|
103
103
|
`ShowLabel(${this.name},${showLabel ? "true" : "false"})`,
|
|
104
|
+
`SetPointStyle(${this.name}, 1)`,
|
|
104
105
|
];
|
|
105
106
|
}
|
|
106
107
|
}
|
|
@@ -70,5 +70,10 @@ export declare class Trinom extends Polynomial {
|
|
|
70
70
|
getSommet(): Point;
|
|
71
71
|
getCoords(): number[];
|
|
72
72
|
toPython(): string;
|
|
73
|
+
toGGBCommands({ name, color, label }?: {
|
|
74
|
+
name: string;
|
|
75
|
+
color: string;
|
|
76
|
+
label: string;
|
|
77
|
+
}): string[];
|
|
73
78
|
}
|
|
74
79
|
//# sourceMappingURL=trinom.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"trinom.d.ts","sourceRoot":"","sources":["../../../src/math/polynomials/trinom.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,qCAAqC,CAAC;AACjE,OAAO,EAAE,OAAO,EAAE,MAAM,oCAAoC,CAAC;AAC7D,OAAO,EAAE,YAAY,EAAE,MAAM,yCAAyC,CAAC;AACvE,OAAO,EAAE,YAAY,EAAE,MAAM,yCAAyC,CAAC;AAIvE,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAI1C,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,YAAY,EAAE,MAAM,yCAAyC,CAAC;AAEvE,OAAO,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;
|
|
1
|
+
{"version":3,"file":"trinom.d.ts","sourceRoot":"","sources":["../../../src/math/polynomials/trinom.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,qCAAqC,CAAC;AACjE,OA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AK,EAAE,KAAK,EAAE;;;;KAA4C;CAYrE"}
|
|
@@ -16,6 +16,7 @@ const oppositeNode_1 = require("../../tree/nodes/functions/oppositeNode");
|
|
|
16
16
|
const gcd_1 = require("../utils/arithmetic/gcd");
|
|
17
17
|
const randint_1 = require("../utils/random/randint");
|
|
18
18
|
const random_1 = require("../../utils/random");
|
|
19
|
+
const colors_1 = require("../../geogebra/colors");
|
|
19
20
|
class TrinomConstructor {
|
|
20
21
|
static random(aOpts, bOpts, cOpts) {
|
|
21
22
|
const a = (0, randint_1.randint)(aOpts?.min ?? -9, aOpts?.max ?? 10, aOpts?.excludes ?? [0]);
|
|
@@ -230,5 +231,16 @@ class Trinom extends polynomial_1.Polynomial {
|
|
|
230
231
|
: ` - ${Math.abs(this.c)}`;
|
|
231
232
|
return `${aString}${bString}${cString}`;
|
|
232
233
|
}
|
|
234
|
+
toGGBCommands({ name, color, label } = { name: "f", color: colors_1.blueMain, label: "" }) {
|
|
235
|
+
const cmds = [`${name} = ${this.toString()}`];
|
|
236
|
+
if (color) {
|
|
237
|
+
cmds.push(`SetColor(${name}, "${color}")`);
|
|
238
|
+
}
|
|
239
|
+
if (label) {
|
|
240
|
+
cmds.push(`SetCaption(${name}, "${label}")`);
|
|
241
|
+
cmds.push(`ShowLabel(${name}, true)`);
|
|
242
|
+
}
|
|
243
|
+
return cmds;
|
|
244
|
+
}
|
|
233
245
|
}
|
|
234
246
|
exports.Trinom = Trinom;
|
package/lib/playground.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"playground.d.ts","sourceRoot":"","sources":["../src/playground.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"playground.d.ts","sourceRoot":"","sources":["../src/playground.ts"],"names":[],"mappings":"AAsBA,eAAO,MAAM,UAAU,YAYtB,CAAC"}
|
package/lib/playground.js
CHANGED
|
@@ -2,18 +2,16 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.playground = void 0;
|
|
4
4
|
const playground = () => {
|
|
5
|
-
// const
|
|
6
|
-
//
|
|
7
|
-
//
|
|
8
|
-
//
|
|
9
|
-
//
|
|
10
|
-
//
|
|
11
|
-
// )
|
|
12
|
-
//
|
|
13
|
-
//
|
|
14
|
-
// const ids = node.toIdentifiers();
|
|
15
|
-
// const parsed = NodeConstructor.fromIdentifiers(ids);
|
|
5
|
+
// const affine1 = new Affine(4, 5);
|
|
6
|
+
// const affine2 = new Affine(2, 3);
|
|
7
|
+
// const tree = affine1.toTree({ toTexOptions: { color: "green" } });
|
|
8
|
+
// console.log(tree.opts);
|
|
9
|
+
// console.log(tree.toTex());
|
|
10
|
+
// const node = new MultiplyNode(
|
|
11
|
+
// affine1.toTree({ toTexOptions: { color: "green" } }),
|
|
12
|
+
// new (coinFlip() ? SubstractNode : AddNode)(affine2.toTree(), (1).toTree()),
|
|
13
|
+
// ).toTex();
|
|
16
14
|
// console.log(node);
|
|
17
|
-
|
|
15
|
+
console.log((3).toTree({ toTexOptions: { color: "red" } }));
|
|
18
16
|
};
|
|
19
17
|
exports.playground = playground;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { AlgebraicNode } from "./tree/nodes/algebraicNode";
|
|
2
|
+
import { NodeOptions } from "./tree/nodes/node";
|
|
2
3
|
declare global {
|
|
3
4
|
interface Number {
|
|
4
|
-
toTree: () => AlgebraicNode;
|
|
5
|
+
toTree: (opts?: NodeOptions) => AlgebraicNode;
|
|
5
6
|
frenchify: () => string;
|
|
6
7
|
toScientific: (decimals?: number) => AlgebraicNode;
|
|
7
8
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prototypesEnhancement.d.ts","sourceRoot":"","sources":["../src/prototypesEnhancement.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"prototypesEnhancement.d.ts","sourceRoot":"","sources":["../src/prototypesEnhancement.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,EAAQ,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAStD,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,MAAM;QACd,MAAM,EAAE,CAAC,IAAI,CAAC,EAAE,WAAW,KAAK,aAAa,CAAC;QAC9C,SAAS,EAAE,MAAM,MAAM,CAAC;QACxB,YAAY,EAAE,CAAC,QAAQ,CAAC,EAAE,MAAM,KAAK,aAAa,CAAC;KACpD;IACD,UAAU,MAAM;QACd,MAAM,EAAE,MAAM,aAAa,CAAC;QAC5B,WAAW,EAAE,MAAM,MAAM,CAAC;KAC3B;CACF;AAqBD,OAAO,EAAE,CAAC"}
|
|
@@ -10,13 +10,13 @@ String.prototype.toTree = function () {
|
|
|
10
10
|
String.prototype.unfrenchify = function () {
|
|
11
11
|
return Number(this.valueOf().replace(",", "."));
|
|
12
12
|
};
|
|
13
|
-
Number.prototype.toTree = function () {
|
|
13
|
+
Number.prototype.toTree = function (opts) {
|
|
14
14
|
const value = this.valueOf();
|
|
15
15
|
if (value === Infinity)
|
|
16
16
|
return infiniteNode_1.PlusInfinityNode;
|
|
17
17
|
if (value === -Infinity)
|
|
18
18
|
return infiniteNode_1.MinusInfinityNode;
|
|
19
|
-
return new numberNode_1.NumberNode(value);
|
|
19
|
+
return new numberNode_1.NumberNode(value, "", "", opts);
|
|
20
20
|
};
|
|
21
21
|
Number.prototype.frenchify = function () {
|
|
22
22
|
return (this.valueOf() + "").replace(".", ",");
|
package/lib/server.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAUA,OAAO,yBAAyB,CAAC"}
|
package/lib/tree/nodes/node.d.ts
CHANGED
|
@@ -23,6 +23,7 @@ export type NodeOptions = {
|
|
|
23
23
|
allowPowerOne?: boolean;
|
|
24
24
|
allowSimplifySqrt?: boolean;
|
|
25
25
|
forceParenthesis?: boolean;
|
|
26
|
+
toTexOptions?: ToTexOptions;
|
|
26
27
|
};
|
|
27
28
|
export type ToTexOptions = {
|
|
28
29
|
displayStyle?: boolean;
|
|
@@ -32,6 +33,7 @@ export type ToTexOptions = {
|
|
|
32
33
|
notScientific?: boolean;
|
|
33
34
|
forceNoSimplification?: boolean;
|
|
34
35
|
forceParenthesis?: boolean;
|
|
36
|
+
color?: string;
|
|
35
37
|
};
|
|
36
38
|
export declare enum NodeIds {
|
|
37
39
|
add = 0,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"node.d.ts","sourceRoot":"","sources":["../../../src/tree/nodes/node.ts"],"names":[],"mappings":"AAAA,oBAAY,QAAQ;IAClB,MAAM,IAAA;IACN,QAAQ,IAAA;IACR,QAAQ,IAAA;IACR,QAAQ,IAAA;IACR,QAAQ,IAAA;IACR,UAAU,IAAA;IACV,KAAK,IAAA;IACL,MAAM,IAAA;IACN,QAAQ,IAAA;IACR,OAAO,IAAA;IACP,MAAM,KAAA;IACN,GAAG,KAAA;CACJ;AACD,MAAM,MAAM,WAAW,GAAG;IACxB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,4BAA4B,CAAC,EAAE,OAAO,CAAC;IACvC,sBAAsB,CAAC,EAAE,OAAO,CAAC;IACjC,4BAA4B,CAAC,EAAE,OAAO,CAAC;IACvC,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,gBAAgB,CAAC,EAAE,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"node.d.ts","sourceRoot":"","sources":["../../../src/tree/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IACP,QAAQ,IAAA;IACR,QAAQ,KAAA;IACR,OAAO,KAAA;IACP,WAAW,KAAA;IACX,QAAQ,KAAA;IACR,KAAK,KAAA;IACL,OAAO,KAAA;IACP,KAAK,KAAA;IACL,UAAU,KAAA;IACV,gBAAgB,KAAA;IAChB,GAAG,KAAA;IACH,MAAM,KAAA;IACN,MAAM,KAAA;IACN,MAAM,KAAA;IACN,GAAG,KAAA;IACH,GAAG,KAAA;IACH,GAAG,KAAA;IACH,GAAG,KAAA;IACH,KAAK,KAAA;IACL,GAAG,KAAA;IACH,IAAI,KAAA;IACJ,QAAQ,KAAA;IACR,QAAQ,KAAA;IACR,MAAM,KAAA;IACN,MAAM,KAAA;IACN,KAAK,KAAA;IACL,MAAM,KAAA;IACN,UAAU,KAAA;IACV,kBAAkB,KAAA;CACnB;AAED,MAAM,WAAW,IAAI;IACnB,IAAI,EAAE,QAAQ,CAAC;IACf,IAAI,CAAC,EAAE,WAAW,CAAC;IACnB,YAAY,EAAE,MAAM,MAAM,CAAC;IAC3B,iBAAiB,EAAE,CAAC,IAAI,CAAC,EAAE,WAAW,KAAK,IAAI,EAAE,CAAC;IAClD,cAAc,EAAE,CAAC,IAAI,CAAC,EAAE,WAAW,KAAK,MAAM,EAAE,CAAC;IACjD,KAAK,EAAE,CAAC,IAAI,CAAC,EAAE,YAAY,KAAK,MAAM,CAAC;IAGvC,aAAa,EAAE,MAAM;QAAE,EAAE,EAAE,OAAO,CAAA;KAAE,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CAC5D"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Node, NodeIds, NodeType } from "../node";
|
|
1
|
+
import { Node, NodeIds, NodeOptions, NodeType, ToTexOptions } from "../node";
|
|
2
2
|
import { AlgebraicNode } from "../algebraicNode";
|
|
3
3
|
export declare function isNumberNode(a: Node): a is NumberNode;
|
|
4
4
|
export declare abstract class NumberNodeConstructor {
|
|
@@ -10,9 +10,10 @@ export declare class NumberNode implements AlgebraicNode {
|
|
|
10
10
|
value: number;
|
|
11
11
|
type: NodeType;
|
|
12
12
|
isNumeric: boolean;
|
|
13
|
-
|
|
13
|
+
opts?: NodeOptions;
|
|
14
|
+
constructor(value: number, tex?: string, mathString?: string, opts?: NodeOptions);
|
|
14
15
|
toMathString(): string;
|
|
15
|
-
toTex(): string;
|
|
16
|
+
toTex(options?: ToTexOptions): string;
|
|
16
17
|
toMathjs(): string;
|
|
17
18
|
toIdentifiers(): {
|
|
18
19
|
id: NodeIds;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"numberNode.d.ts","sourceRoot":"","sources":["../../../../src/tree/nodes/numbers/numberNode.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"numberNode.d.ts","sourceRoot":"","sources":["../../../../src/tree/nodes/numbers/numberNode.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAC7E,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAGjD,wBAAgB,YAAY,CAAC,CAAC,EAAE,IAAI,GAAG,CAAC,IAAI,UAAU,CAErD;AAED,8BAAsB,qBAAqB;IACzC,MAAM,CAAC,MAAM,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,QAAQ,GAAE,MAAM,EAAO;CAGhE;AACD,qBAAa,UAAW,YAAW,aAAa;IAC9C,GAAG,EAAE,MAAM,CAAC;IACZ,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,QAAQ,CAAmB;IACjC,SAAS,EAAE,OAAO,CAAC;IACnB,IAAI,CAAC,EAAE,WAAW,CAAC;gBAEjB,KAAK,EAAE,MAAM,EACb,GAAG,CAAC,EAAE,MAAM,EACZ,UAAU,CAAC,EAAE,MAAM,EACnB,IAAI,CAAC,EAAE,WAAW;IASpB,YAAY,IAAI,MAAM;IAGtB,KAAK,CAAC,OAAO,CAAC,EAAE,YAAY,GAAG,MAAM;IAKrC,QAAQ;IAGR,aAAa;;;;IAMb,cAAc;IAOd,iBAAiB;IAGjB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;IAGrC,QAAQ;IAGR,MAAM,CAAC,IAAI,EAAE,aAAa;CAG3B"}
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.NumberNode = exports.NumberNodeConstructor = exports.isNumberNode = void 0;
|
|
4
4
|
const node_1 = require("../node");
|
|
5
5
|
const randint_1 = require("../../../math/utils/random/randint");
|
|
6
|
+
const colorize_1 = require("../../../utils/latex/colorize");
|
|
6
7
|
function isNumberNode(a) {
|
|
7
8
|
return a.type === node_1.NodeType.number;
|
|
8
9
|
}
|
|
@@ -14,18 +15,21 @@ class NumberNodeConstructor {
|
|
|
14
15
|
}
|
|
15
16
|
exports.NumberNodeConstructor = NumberNodeConstructor;
|
|
16
17
|
class NumberNode {
|
|
17
|
-
constructor(value, tex, mathString) {
|
|
18
|
+
constructor(value, tex, mathString, opts) {
|
|
18
19
|
this.type = node_1.NodeType.number;
|
|
19
20
|
this.value = value;
|
|
20
21
|
this.tex = tex?.replace(".", ",") || (value + "").replace(".", ",");
|
|
21
22
|
this.mathString = mathString || this.value + "";
|
|
22
23
|
this.isNumeric = true;
|
|
24
|
+
this.opts = opts;
|
|
23
25
|
}
|
|
24
26
|
toMathString() {
|
|
25
27
|
return `${this.mathString}`;
|
|
26
28
|
}
|
|
27
|
-
toTex() {
|
|
28
|
-
|
|
29
|
+
toTex(options) {
|
|
30
|
+
const opts = this.opts?.toTexOptions ?? options;
|
|
31
|
+
const color = opts?.color;
|
|
32
|
+
return (0, colorize_1.colorize)(`${this.tex}`, color);
|
|
29
33
|
}
|
|
30
34
|
toMathjs() {
|
|
31
35
|
return this.toMathString();
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Node, NodeIds, NodeOptions, NodeType } from "../node";
|
|
1
|
+
import { Node, NodeIds, NodeOptions, NodeType, ToTexOptions } from "../node";
|
|
2
2
|
import { CommutativeOperatorNode, OperatorIds } from "./operatorNode";
|
|
3
3
|
import { AlgebraicNode, SimplifyOptions } from "../algebraicNode";
|
|
4
4
|
export declare function isAddNode(a: Node): a is AddNode;
|
|
@@ -15,7 +15,7 @@ export declare class AddNode implements CommutativeOperatorNode {
|
|
|
15
15
|
toEquivalentNodes(opts?: NodeOptions): AlgebraicNode[];
|
|
16
16
|
toAllTexs(): string[];
|
|
17
17
|
toAllValidTexs(opts?: NodeOptions): string[];
|
|
18
|
-
toTex(): string;
|
|
18
|
+
toTex(options?: ToTexOptions): string;
|
|
19
19
|
evaluate(vars: Record<string, number>): number;
|
|
20
20
|
simplify(opts?: SimplifyOptions): AlgebraicNode;
|
|
21
21
|
toIdentifiers(): {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"addNode.d.ts","sourceRoot":"","sources":["../../../../src/tree/nodes/operators/addNode.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,WAAW,EAAE,QAAQ,
|
|
1
|
+
{"version":3,"file":"addNode.d.ts","sourceRoot":"","sources":["../../../../src/tree/nodes/operators/addNode.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAC7E,OAAO,EACL,uBAAuB,EACvB,WAAW,EAGZ,MAAM,gBAAgB,CAAC;AAKxB,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAQlE,wBAAgB,SAAS,CAAC,CAAC,EAAE,IAAI,GAAG,CAAC,IAAI,OAAO,CAE/C;AAED,qBAAa,OAAQ,YAAW,uBAAuB;IACrD,EAAE,EAAE,WAAW,CAAC;IAChB,SAAS,EAAE,aAAa,CAAC;IACzB,UAAU,EAAE,aAAa,CAAC;IAC1B,IAAI,EAAE,QAAQ,CAAC;IACf,IAAI,CAAC,EAAE,WAAW,CAAC;IACnB,SAAS,EAAE,OAAO,CAAC;gBAEjB,SAAS,EAAE,aAAa,EACxB,UAAU,EAAE,aAAa,EACzB,IAAI,CAAC,EAAE,WAAW;IASpB,OAAO,aAGL;IAEF,YAAY,IAAI,MAAM;IAItB,iBAAiB,CAAC,IAAI,CAAC,EAAE,WAAW,GAAG,aAAa,EAAE;IAoCtD,SAAS,IAAI,MAAM,EAAE;IAIrB,cAAc,CAAC,IAAI,CAAC,EAAE,WAAW,GAAG,MAAM,EAAE;IAK5C,KAAK,CAAC,OAAO,CAAC,EAAE,YAAY,GAAG,MAAM;IAerC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;IAMrC,QAAQ,CAAC,IAAI,CAAC,EAAE,eAAe,GAAG,aAAa;IA0K/C,aAAa;;;;;;;;;IAOb,MAAM,CAAC,IAAI,EAAE,aAAa,GAAG,OAAO;CAUrC"}
|
|
@@ -13,6 +13,7 @@ const oppositeNode_1 = require("../functions/oppositeNode");
|
|
|
13
13
|
const numberNode_1 = require("../numbers/numberNode");
|
|
14
14
|
const multiplyNode_1 = require("./multiplyNode");
|
|
15
15
|
const fractionNode_1 = require("./fractionNode");
|
|
16
|
+
const colorize_1 = require("../../../utils/latex/colorize");
|
|
16
17
|
function isAddNode(a) {
|
|
17
18
|
return (0, operatorNode_1.isOperatorNode)(a) && a.id === operatorNode_1.OperatorIds.add;
|
|
18
19
|
}
|
|
@@ -72,17 +73,22 @@ class AddNode {
|
|
|
72
73
|
const options = opts ?? this.opts;
|
|
73
74
|
return this.toEquivalentNodes(options).map((node) => node.toTex());
|
|
74
75
|
}
|
|
75
|
-
toTex() {
|
|
76
|
-
const
|
|
77
|
-
const
|
|
76
|
+
toTex(options) {
|
|
77
|
+
const opts = this.opts?.toTexOptions ?? options;
|
|
78
|
+
const color = opts?.color;
|
|
79
|
+
const childOpts = { ...opts };
|
|
80
|
+
if (color)
|
|
81
|
+
childOpts.color = undefined;
|
|
82
|
+
const rightTex = this.rightChild.toTex(childOpts);
|
|
83
|
+
const leftTex = this.leftChild.toTex(childOpts);
|
|
78
84
|
if (rightTex === "0")
|
|
79
|
-
return leftTex;
|
|
85
|
+
return (0, colorize_1.colorize)(leftTex, color);
|
|
80
86
|
const tex = `${leftTex}${rightTex[0] === "-" ? "" : "+"}${rightTex}`;
|
|
81
87
|
if (this.opts?.forceParenthesis) {
|
|
82
|
-
return `\\left(${tex}\\right)
|
|
88
|
+
return (0, colorize_1.colorize)(`\\left(${tex}\\right)`, color);
|
|
83
89
|
}
|
|
84
90
|
else
|
|
85
|
-
return tex;
|
|
91
|
+
return (0, colorize_1.colorize)(tex, color);
|
|
86
92
|
}
|
|
87
93
|
evaluate(vars) {
|
|
88
94
|
return this.leftChild.evaluate(vars) + this.rightChild.evaluate(vars);
|
|
@@ -13,7 +13,7 @@ export declare class MultiplyNode implements CommutativeOperatorNode {
|
|
|
13
13
|
constructor(leftChild: AlgebraicNode, rightChild: AlgebraicNode, opts?: NodeOptions);
|
|
14
14
|
shuffle: () => void;
|
|
15
15
|
toMathString(): string;
|
|
16
|
-
toTex(
|
|
16
|
+
toTex(options?: ToTexOptions): string;
|
|
17
17
|
toAllTexs(): string[];
|
|
18
18
|
toEquivalentNodes(opts?: NodeOptions): MultiplyNode[];
|
|
19
19
|
toAllValidTexs(opts?: NodeOptions): string[];
|
|
@@ -28,6 +28,7 @@ export declare class MultiplyNode implements CommutativeOperatorNode {
|
|
|
28
28
|
};
|
|
29
29
|
evaluate(vars: Record<string, number>): number;
|
|
30
30
|
copy(): MultiplyNode;
|
|
31
|
+
canonicalOrder(): void;
|
|
31
32
|
simplify(opts?: SimplifyOptions): AlgebraicNode;
|
|
32
33
|
equals(node: AlgebraicNode): boolean;
|
|
33
34
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"multiplyNode.d.ts","sourceRoot":"","sources":["../../../../src/tree/nodes/operators/multiplyNode.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAC7E,OAAO,EACL,uBAAuB,EACvB,WAAW,EAEZ,MAAM,gBAAgB,CAAC;AAYxB,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"multiplyNode.d.ts","sourceRoot":"","sources":["../../../../src/tree/nodes/operators/multiplyNode.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAC7E,OAAO,EACL,uBAAuB,EACvB,WAAW,EAEZ,MAAM,gBAAgB,CAAC;AAYxB,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAQlE,wBAAgB,cAAc,CAAC,CAAC,EAAE,IAAI,GAAG,CAAC,IAAI,YAAY,CAEzD;AAED,eAAO,MAAM,iBAAiB,QAAS,aAAa,EAAE,SAWrD,CAAC;AACF,qBAAa,YAAa,YAAW,uBAAuB;IAC1D,IAAI,CAAC,EAAE,WAAW,CAAC;IACnB,EAAE,EAAE,WAAW,CAAC;IAChB,SAAS,EAAE,aAAa,CAAC;IACzB,UAAU,EAAE,aAAa,CAAC;IAC1B,IAAI,EAAE,QAAQ,CAAC;IACf,SAAS,EAAE,OAAO,CAAC;gBAEjB,SAAS,EAAE,aAAa,EACxB,UAAU,EAAE,aAAa,EACzB,IAAI,CAAC,EAAE,WAAW;IAUpB,OAAO,aAGL;IAEF,YAAY,IAAI,MAAM;IAItB,KAAK,CAAC,OAAO,CAAC,EAAE,YAAY,GAAG,MAAM;IAoErC,SAAS;IAkDT,iBAAiB,CAAC,IAAI,CAAC,EAAE,WAAW,GAAG,YAAY,EAAE;IAyFrD,cAAc,CAAC,IAAI,CAAC,EAAE,WAAW,GAAG,MAAM,EAAE;IAG5C,aAAa;;;;;;;;;IAYb,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;IAIrC,IAAI;IAGJ,cAAc;IACd,QAAQ,CAAC,IAAI,CAAC,EAAE,eAAe,GAAG,aAAa;IA0H/C,MAAM,CAAC,IAAI,EAAE,aAAa;CAU3B"}
|
|
@@ -18,6 +18,7 @@ const fractionNode_1 = require("./fractionNode");
|
|
|
18
18
|
const functionNode_1 = require("../functions/functionNode");
|
|
19
19
|
const addNode_1 = require("./addNode");
|
|
20
20
|
const round_1 = require("../../../math/utils/round");
|
|
21
|
+
const colorize_1 = require("../../../utils/latex/colorize");
|
|
21
22
|
function isMultiplyNode(a) {
|
|
22
23
|
return (0, operatorNode_1.isOperatorNode)(a) && a.id === operatorNode_1.OperatorIds.multiply;
|
|
23
24
|
}
|
|
@@ -49,14 +50,19 @@ class MultiplyNode {
|
|
|
49
50
|
toMathString() {
|
|
50
51
|
return `(${this.leftChild.toMathString()})*(${this.rightChild.toMathString()})`;
|
|
51
52
|
}
|
|
52
|
-
toTex(
|
|
53
|
-
|
|
54
|
-
|
|
53
|
+
toTex(options) {
|
|
54
|
+
const opts = this.opts?.toTexOptions ?? options;
|
|
55
|
+
const color = opts?.color;
|
|
56
|
+
const childOpts = { ...opts };
|
|
57
|
+
if (color)
|
|
58
|
+
childOpts.color = undefined;
|
|
59
|
+
let leftTex = this.leftChild.toTex(childOpts);
|
|
60
|
+
let rightTex = this.rightChild.toTex(childOpts);
|
|
55
61
|
if (!opts?.forceNoSimplification &&
|
|
56
62
|
(0, numberNode_1.isNumberNode)(this.leftChild) &&
|
|
57
63
|
this.leftChild.value === 1 &&
|
|
58
64
|
opts?.scientific === undefined) {
|
|
59
|
-
return rightTex;
|
|
65
|
+
return (0, colorize_1.colorize)(rightTex, color);
|
|
60
66
|
}
|
|
61
67
|
if ((0, operatorNode_1.isOperatorNode)(this.leftChild)) {
|
|
62
68
|
if ([operatorNode_1.OperatorIds.add, operatorNode_1.OperatorIds.substract, operatorNode_1.OperatorIds.divide].includes(this.leftChild.id))
|
|
@@ -71,7 +77,7 @@ class MultiplyNode {
|
|
|
71
77
|
rightTex = `\\left(${rightTex}\\right)`;
|
|
72
78
|
if (leftTex === "-1" && !opts?.forceNoSimplification) {
|
|
73
79
|
// if (!isNumberNode(this.rightChild)) {
|
|
74
|
-
return "-" + rightTex;
|
|
80
|
+
return (0, colorize_1.colorize)("-" + rightTex, color);
|
|
75
81
|
// }
|
|
76
82
|
}
|
|
77
83
|
let showTimesSign = !opts?.forceDotSign &&
|
|
@@ -87,11 +93,11 @@ class MultiplyNode {
|
|
|
87
93
|
const cDotSign = opts?.forceDotSign ? ` \\cdot ` : "";
|
|
88
94
|
const nextIsLetter = rightTex[0].toLowerCase() !== rightTex[0].toUpperCase();
|
|
89
95
|
const prevIsCommand = leftTex.match(/\\[a-z]*$/);
|
|
90
|
-
return `${leftTex}${showTimesSign
|
|
96
|
+
return (0, colorize_1.colorize)(`${leftTex}${showTimesSign
|
|
91
97
|
? `\\times${nextIsLetter ? " " : ""}`
|
|
92
98
|
: prevIsCommand && nextIsLetter
|
|
93
99
|
? " "
|
|
94
|
-
: ""}${cDotSign}${rightTex}
|
|
100
|
+
: ""}${cDotSign}${rightTex}`, color);
|
|
95
101
|
}
|
|
96
102
|
toAllTexs() {
|
|
97
103
|
const res = [];
|
|
@@ -218,6 +224,7 @@ class MultiplyNode {
|
|
|
218
224
|
copy() {
|
|
219
225
|
return new MultiplyNode(this.leftChild, this.rightChild, this.opts);
|
|
220
226
|
}
|
|
227
|
+
canonicalOrder() { }
|
|
221
228
|
simplify(opts) {
|
|
222
229
|
const leftSimplified = this.leftChild.simplify(opts);
|
|
223
230
|
const rightSimplified = this.rightChild.simplify(opts);
|
|
@@ -344,15 +351,13 @@ class MultiplyNode {
|
|
|
344
351
|
exports.MultiplyNode = MultiplyNode;
|
|
345
352
|
const powerSimplify = (a, b, opts) => {
|
|
346
353
|
if ((0, powerNode_1.isPowerNode)(a) && (0, powerNode_1.isPowerNode)(b)) {
|
|
347
|
-
if (a.leftChild.toTex() ===
|
|
348
|
-
b.leftChild.toTex())
|
|
354
|
+
if (a.leftChild.toTex() === b.leftChild.toTex())
|
|
349
355
|
return new powerNode_1.PowerNode(a.leftChild, new addNode_1.AddNode(a.rightChild, b.rightChild).simplify(opts)).simplify(opts);
|
|
350
356
|
}
|
|
351
357
|
if ((0, variableNode_1.isVariableNode)(a)) {
|
|
352
358
|
if ((0, variableNode_1.isVariableNode)(b) && b.toTex() === a.toTex() && opts?.keepPowers)
|
|
353
359
|
return new powerNode_1.PowerNode(a, new numberNode_1.NumberNode(2)).simplify(opts);
|
|
354
|
-
if ((0, powerNode_1.isPowerNode)(b) &&
|
|
355
|
-
b.leftChild.toTex() === a.toTex()) {
|
|
360
|
+
if ((0, powerNode_1.isPowerNode)(b) && b.leftChild.toTex() === a.toTex()) {
|
|
356
361
|
return new powerNode_1.PowerNode(a, new addNode_1.AddNode(new numberNode_1.NumberNode(1), b.rightChild).simplify(opts)).simplify(opts);
|
|
357
362
|
}
|
|
358
363
|
}
|