math-exercises 3.0.164 → 3.0.165
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 +1 -1
- package/lib/exercises/exercise.d.ts.map +1 -1
- package/lib/exercises/math/functions/basics/inverseImageFunctionGeogebra.d.ts.map +1 -1
- package/lib/exercises/math/functions/basics/inverseImageFunctionGeogebra.js +3 -1
- package/lib/exercises/math/functions/trinoms/devForm/variationsFromAlgebricForm.d.ts +6 -2
- package/lib/exercises/math/functions/trinoms/devForm/variationsFromAlgebricForm.d.ts.map +1 -1
- package/lib/exercises/math/functions/trinoms/devForm/variationsFromAlgebricForm.js +85 -13
- package/lib/exercises/math/functions/trinoms/equation/index.d.ts +2 -0
- package/lib/exercises/math/functions/trinoms/equation/index.d.ts.map +1 -1
- package/lib/exercises/math/functions/trinoms/equation/index.js +2 -0
- package/lib/exercises/math/functions/trinoms/equation/solveSecondDegreeEquationByFactorisation.d.ts +4 -1
- package/lib/exercises/math/functions/trinoms/equation/solveSecondDegreeEquationByFactorisation.d.ts.map +1 -1
- package/lib/exercises/math/functions/trinoms/equation/solveSecondDegreeEquationByFactorisation.js +169 -8
- package/lib/exercises/math/functions/trinoms/equation/solveSecondDegreeEquationEqualsC.d.ts +10 -0
- package/lib/exercises/math/functions/trinoms/equation/solveSecondDegreeEquationEqualsC.d.ts.map +1 -0
- package/lib/exercises/math/functions/trinoms/equation/solveSecondDegreeEquationEqualsC.js +146 -0
- package/lib/exercises/math/functions/trinoms/equation/solveSecondDegreeEquationFromCano.d.ts.map +1 -1
- package/lib/exercises/math/functions/trinoms/equation/solveSecondDegreeEquationFromCano.js +73 -3
- package/lib/exercises/math/functions/trinoms/equation/trinomSelectEquationWithoutDeltaNeeded.d.ts +13 -0
- package/lib/exercises/math/functions/trinoms/equation/trinomSelectEquationWithoutDeltaNeeded.d.ts.map +1 -0
- package/lib/exercises/math/functions/trinoms/equation/trinomSelectEquationWithoutDeltaNeeded.js +204 -0
- package/lib/exercises/math/functions/trinoms/sign/index.d.ts +2 -0
- package/lib/exercises/math/functions/trinoms/sign/index.d.ts.map +1 -1
- package/lib/exercises/math/functions/trinoms/sign/index.js +2 -0
- package/lib/exercises/math/functions/trinoms/sign/parabolaSignTable.d.ts +9 -0
- package/lib/exercises/math/functions/trinoms/sign/parabolaSignTable.d.ts.map +1 -0
- package/lib/exercises/math/functions/trinoms/sign/parabolaSignTable.js +123 -0
- package/lib/exercises/math/functions/trinoms/sign/trinomSignTableFromAlgebraicForm.d.ts +13 -0
- package/lib/exercises/math/functions/trinoms/sign/trinomSignTableFromAlgebraicForm.d.ts.map +1 -0
- package/lib/exercises/math/functions/trinoms/sign/trinomSignTableFromAlgebraicForm.js +209 -0
- package/lib/exercises/math/probaStat/index.js +1 -0
- package/lib/exercises/math/probaStat/trees/index.d.ts +2 -0
- package/lib/exercises/math/probaStat/trees/index.d.ts.map +1 -0
- package/lib/exercises/math/probaStat/trees/index.js +1 -0
- package/lib/exercises/math/probaStat/trees/treeInInstruction.d.ts +8 -0
- package/lib/exercises/math/probaStat/trees/treeInInstruction.d.ts.map +1 -0
- package/lib/exercises/math/probaStat/trees/treeInInstruction.js +110 -0
- package/lib/exercises/math/sequences/arithmetic/arithmeticVariations.d.ts +13 -0
- package/lib/exercises/math/sequences/arithmetic/arithmeticVariations.d.ts.map +1 -0
- package/lib/exercises/math/sequences/arithmetic/arithmeticVariations.js +163 -0
- package/lib/exercises/math/sequences/arithmetic/index.d.ts +1 -0
- package/lib/exercises/math/sequences/arithmetic/index.d.ts.map +1 -1
- package/lib/exercises/math/sequences/arithmetic/index.js +1 -0
- package/lib/index.d.ts +37 -3
- package/lib/index.d.ts.map +1 -1
- package/lib/math/polynomials/trinom.d.ts +1 -1
- package/lib/math/polynomials/trinom.d.ts.map +1 -1
- package/lib/math/polynomials/trinom.js +5 -2
- package/lib/tree/nodes/numbers/constantNode.d.ts +1 -0
- package/lib/tree/nodes/numbers/constantNode.d.ts.map +1 -1
- package/lib/tree/nodes/numbers/constantNode.js +7 -0
- package/lib/tree/nodes/numbers/numberNode.d.ts +1 -0
- package/lib/tree/nodes/numbers/numberNode.d.ts.map +1 -1
- package/lib/tree/nodes/numbers/numberNode.js +7 -0
- package/package.json +1 -1
|
@@ -61,11 +61,14 @@ export class TrinomConstructor {
|
|
|
61
61
|
return new Trinom(a, -a * (x1 + x2), a * x1 * x2);
|
|
62
62
|
}
|
|
63
63
|
}
|
|
64
|
-
static randomNiceRootsAndSummit() {
|
|
64
|
+
static randomNiceRootsAndSummit(nbOfRoots) {
|
|
65
65
|
const a = randint(-9, 10, [0]);
|
|
66
66
|
const x1 = randint(-9, 10, []);
|
|
67
67
|
const isEven = x1 % 2 === 0;
|
|
68
|
-
|
|
68
|
+
let x2;
|
|
69
|
+
do {
|
|
70
|
+
x2 = 2 * randint(-5, 6, [x1]) + (isEven ? 0 : 1);
|
|
71
|
+
} while (nbOfRoots === 2 && x2 === x1);
|
|
69
72
|
return TrinomConstructor.fromRoots([x1, x2], a);
|
|
70
73
|
}
|
|
71
74
|
static fromCoeffs(coeffs) {
|
|
@@ -24,5 +24,6 @@ export declare class ConstantNode implements AlgebraicNode {
|
|
|
24
24
|
equals(node: AlgebraicNode): boolean;
|
|
25
25
|
toDetailedEvaluation(vars: Record<string, AlgebraicNode>): AlgebraicNode;
|
|
26
26
|
derivative(): AlgebraicNode;
|
|
27
|
+
toSignInequationTex(): string;
|
|
27
28
|
}
|
|
28
29
|
//# sourceMappingURL=constantNode.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constantNode.d.ts","sourceRoot":"","sources":["../../../../src/tree/nodes/numbers/constantNode.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACrD,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEpD,wBAAgB,cAAc,CAAC,CAAC,EAA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EAAE,MAAM;IAQ1D,YAAY,IAAI,MAAM;IAGtB,KAAK,IAAI,MAAM;IAMf,cAAc;IAGd,aAAa;;;;;;IAQb,iBAAiB;IAGjB,QAAQ;IAGR,QAAQ;IAGR,MAAM,CAAC,IAAI,EAAE,aAAa;IAG1B,oBAAoB,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC;IAIxD,UAAU,IAEe,aAAa;IAEtC,mBAAmB;CAOpB"}
|
|
@@ -60,4 +60,11 @@ export class ConstantNode {
|
|
|
60
60
|
throw Error("Can't derivate infinite node");
|
|
61
61
|
return (0).toTree();
|
|
62
62
|
}
|
|
63
|
+
toSignInequationTex() {
|
|
64
|
+
return this.value > 0
|
|
65
|
+
? `${this.toTex()}>0`
|
|
66
|
+
: this.value === 0
|
|
67
|
+
? `${this.toTex()}=0`
|
|
68
|
+
: `${this.toTex()}<0`;
|
|
69
|
+
}
|
|
63
70
|
}
|
|
@@ -31,5 +31,6 @@ export declare class NumberNode implements AlgebraicNode {
|
|
|
31
31
|
derivative(): AlgebraicNode;
|
|
32
32
|
toFrac(shouldSimplify?: boolean): AlgebraicNode | NumberNode;
|
|
33
33
|
toPrimeDecomposition(usePowers?: boolean): AlgebraicNode | this | MultiplyNode;
|
|
34
|
+
toSignInequationTex(): string;
|
|
34
35
|
}
|
|
35
36
|
//# sourceMappingURL=numberNode.d.ts.map
|
|
@@ -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,WAAW,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAChF,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAGrE,OAAO,EAAE,YAAY,EAAkB,MAAM,8BAA8B,CAAC;AAM5E,OAAO,EAAE,YAAY,EAAE,MAAM,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|
|
118
118
|
return nodes[0];
|
|
119
119
|
return operatorComposition(MultiplyNode, nodes);
|
|
120
120
|
}
|
|
121
|
+
toSignInequationTex() {
|
|
122
|
+
return this.value > 0
|
|
123
|
+
? `${this.toTex()}>0`
|
|
124
|
+
: this.value === 0
|
|
125
|
+
? `${this.toTex()}=0`
|
|
126
|
+
: `${this.toTex()}<0`;
|
|
127
|
+
}
|
|
121
128
|
}
|