math-exercises 3.0.178 → 3.0.179
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/math/derivation/derivative/derivativeEquationSolving1.d.ts +14 -0
- package/lib/exercises/math/derivation/derivative/derivativeEquationSolving1.d.ts.map +1 -0
- package/lib/exercises/math/derivation/derivative/derivativeEquationSolving1.js +283 -0
- package/lib/exercises/math/derivation/derivative/derivativeEquationSolving3.d.ts +15 -0
- package/lib/exercises/math/derivation/derivative/derivativeEquationSolving3.d.ts.map +1 -0
- package/lib/exercises/math/derivation/derivative/derivativeEquationSolving3.js +296 -0
- package/lib/exercises/math/derivation/derivative/exp/expDerivativeOne.js +3 -3
- package/lib/exercises/math/derivation/derivative/exp/expDerivativeProductFExp.d.ts +14 -0
- package/lib/exercises/math/derivation/derivative/exp/expDerivativeProductFExp.d.ts.map +1 -0
- package/lib/exercises/math/derivation/derivative/exp/expDerivativeProductFExp.js +346 -0
- package/lib/exercises/math/derivation/derivative/exp/expDerivativeQuotientFExp.d.ts +15 -0
- package/lib/exercises/math/derivation/derivative/exp/expDerivativeQuotientFExp.d.ts.map +1 -0
- package/lib/exercises/math/derivation/derivative/exp/expDerivativeQuotientFExp.js +435 -0
- package/lib/exercises/math/derivation/derivative/valueDerivativeFromFunctionExpression.d.ts +13 -0
- package/lib/exercises/math/derivation/derivative/valueDerivativeFromFunctionExpression.d.ts.map +1 -0
- package/lib/exercises/math/derivation/derivative/valueDerivativeFromFunctionExpression.js +326 -0
- package/lib/exercises/math/derivation/derivativeNumber/signOfDerivativeNumberFromFunctionCurve.d.ts +14 -0
- package/lib/exercises/math/derivation/derivativeNumber/signOfDerivativeNumberFromFunctionCurve.d.ts.map +1 -0
- package/lib/exercises/math/derivation/derivativeNumber/signOfDerivativeNumberFromFunctionCurve.js +181 -0
- package/lib/exercises/math/derivation/derivativeNumber/valueTableImageAndDerivativeFromFunctionExpression.d.ts +10 -0
- package/lib/exercises/math/derivation/derivativeNumber/valueTableImageAndDerivativeFromFunctionExpression.d.ts.map +1 -0
- package/lib/exercises/math/derivation/derivativeNumber/valueTableImageAndDerivativeFromFunctionExpression.js +272 -0
- package/lib/exercises/math/derivation/problems/index.d.ts +5 -0
- package/lib/exercises/math/derivation/problems/index.d.ts.map +1 -0
- package/lib/exercises/math/derivation/problems/index.js +4 -0
- package/lib/exercises/math/derivation/problems/problemMaximizeBoxVolumeFindX.d.ts +8 -0
- package/lib/exercises/math/derivation/problems/problemMaximizeBoxVolumeFindX.d.ts.map +1 -0
- package/lib/exercises/math/derivation/problems/problemMaximizeBoxVolumeFindX.js +171 -0
- package/lib/exercises/math/derivation/problems/problemMaximizeProfitFindProduction.d.ts +15 -0
- package/lib/exercises/math/derivation/problems/problemMaximizeProfitFindProduction.d.ts.map +1 -0
- package/lib/exercises/math/derivation/problems/problemMaximizeProfitFindProduction.js +328 -0
- package/lib/exercises/math/derivation/problems/problemMovementOnLineFindSpeedAtPoint.d.ts +13 -0
- package/lib/exercises/math/derivation/problems/problemMovementOnLineFindSpeedAtPoint.d.ts.map +1 -0
- package/lib/exercises/math/derivation/problems/problemMovementOnLineFindSpeedAtPoint.js +275 -0
- package/lib/exercises/math/derivation/problems/problemProjectileHeightFindAbscissa.d.ts +8 -0
- package/lib/exercises/math/derivation/problems/problemProjectileHeightFindAbscissa.d.ts.map +1 -0
- package/lib/exercises/math/derivation/problems/problemProjectileHeightFindAbscissa.js +137 -0
- package/lib/exercises/math/derivation/tangent/derivativeEquationSolvingByManipulatingLineY.d.ts +10 -0
- package/lib/exercises/math/derivation/tangent/derivativeEquationSolvingByManipulatingLineY.d.ts.map +1 -0
- package/lib/exercises/math/derivation/tangent/derivativeEquationSolvingByManipulatingLineY.js +478 -0
- package/lib/exercises/math/derivation/tangent/derivativeEquationSolvingByManipulatingLineYAndSlope.d.ts +10 -0
- package/lib/exercises/math/derivation/tangent/derivativeEquationSolvingByManipulatingLineYAndSlope.d.ts.map +1 -0
- package/lib/exercises/math/derivation/tangent/derivativeEquationSolvingByManipulatingLineYAndSlope.js +499 -0
- package/lib/exercises/math/derivation/tangent/derivativeEquationSolvingByManipulatingPoint.d.ts +10 -0
- package/lib/exercises/math/derivation/tangent/derivativeEquationSolvingByManipulatingPoint.d.ts.map +1 -0
- package/lib/exercises/math/derivation/tangent/derivativeEquationSolvingByManipulatingPoint.js +240 -0
- package/lib/exercises/math/derivation/tangent/derivativeReadingByManipulatingBuildingTangent.d.ts +12 -0
- package/lib/exercises/math/derivation/tangent/derivativeReadingByManipulatingBuildingTangent.d.ts.map +1 -0
- package/lib/exercises/math/derivation/tangent/derivativeReadingByManipulatingBuildingTangent.js +436 -0
- package/lib/exercises/math/derivation/tangent/derivativeReadingByManipulatingPoint.d.ts +12 -0
- package/lib/exercises/math/derivation/tangent/derivativeReadingByManipulatingPoint.d.ts.map +1 -0
- package/lib/exercises/math/derivation/tangent/derivativeReadingByManipulatingPoint.js +219 -0
- package/lib/exercises/math/derivation/tangent/derivativeReadingByManipulatingSecant.d.ts +13 -0
- package/lib/exercises/math/derivation/tangent/derivativeReadingByManipulatingSecant.d.ts.map +1 -0
- package/lib/exercises/math/derivation/tangent/derivativeReadingByManipulatingSecant.js +273 -0
- package/lib/exercises/math/derivation/tangent/placePointsOfDerivativeFromGraph.d.ts +18 -0
- package/lib/exercises/math/derivation/tangent/placePointsOfDerivativeFromGraph.d.ts.map +1 -0
- package/lib/exercises/math/derivation/tangent/placePointsOfDerivativeFromGraph.js +295 -0
- package/lib/exercises/math/derivation/tangent/tangentEquationFromFunctionExpression.d.ts +13 -0
- package/lib/exercises/math/derivation/tangent/tangentEquationFromFunctionExpression.d.ts.map +1 -0
- package/lib/exercises/math/derivation/tangent/tangentEquationFromFunctionExpression.js +388 -0
- package/lib/exercises/math/derivation/tangent/tangentEquationFromGraph.d.ts +9 -0
- package/lib/exercises/math/derivation/tangent/tangentEquationFromGraph.d.ts.map +1 -0
- package/lib/exercises/math/derivation/tangent/tangentEquationFromGraph.js +308 -0
- package/lib/exercises/math/derivation/variations/findAbscissaOfExtremaFromFunctionExpression.d.ts +14 -0
- package/lib/exercises/math/derivation/variations/findAbscissaOfExtremaFromFunctionExpression.d.ts.map +1 -0
- package/lib/exercises/math/derivation/variations/findAbscissaOfExtremaFromFunctionExpression.js +439 -0
- package/lib/exercises/math/derivation/variations/findExtremaFromFunctionExpression.d.ts +14 -0
- package/lib/exercises/math/derivation/variations/findExtremaFromFunctionExpression.d.ts.map +1 -0
- package/lib/exercises/math/derivation/variations/findExtremaFromFunctionExpression.js +547 -0
- package/lib/exercises/math/derivation/variations/plausibleDerivativeGraphFromFunctionGraphByManipulatingPolynomial.d.ts +15 -0
- package/lib/exercises/math/derivation/variations/plausibleDerivativeGraphFromFunctionGraphByManipulatingPolynomial.d.ts.map +1 -0
- package/lib/exercises/math/derivation/variations/plausibleDerivativeGraphFromFunctionGraphByManipulatingPolynomial.js +537 -0
- package/lib/exercises/math/derivation/variations/plausibleFunctionGraphFromDerivativeGraphByManipulatingPolynomial.d.ts +15 -0
- package/lib/exercises/math/derivation/variations/plausibleFunctionGraphFromDerivativeGraphByManipulatingPolynomial.d.ts.map +1 -0
- package/lib/exercises/math/derivation/variations/plausibleFunctionGraphFromDerivativeGraphByManipulatingPolynomial.js +639 -0
- package/lib/exercises/math/derivation/variations/signVarTableFromFunctionExpression.d.ts +14 -0
- package/lib/exercises/math/derivation/variations/signVarTableFromFunctionExpression.d.ts.map +1 -0
- package/lib/exercises/math/derivation/variations/signVarTableFromFunctionExpression.js +530 -0
- package/lib/exercises/math/derivation/variations/signVarTableProductFExp.d.ts +10 -0
- package/lib/exercises/math/derivation/variations/signVarTableProductFExp.d.ts.map +1 -0
- package/lib/exercises/math/derivation/variations/signVarTableProductFExp.js +451 -0
- package/lib/exercises/math/derivation/variations/signVarTableQuotientFExp.d.ts +11 -0
- package/lib/exercises/math/derivation/variations/signVarTableQuotientFExp.d.ts.map +1 -0
- package/lib/exercises/math/derivation/variations/signVarTableQuotientFExp.js +514 -0
- package/lib/exercises/math/functions/composition/index.d.ts +0 -1
- package/lib/exercises/math/functions/composition/index.d.ts.map +1 -1
- package/lib/exercises/math/functions/composition/index.js +1 -1
- package/lib/exercises/math/functions/exponential/algebraic/index.d.ts +0 -1
- package/lib/exercises/math/functions/exponential/algebraic/index.d.ts.map +1 -1
- package/lib/exercises/math/functions/exponential/algebraic/index.js +1 -1
- package/lib/exercises/math/functions/trinoms/sign/signOfProductOfAffineAndTrinom.d.ts.map +1 -1
- package/lib/exercises/math/functions/trinoms/sign/signOfProductOfAffineAndTrinom.js +4 -11
- package/lib/exercises/math/geometry/vectors/scalarProduct/scalarProductOrthoInSquare.d.ts.map +1 -1
- package/lib/exercises/math/geometry/vectors/scalarProduct/scalarProductOrthoInSquare.js +32 -17
- package/lib/exercises/math/probaStat/conditional/conditionalProbaFromTableWithContext.d.ts +13 -0
- package/lib/exercises/math/probaStat/conditional/conditionalProbaFromTableWithContext.d.ts.map +1 -0
- package/lib/exercises/math/probaStat/conditional/conditionalProbaFromTableWithContext.js +195 -0
- package/lib/exercises/math/probaStat/conditional/conditionalProbaWriteFromFrench.d.ts +9 -0
- package/lib/exercises/math/probaStat/conditional/conditionalProbaWriteFromFrench.d.ts.map +1 -0
- package/lib/exercises/math/probaStat/conditional/conditionalProbaWriteFromFrench.js +220 -0
- package/lib/exercises/math/probaStat/conditional/conditionalProbability.d.ts +15 -0
- package/lib/exercises/math/probaStat/conditional/conditionalProbability.d.ts.map +1 -0
- package/lib/exercises/math/probaStat/conditional/conditionalProbability.js +332 -0
- package/lib/exercises/math/probaStat/conditional/fillTableConditionalProbabilitySituation.d.ts +8 -0
- package/lib/exercises/math/probaStat/conditional/fillTableConditionalProbabilitySituation.d.ts.map +1 -0
- package/lib/exercises/math/probaStat/conditional/fillTableConditionalProbabilitySituation.js +222 -0
- package/lib/exercises/math/probaStat/conditional/index.d.ts +5 -0
- package/lib/exercises/math/probaStat/conditional/index.d.ts.map +1 -0
- package/lib/exercises/math/probaStat/conditional/index.js +4 -0
- package/lib/exercises/math/probaStat/index.d.ts +1 -2
- package/lib/exercises/math/probaStat/index.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/index.js +1 -2
- package/lib/exercises/math/probaStat/probaFromTableWithContext.d.ts +1 -0
- package/lib/exercises/math/probaStat/probaFromTableWithContext.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/probaFromTableWithContext.js +26 -199
- package/lib/exercises/math/probaStat/randomVariable/randomVariableSituationProbabilityLaw.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/randomVariable/randomVariableSituationProbabilityLaw.js +6 -2
- package/lib/exercises/math/probaStat/randomVariable/utils/randomVariableSituations.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/randomVariable/utils/randomVariableSituations.js +6 -5
- package/lib/exercises/math/probaStat/trees/buildTreeFromSituation.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/trees/buildTreeFromSituation.js +4 -27
- package/lib/exercises/math/probaStat/twoEventsSituations.d.ts +29 -0
- package/lib/exercises/math/probaStat/twoEventsSituations.d.ts.map +1 -0
- package/lib/exercises/math/probaStat/twoEventsSituations.js +145 -0
- package/lib/exercises/math/sequences/explicitFormulaUsage.d.ts +4 -1
- package/lib/exercises/math/sequences/explicitFormulaUsage.d.ts.map +1 -1
- package/lib/exercises/math/sequences/explicitFormulaUsage.js +47 -7
- package/lib/exercises/math/sequences/geometric/geometricFindRandomTermFromTwoTerms.js +1 -1
- package/lib/exercises/math/sequences/geometric/index.d.ts +0 -3
- package/lib/exercises/math/sequences/geometric/index.d.ts.map +1 -1
- package/lib/exercises/math/sequences/geometric/index.js +3 -3
- package/lib/exercises/math/sequences/geometric/situations/index.d.ts +0 -1
- package/lib/exercises/math/sequences/geometric/situations/index.d.ts.map +1 -1
- package/lib/exercises/math/sequences/geometric/situations/index.js +1 -1
- package/lib/exercises/math/sequences/recurrenceFormulaUsage.d.ts +5 -1
- package/lib/exercises/math/sequences/recurrenceFormulaUsage.d.ts.map +1 -1
- package/lib/exercises/math/sequences/recurrenceFormulaUsage.js +89 -9
- package/lib/exercises/math/trigonometry/circle/associatePoint.d.ts.map +1 -1
- package/lib/exercises/math/trigonometry/circle/associatePoint.js +55 -6
- package/lib/exercises/math/trigonometry/circle/selectQuadrantOnTrigoCircle.d.ts.map +1 -1
- package/lib/exercises/math/trigonometry/circle/selectQuadrantOnTrigoCircle.js +5 -6
- package/lib/exercises/math/trigonometry/functions/associateAngleSimplification.d.ts.map +1 -1
- package/lib/exercises/math/trigonometry/functions/associateAngleSimplification.js +1 -3
- package/lib/exercises/vea/polynomialVEA.d.ts +2 -0
- package/lib/exercises/vea/polynomialVEA.d.ts.map +1 -0
- package/lib/exercises/vea/polynomialVEA.js +17 -0
- package/lib/exercises/vea/valueTableVEA.d.ts +8 -0
- package/lib/exercises/vea/valueTableVEA.d.ts.map +1 -0
- package/lib/exercises/vea/valueTableVEA.js +12 -0
- package/lib/index.d.ts +27 -47
- package/lib/index.d.ts.map +1 -1
- package/lib/latexTester.d.ts.map +1 -1
- package/lib/latexTester.js +1 -1
- package/lib/math/utils/polynomial/polynomialInterpolationUtils.d.ts +19 -0
- package/lib/math/utils/polynomial/polynomialInterpolationUtils.d.ts.map +1 -0
- package/lib/math/utils/polynomial/polynomialInterpolationUtils.js +53 -0
- package/lib/math/utils/polynomial/polynomialUtils.d.ts +37 -0
- package/lib/math/utils/polynomial/polynomialUtils.d.ts.map +1 -0
- package/lib/math/utils/polynomial/polynomialUtils.js +223 -0
- package/lib/math/utils/sequences/situations/seqArithmeticSituations.d.ts.map +1 -1
- package/lib/math/utils/sequences/situations/seqArithmeticSituations.js +6 -6
- package/lib/tree/nodes/operators/multiplyNode.d.ts.map +1 -1
- package/lib/tree/nodes/operators/multiplyNode.js +1 -1
- package/lib/tree/nodes/operators/substractNode.d.ts.map +1 -1
- package/lib/tree/nodes/operators/substractNode.js +2 -1
- package/lib/tree/utilities/nodeUtils.d.ts +6 -0
- package/lib/tree/utilities/nodeUtils.d.ts.map +1 -0
- package/lib/tree/utilities/nodeUtils.js +24 -0
- package/lib/utils/strings/prependArticle.d.ts +2 -0
- package/lib/utils/strings/prependArticle.d.ts.map +1 -0
- package/lib/utils/strings/prependArticle.js +1 -0
- package/package.json +1 -1
package/lib/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,KAAK,aAAa,MAAM,2BAA2B,CAAC;AAE3D,OAAO,4BAA4B,CAAC;AACpC,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAC/D,QAAA,MAAM,aAAa
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,KAAK,aAAa,MAAM,2BAA2B,CAAC;AAE3D,OAAO,4BAA4B,CAAC;AACpC,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAC/D,QAAA,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kDAA+B,CAAC;AACnD,QAAA,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kDAA6B,CAAC;AAE/C,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,QAAQ,EAAE,QAAQ,EAAE,cAAc,EAAE,CAAC"}
|
package/lib/latexTester.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"latexTester.d.ts","sourceRoot":"","sources":["../src/latexTester.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,WAAW,GAAI,OAAO,MAAM,EAAE,6BAA2B,
|
|
1
|
+
{"version":3,"file":"latexTester.d.ts","sourceRoot":"","sources":["../src/latexTester.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,WAAW,GAAI,OAAO,MAAM,EAAE,6BAA2B,YAgMrE,CAAC"}
|
package/lib/latexTester.js
CHANGED
|
@@ -19,7 +19,7 @@ export const latexTester = (latex, isDefaultInMathMode = false) => {
|
|
|
19
19
|
}
|
|
20
20
|
if (char === "$") {
|
|
21
21
|
if (isDefaultInMathMode)
|
|
22
|
-
throw new Error(
|
|
22
|
+
throw new Error(`Dollar in default math mode, ${latex}`);
|
|
23
23
|
if (inPython || inInlinePython)
|
|
24
24
|
throw new Error("Dollar in python mode");
|
|
25
25
|
if (nextChar === "$") {
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { AlgebraicNode } from "../../../tree/nodes/algebraicNode.js";
|
|
2
|
+
import { NodeIdentifiers } from "../../../tree/nodes/nodeConstructor.js";
|
|
3
|
+
export declare class PointOfFunction {
|
|
4
|
+
nodeAbscissa: AlgebraicNode;
|
|
5
|
+
nodeValue: AlgebraicNode;
|
|
6
|
+
nodeDerivative: AlgebraicNode;
|
|
7
|
+
constructor(nodeAbscissa: AlgebraicNode, nodeValue: AlgebraicNode, nodeDerivative: AlgebraicNode);
|
|
8
|
+
toIdentifiers(): PointOfFunctionIdentifiers;
|
|
9
|
+
}
|
|
10
|
+
export type PointOfFunctionIdentifiers = {
|
|
11
|
+
nodeIdsAbscissa: NodeIdentifiers;
|
|
12
|
+
nodeIdsValue: NodeIdentifiers;
|
|
13
|
+
nodeIdsDerivative: NodeIdentifiers;
|
|
14
|
+
};
|
|
15
|
+
export declare abstract class PointOfFunctionConstructor {
|
|
16
|
+
static fromIdentifiers(pofIds: PointOfFunctionIdentifiers): PointOfFunction;
|
|
17
|
+
}
|
|
18
|
+
export declare function createArrNodeCoeffCubic(pof1: PointOfFunction, pof2: PointOfFunction): import("../../../tree/nodes/operators/fractionNode.js").FractionNode[];
|
|
19
|
+
//# sourceMappingURL=polynomialInterpolationUtils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"polynomialInterpolationUtils.d.ts","sourceRoot":"","sources":["../../../../src/math/utils/polynomial/polynomialInterpolationUtils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAC;AAElE,OAAO,EAEL,eAAe,EAChB,MAAM,qCAAqC,CAAC;AAO7C,qBAAa,eAAe;IAEjB,YAAY,EAAE,aAAa;IAC3B,SAAS,EAAE,aAAa;IACxB,cAAc,EAAE,aAAa;gBAF7B,YAAY,EAAE,aAAa,EAC3B,SAAS,EAAE,aAAa,EACxB,cAAc,EAAE,aAAa;IAEtC,aAAa,IAKN,0BAA0B;CAElC;AAED,MAAM,MAAM,0BAA0B,GAAG;IACvC,eAAe,EAAE,eAAe,CAAC;IACjC,YAAY,EAAE,eAAe,CAAC;IAC9B,iBAAiB,EAAE,eAAe,CAAC;CACpC,CAAC;AAEF,8BAAsB,0BAA0B;IAC9C,MAAM,CAAC,eAAe,CAAC,MAAM,EAAE,0BAA0B;CAY1D;AAED,wBAAgB,uBAAuB,CACrC,IAAI,EAAE,eAAe,EACrB,IAAI,EAAE,eAAe,uEA0FtB"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { opposite } from "../../../tree/nodes/functions/oppositeNode.js";
|
|
2
|
+
import { NodeConstructor, } from "../../../tree/nodes/nodeConstructor.js";
|
|
3
|
+
import { add } from "../../../tree/nodes/operators/addNode.js";
|
|
4
|
+
import { frac } from "../../../tree/nodes/operators/fractionNode.js";
|
|
5
|
+
import { multiply } from "../../../tree/nodes/operators/multiplyNode.js";
|
|
6
|
+
import { power } from "../../../tree/nodes/operators/powerNode.js";
|
|
7
|
+
import { substract } from "../../../tree/nodes/operators/substractNode.js";
|
|
8
|
+
export class PointOfFunction {
|
|
9
|
+
nodeAbscissa;
|
|
10
|
+
nodeValue;
|
|
11
|
+
nodeDerivative;
|
|
12
|
+
constructor(nodeAbscissa, nodeValue, nodeDerivative) {
|
|
13
|
+
this.nodeAbscissa = nodeAbscissa;
|
|
14
|
+
this.nodeValue = nodeValue;
|
|
15
|
+
this.nodeDerivative = nodeDerivative;
|
|
16
|
+
}
|
|
17
|
+
toIdentifiers() {
|
|
18
|
+
return {
|
|
19
|
+
nodeIdsAbscissa: this.nodeAbscissa.toIdentifiers(),
|
|
20
|
+
nodeIdsValue: this.nodeValue.toIdentifiers(),
|
|
21
|
+
nodeIdsDerivative: this.nodeDerivative.toIdentifiers(),
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
export class PointOfFunctionConstructor {
|
|
26
|
+
static fromIdentifiers(pofIds) {
|
|
27
|
+
const nodeAbscissa = NodeConstructor.fromIdentifiers(pofIds.nodeIdsAbscissa);
|
|
28
|
+
const nodeValue = NodeConstructor.fromIdentifiers(pofIds.nodeIdsValue);
|
|
29
|
+
const nodeDerivative = NodeConstructor.fromIdentifiers(pofIds.nodeIdsDerivative);
|
|
30
|
+
return new PointOfFunction(nodeAbscissa, nodeValue, nodeDerivative);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
export function createArrNodeCoeffCubic(pof1, pof2) {
|
|
34
|
+
//
|
|
35
|
+
//pof1 = {x1,u1,v1}
|
|
36
|
+
//pof2 = {x2,u2,v2}
|
|
37
|
+
//
|
|
38
|
+
//f(x) = ax^3+bx^2+cx+d
|
|
39
|
+
//f'(x) = 2ax+b
|
|
40
|
+
//
|
|
41
|
+
//f(x1) = u1 <=> a(x1)^3+b(x1)^2+c(x1)+d = u1
|
|
42
|
+
//f(x2) = u2 <=> a(x2)^3+b(x2)^2+c(x2)+d = u2
|
|
43
|
+
//f'(x1) = v1 <=> 3a(x1)^2+2b(x1)+c = v1
|
|
44
|
+
//f'(x2) = v2 <=> 3a(x2)^2+2b(x2)+c = v2
|
|
45
|
+
//
|
|
46
|
+
const { nodeAbscissa: x1, nodeValue: u1, nodeDerivative: v1 } = pof1;
|
|
47
|
+
const { nodeAbscissa: x2, nodeValue: u2, nodeDerivative: v2 } = pof2;
|
|
48
|
+
const nodeA = frac(add(multiply(add(v1, v2), substract(x1, x2)), multiply(2, substract(u2, u1))), power(substract(x1, x2), 3));
|
|
49
|
+
const nodeB = frac(add(multiply(opposite(add(v1, multiply(2, v2))), power(x1, 2)), add(multiply(add(multiply(substract(v2, v1), x2), multiply(3, substract(u1, u2))), x1), multiply(2, multiply(x2, add(multiply(add(v1, frac(v2, 2)), x2), multiply(frac(3, 2), substract(u1, u2))))))), power(substract(x1, x2), 3));
|
|
50
|
+
const nodeC = frac(substract(add(multiply(v2, power(x1, 3)), multiply(2, multiply(add(v1, frac(v2, 2)), multiply(x2, power(x1, 2))))), add(multiply(x2, multiply(x1, add(multiply(add(v1, multiply(2, v2)), x2), multiply(6, substract(u1, u2))))), multiply(v1, power(x2, 3)))), power(substract(x1, x2), 3));
|
|
51
|
+
const nodeD = frac(substract(add(multiply(substract(u2, multiply(v2, x2)), power(x1, 3)), multiply(power(x2, 2), multiply(x1, add(multiply(v1, x2), multiply(3, u1))))), add(multiply(power(x1, 2), multiply(x2, add(multiply(substract(v1, v2), x2), multiply(3, u2)))), multiply(u1, power(x2, 3)))), power(substract(x1, x2), 3));
|
|
52
|
+
return [nodeD, nodeC, nodeB, nodeA];
|
|
53
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { AlgebraicNode } from "../../../tree/nodes/algebraicNode.js";
|
|
2
|
+
import { VariableNode } from "../../../tree/nodes/variables/variableNode.js";
|
|
3
|
+
/**
|
|
4
|
+
*
|
|
5
|
+
* @param nodeA
|
|
6
|
+
* @param arrNodeRoot
|
|
7
|
+
* @returns a(x - root1)...(x - rootn)
|
|
8
|
+
*/
|
|
9
|
+
export declare function createNodeFPolynomialFromRoots(nodeA: AlgebraicNode, arrNodeRoot: AlgebraicNode[]): AlgebraicNode;
|
|
10
|
+
/**
|
|
11
|
+
*
|
|
12
|
+
* @param nodePolynomial
|
|
13
|
+
* @returns for example: [nodeCoeffC, nodeCoeffB, nodeCoeffA] if nodePolynomial is a trinom
|
|
14
|
+
*/
|
|
15
|
+
export declare function getArrNodeCoeffOfPolynomialNode(nodePolynomial: AlgebraicNode): AlgebraicNode[];
|
|
16
|
+
/**
|
|
17
|
+
*
|
|
18
|
+
* @param arrNodeCoeff
|
|
19
|
+
* @returns coeffN x^N + ... + coeff2 x^2 + coeff1 x^1 + coeff0
|
|
20
|
+
*/
|
|
21
|
+
export declare function createNodeFPolynomialFromCoeffs(arrNodeCoeff: AlgebraicNode[]): AlgebraicNode | import("../../../tree/nodes/operators/multiplyNode.js").MultiplyNode;
|
|
22
|
+
/**
|
|
23
|
+
*
|
|
24
|
+
* @param arrNodeCoeff
|
|
25
|
+
* @returns discriminator
|
|
26
|
+
*/
|
|
27
|
+
export declare function createNodeDiscriminator(arrNodeCoeff: AlgebraicNode[]): import("../../../tree/nodes/operators/substractNode.js").SubstractNode;
|
|
28
|
+
export declare const getTexSolveSecondDegreeEquation: (nodePolynomial: AlgebraicNode, opts?: {
|
|
29
|
+
nodeVar: VariableNode;
|
|
30
|
+
isShouldApprox: boolean;
|
|
31
|
+
}) => string;
|
|
32
|
+
export declare const getAnswerStuffSolveSecondDegreePolynomial: (nodePolynomial: AlgebraicNode) => {
|
|
33
|
+
nodePolynomial: AlgebraicNode;
|
|
34
|
+
arrNodeX: AlgebraicNode[];
|
|
35
|
+
};
|
|
36
|
+
export declare function createIntegratedPolynomialNode(nodePolynomial: AlgebraicNode, nodeC: AlgebraicNode): AlgebraicNode;
|
|
37
|
+
//# sourceMappingURL=polynomialUtils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"polynomialUtils.d.ts","sourceRoot":"","sources":["../../../../src/math/utils/polynomial/polynomialUtils.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,aAAa,EAEd,MAAM,mCAAmC,CAAC;AAQ3C,OAAO,EAAE,YAAY,EAAE,MAAM,4CAA4C,CAAC;AAM1E;;;;;GAKG;AACH,wBAAgB,8BAA8B,CAC5C,KAAK,EAAE,aAAa,EACpB,WAAW,EAAE,aAAa,EAAE,iBAO7B;AAED;;;;GAIG;AACH,wBAAgB,+BAA+B,CAAC,cAAc,EAAE,aAAa,mBAe5E;AAED;;;;GAIG;AACH,wBAAgB,+BAA+B,CAAC,YAAY,EAAE,aAAa,EAAE,qFAgB5E;AAED;;;;GAIG;AACH,wBAAgB,uBAAuB,CAAC,YAAY,EAAE,aAAa,EAAE,uEAGpE;AAaD,eAAO,MAAM,+BAA+B,GAC1C,gBAAgB,aAAa,EAC7B,OAAM;IAAE,OAAO,EAAE,YAAY,CAAC;IAAC,cAAc,EAAE,OAAO,CAAA;CAGrD,WAoGF,CAAC;AAEF,eAAO,MAAM,yCAAyC,GACpD,gBAAgB,aAAa;;;CA+C9B,CAAC;AAEF,wBAAgB,8BAA8B,CAC5C,cAAc,EAAE,aAAa,EAC7B,KAAK,EAAE,aAAa,iBAQrB"}
|
|
@@ -0,0 +1,223 @@
|
|
|
1
|
+
import { opposite } from "../../../tree/nodes/functions/oppositeNode.js";
|
|
2
|
+
import { sqrt } from "../../../tree/nodes/functions/sqrtNode.js";
|
|
3
|
+
import { add } from "../../../tree/nodes/operators/addNode.js";
|
|
4
|
+
import { frac } from "../../../tree/nodes/operators/fractionNode.js";
|
|
5
|
+
import { multiply } from "../../../tree/nodes/operators/multiplyNode.js";
|
|
6
|
+
import { power } from "../../../tree/nodes/operators/powerNode.js";
|
|
7
|
+
import { substract } from "../../../tree/nodes/operators/substractNode.js";
|
|
8
|
+
import { alignTex } from "../../../utils/latex/alignTex.js";
|
|
9
|
+
import { factorial } from "../arithmetic/factorial.js";
|
|
10
|
+
import { nodeBySubstitutingVar } from "../functions/functionComposition.js";
|
|
11
|
+
import { round } from "../round.js";
|
|
12
|
+
/**
|
|
13
|
+
*
|
|
14
|
+
* @param nodeA
|
|
15
|
+
* @param arrNodeRoot
|
|
16
|
+
* @returns a(x - root1)...(x - rootn)
|
|
17
|
+
*/
|
|
18
|
+
export function createNodeFPolynomialFromRoots(nodeA, arrNodeRoot) {
|
|
19
|
+
const nodeVarX = "x".toTree();
|
|
20
|
+
const nodePolynomial = arrNodeRoot.reduce((acc, nodeCoeff) => {
|
|
21
|
+
return multiply(acc, substract(nodeVarX, nodeCoeff));
|
|
22
|
+
}, nodeA);
|
|
23
|
+
return nodePolynomial;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
*
|
|
27
|
+
* @param nodePolynomial
|
|
28
|
+
* @returns for example: [nodeCoeffC, nodeCoeffB, nodeCoeffA] if nodePolynomial is a trinom
|
|
29
|
+
*/
|
|
30
|
+
export function getArrNodeCoeffOfPolynomialNode(nodePolynomial) {
|
|
31
|
+
const arrNodeCoeff = [];
|
|
32
|
+
let nodeWork = nodePolynomial;
|
|
33
|
+
let counter = 0;
|
|
34
|
+
do {
|
|
35
|
+
const nodeVarX = "x".toTree();
|
|
36
|
+
const nodeCoeff = frac(nodeBySubstitutingVar(nodeWork, (0).toTree(), nodeVarX).simplify(), factorial(counter)).simplify();
|
|
37
|
+
arrNodeCoeff.push(nodeCoeff);
|
|
38
|
+
nodeWork = nodeWork.derivative().simplify();
|
|
39
|
+
counter++;
|
|
40
|
+
} while (nodeWork.evaluate({ x: 0 }) !== 0);
|
|
41
|
+
return arrNodeCoeff;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
*
|
|
45
|
+
* @param arrNodeCoeff
|
|
46
|
+
* @returns coeffN x^N + ... + coeff2 x^2 + coeff1 x^1 + coeff0
|
|
47
|
+
*/
|
|
48
|
+
export function createNodeFPolynomialFromCoeffs(arrNodeCoeff) {
|
|
49
|
+
const nodeVarX = "x".toTree();
|
|
50
|
+
const nodePolynomial = arrNodeCoeff
|
|
51
|
+
.map((nodeCoeff, i) => {
|
|
52
|
+
switch (i) {
|
|
53
|
+
case 0:
|
|
54
|
+
return nodeCoeff;
|
|
55
|
+
case 1:
|
|
56
|
+
return multiply(nodeCoeff, nodeVarX);
|
|
57
|
+
default:
|
|
58
|
+
return multiply(nodeCoeff, power(nodeVarX, i));
|
|
59
|
+
}
|
|
60
|
+
})
|
|
61
|
+
.toReversed()
|
|
62
|
+
.reduce((acc, node) => add(acc, node));
|
|
63
|
+
return nodePolynomial;
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
*
|
|
67
|
+
* @param arrNodeCoeff
|
|
68
|
+
* @returns discriminator
|
|
69
|
+
*/
|
|
70
|
+
export function createNodeDiscriminator(arrNodeCoeff) {
|
|
71
|
+
const [nodeC, nodeB, nodeA] = arrNodeCoeff;
|
|
72
|
+
return substract(power(nodeB, 2), multiply(4, multiply(nodeA, nodeC)));
|
|
73
|
+
}
|
|
74
|
+
const tryToSimplify = (node, simplifyOptions) => {
|
|
75
|
+
try {
|
|
76
|
+
return node.simplify(simplifyOptions);
|
|
77
|
+
}
|
|
78
|
+
catch (_) {
|
|
79
|
+
return node;
|
|
80
|
+
}
|
|
81
|
+
};
|
|
82
|
+
export const getTexSolveSecondDegreeEquation = (nodePolynomial, opts = {
|
|
83
|
+
nodeVar: "x".toTree(),
|
|
84
|
+
isShouldApprox: false,
|
|
85
|
+
}) => {
|
|
86
|
+
const nodeVarX = "x".toTree();
|
|
87
|
+
const { nodeVar, isShouldApprox } = opts;
|
|
88
|
+
const arrNodeCoeff = getArrNodeCoeffOfPolynomialNode(nodePolynomial);
|
|
89
|
+
const nodePolynomialExpanded = createNodeFPolynomialFromCoeffs(arrNodeCoeff);
|
|
90
|
+
const degree = arrNodeCoeff.length - 1;
|
|
91
|
+
return `On veut résoudre l'équation :
|
|
92
|
+
|
|
93
|
+
$$
|
|
94
|
+
${nodeBySubstitutingVar(nodePolynomialExpanded, nodeVar, nodeVarX).toTex()} = 0
|
|
95
|
+
$$
|
|
96
|
+
|
|
97
|
+
${(() => {
|
|
98
|
+
if (degree === 2) {
|
|
99
|
+
const [_nodeC, nodeB, nodeA] = arrNodeCoeff;
|
|
100
|
+
const nodeDiscr = createNodeDiscriminator(arrNodeCoeff);
|
|
101
|
+
const discr = nodeDiscr.evaluate();
|
|
102
|
+
if (discr > 0) {
|
|
103
|
+
const [nodeX1, nodeX2] = [add, substract].map((addSub) => frac(addSub(opposite(nodeB), sqrt(tryToSimplify(nodeDiscr, {}))), multiply(2, nodeA)));
|
|
104
|
+
return `On a :
|
|
105
|
+
|
|
106
|
+
${alignTex([
|
|
107
|
+
["\\Delta", "=", nodeDiscr.toTex()],
|
|
108
|
+
["\\Delta", "=", nodeDiscr.simplify().toTex()],
|
|
109
|
+
["\\Delta", ">", "0"],
|
|
110
|
+
])}
|
|
111
|
+
|
|
112
|
+
Les deux racines sont :
|
|
113
|
+
|
|
114
|
+
${alignTex([
|
|
115
|
+
[`${nodeVar.name}_1`, "=", nodeX1.toTex()],
|
|
116
|
+
isShouldApprox
|
|
117
|
+
? ["", "\\approx", round(nodeX1.evaluate(), 2).frenchify()]
|
|
118
|
+
: ["", "=", tryToSimplify(nodeX1, {}).toTex()],
|
|
119
|
+
[`${nodeVar.name}_2`, "=", nodeX2.toTex()],
|
|
120
|
+
isShouldApprox
|
|
121
|
+
? ["", "\\approx", round(nodeX2.evaluate(), 2).frenchify()]
|
|
122
|
+
: ["", "=", tryToSimplify(nodeX2, {}).toTex()],
|
|
123
|
+
])}
|
|
124
|
+
|
|
125
|
+
`;
|
|
126
|
+
}
|
|
127
|
+
else if (discr === 0) {
|
|
128
|
+
const nodeX = frac(opposite(nodeB), multiply(2, nodeA));
|
|
129
|
+
return `On a :
|
|
130
|
+
|
|
131
|
+
${alignTex([
|
|
132
|
+
["\\Delta", "=", nodeDiscr.toTex()],
|
|
133
|
+
["\\Delta", "=", tryToSimplify(nodeDiscr, {}).toTex()],
|
|
134
|
+
["\\Delta", "=", "0"],
|
|
135
|
+
])}
|
|
136
|
+
|
|
137
|
+
Il y a une racine double :
|
|
138
|
+
|
|
139
|
+
${alignTex([
|
|
140
|
+
[`${nodeVar.name}`, "=", nodeX.toTex()],
|
|
141
|
+
isShouldApprox
|
|
142
|
+
? ["", "\\approx", round(nodeX.evaluate(), 2).frenchify()]
|
|
143
|
+
: ["", "=", tryToSimplify(nodeX, {}).toTex()],
|
|
144
|
+
])}
|
|
145
|
+
|
|
146
|
+
`;
|
|
147
|
+
}
|
|
148
|
+
else {
|
|
149
|
+
return `On a :
|
|
150
|
+
|
|
151
|
+
${alignTex([
|
|
152
|
+
["\\Delta", "=", nodeDiscr.toTex()],
|
|
153
|
+
["\\Delta", "=", tryToSimplify(nodeDiscr, {}).toTex()],
|
|
154
|
+
["\\Delta", "<", "0"],
|
|
155
|
+
])}
|
|
156
|
+
|
|
157
|
+
Il n'y a pas de solutions réelles.
|
|
158
|
+
|
|
159
|
+
`;
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
else if (degree === 1) {
|
|
163
|
+
const [nodeB, nodeA] = arrNodeCoeff;
|
|
164
|
+
const nodeX = frac(opposite(nodeB), nodeA);
|
|
165
|
+
return `On a :
|
|
166
|
+
|
|
167
|
+
${alignTex([
|
|
168
|
+
[`${nodeVar.name}`, "=", nodeX.toTex()],
|
|
169
|
+
["", "=", tryToSimplify(nodeX, {}).toTex()],
|
|
170
|
+
])}
|
|
171
|
+
|
|
172
|
+
`;
|
|
173
|
+
}
|
|
174
|
+
else {
|
|
175
|
+
throw new Error("Unsupported degree: " + degree);
|
|
176
|
+
}
|
|
177
|
+
})()}
|
|
178
|
+
|
|
179
|
+
`;
|
|
180
|
+
};
|
|
181
|
+
export const getAnswerStuffSolveSecondDegreePolynomial = (nodePolynomial) => {
|
|
182
|
+
const arrNodeCoeff = getArrNodeCoeffOfPolynomialNode(nodePolynomial);
|
|
183
|
+
const degree = arrNodeCoeff.length - 1;
|
|
184
|
+
const arrNodeX = (() => {
|
|
185
|
+
if (degree === 2) {
|
|
186
|
+
const [nodeC, nodeB, nodeA] = arrNodeCoeff;
|
|
187
|
+
const nodeDiscr = substract(power(nodeB, 2), multiply(4, multiply(nodeA, nodeC)));
|
|
188
|
+
const discr = nodeDiscr.evaluate();
|
|
189
|
+
if (discr > 0) {
|
|
190
|
+
const [nodeX1, nodeX2] = [add, substract].map((addSub) => tryToSimplify(frac(addSub(opposite(nodeB), sqrt(nodeDiscr)), multiply(2, nodeA)), {}));
|
|
191
|
+
return [nodeX1, nodeX2];
|
|
192
|
+
}
|
|
193
|
+
else if (discr === 0) {
|
|
194
|
+
const nodeX = tryToSimplify(frac(opposite(nodeB), multiply(2, nodeA)), {});
|
|
195
|
+
return [nodeX];
|
|
196
|
+
}
|
|
197
|
+
else {
|
|
198
|
+
return [];
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
else if (degree === 1) {
|
|
202
|
+
const [nodeB, nodeA] = arrNodeCoeff;
|
|
203
|
+
const nodeX = tryToSimplify(frac(opposite(nodeB), nodeA), {});
|
|
204
|
+
return [nodeX];
|
|
205
|
+
}
|
|
206
|
+
else {
|
|
207
|
+
return [];
|
|
208
|
+
}
|
|
209
|
+
})();
|
|
210
|
+
const arrNodeXSortedAsc = arrNodeX.toSorted((nodeX1, nodeX2) => nodeX1.evaluate() - nodeX2.evaluate());
|
|
211
|
+
return {
|
|
212
|
+
nodePolynomial,
|
|
213
|
+
arrNodeX: arrNodeXSortedAsc,
|
|
214
|
+
};
|
|
215
|
+
};
|
|
216
|
+
export function createIntegratedPolynomialNode(nodePolynomial, nodeC) {
|
|
217
|
+
const arrNodeCoeff = getArrNodeCoeffOfPolynomialNode(nodePolynomial);
|
|
218
|
+
const nodeVarX = "x".toTree();
|
|
219
|
+
return arrNodeCoeff.reduce((acc, nodeCoeff, i) => {
|
|
220
|
+
const nodeTerm = frac(multiply(nodeCoeff, power(nodeVarX, i + 1)), i + 1);
|
|
221
|
+
return add(nodeTerm, acc).simplify();
|
|
222
|
+
}, nodeC);
|
|
223
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"seqArithmeticSituations.d.ts","sourceRoot":"","sources":["../../../../../src/math/utils/sequences/situations/seqArithmeticSituations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAC;AAiBlE,MAAM,MAAM,4BAA4B,GAAG;IACzC,cAAc,CAAC,EAAE,CACf,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,MAAM,EACjB,G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EACd,SAAS,EAAE,MAAM,EACjB,GAAG,SAAS,EAAE,OAAO,EAAE,KACpB,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAC9B,CAAC;AAEF,MAAM,MAAM,kCAAkC,GAAG;IAC/C,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,EAAE,CAAC;CAClB,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG;IAChC,WAAW,EAAE,MAAM,MAAM,CAAC;IAC1B,UAAU,EAAE,MAAM,MAAM,CAAC;IACzB,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;IAC9D,aAAa,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,KAAK,MAAM,CAAC;IAC9E,WAAW,EAAE,WAAW,CAAC;IAEzB,eAAe,EAAE,CACf,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,MAAM,EACjB,eAAe,CAAC,EAAE,kCAAkC,KACjD,MAAM,CAAC;IAEZ,4BAA4B,EAAE,4BAA4B,CAAC;IAC3D,8BAA8B,EAAE,4BAA4B,CAAC;IAE7D,uBAAuB,EAAE,4BAA4B,CAAC;IAEtD,iBAAiB,EAAE,4CAA4C,CAAC;IAChE,sBAAsB,EAAE,4CAA4C,CAAC;CACtE,CAAC;
|
|
1
|
+
{"version":3,"file":"seqArithmeticSituations.d.ts","sourceRoot":"","sources":["../../../../../src/math/utils/sequences/situations/seqArithmeticSituations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAC;AAiBlE,MAAM,MAAM,4BAA4B,GAAG;IACzC,cAAc,CAAC,EAAE,CACf,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,MAAM,EACjB,GAAG,SAAS,EAAE,OAAO,EAAE,KACpB,MAAM,CAAC;IAEZ,aAAa,EAAE,CACb,OAAO,EAAE,M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AAE,OAAO,CAAC,CAAC;CAC9B,CAAC;AAEF,MAAM,MAAM,kCAAkC,GAAG;IAC/C,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,EAAE,CAAC;CAClB,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG;IAChC,WAAW,EAAE,MAAM,MAAM,CAAC;IAC1B,UAAU,EAAE,MAAM,MAAM,CAAC;IACzB,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;IAC9D,aAAa,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,KAAK,MAAM,CAAC;IAC9E,WAAW,EAAE,WAAW,CAAC;IAEzB,eAAe,EAAE,CACf,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,MAAM,EACjB,eAAe,CAAC,EAAE,kCAAkC,KACjD,MAAM,CAAC;IAEZ,4BAA4B,EAAE,4BAA4B,CAAC;IAC3D,8BAA8B,EAAE,4BAA4B,CAAC;IAE7D,uBAAuB,EAAE,4BAA4B,CAAC;IAEtD,iBAAiB,EAAE,4CAA4C,CAAC;IAChE,sBAAsB,EAAE,4CAA4C,CAAC;CACtE,CAAC;AA0jHF,eAAO,MAAM,oBAAoB;;sCAviHd,MAAM,UACP,MAAM,aACH,MAAM,gBACH,OAAO,EAAE;;;;;sCA2Bd,MAAM,UACP,MAAM,aACH,MAAM,gBACH,OAAO,EAAE;;;;;;;sCAiChB,MAAM,UACP,MAAM,aACH,MAAM,gBACH,OAAO,EAAE;;;;;sCAsCd,MAAM,UACP,MAAM,aACH,MAAM,gBACH,OAAO,EAAE;;;;;sCAoDd,MAAM,UACP,MAAM,aACH,MAAM,gBACH,OAAO,EAAE;;;;IAo4G9B,CAAC"}
|
|
@@ -193,7 +193,7 @@ const templatesSituationsArithmetic = [
|
|
|
193
193
|
},
|
|
194
194
|
getStrSituation: (initial, reason, firstRank, superfluousData) => {
|
|
195
195
|
if (superfluousData === undefined) {
|
|
196
|
-
return `On suppose qu'une plante, d'une hauteur initiale (jour $${firstRank.
|
|
196
|
+
return `On suppose qu'une plante, d'une hauteur initiale (jour $${firstRank.frenchify()}$) de $${initial.frPretty(2)}\\ \\textrm{cm}$,
|
|
197
197
|
croît chaque jour de $${reason.frPretty(2)}\\ \\textrm{cm}$.
|
|
198
198
|
On note $u_n$ la hauteur de la plante relevée le jour $n$, en $\\textrm{cm}$.`;
|
|
199
199
|
}
|
|
@@ -202,7 +202,7 @@ On note $u_n$ la hauteur de la plante relevée le jour $n$, en $\\textrm{cm}$.`;
|
|
|
202
202
|
case 0:
|
|
203
203
|
{
|
|
204
204
|
const [wateringPeriodInDays] = superfluousData.values;
|
|
205
|
-
return `On suppose qu'une plante, d'une hauteur initiale (jour $${firstRank.
|
|
205
|
+
return `On suppose qu'une plante, d'une hauteur initiale (jour $${firstRank.frenchify()}$) de $${initial.frPretty(2)}\\ \\textrm{cm}$ et
|
|
206
206
|
arrosée en moyenne tous les $${wateringPeriodInDays.frPretty(2)}$ jours,
|
|
207
207
|
croît chaque jour de $${reason.frPretty(2)}\\ \\textrm{cm}$.
|
|
208
208
|
On note $u_n$ la hauteur de la plante relevée le jour $n$, en $\\textrm{cm}$.`;
|
|
@@ -212,7 +212,7 @@ On note $u_n$ la hauteur de la plante relevée le jour $n$, en $\\textrm{cm}$.`;
|
|
|
212
212
|
{
|
|
213
213
|
const [potDiameterInCm] = superfluousData.values;
|
|
214
214
|
return `On suppose qu'on a mis une plante dans un pot de diamètre $${potDiameterInCm.frPretty(2)} \\ \\textrm{cm}$.
|
|
215
|
-
La plante a alors une hauteur initiale (jour $${firstRank.
|
|
215
|
+
La plante a alors une hauteur initiale (jour $${firstRank.frenchify()}$) de $${initial.frPretty(2)}\\ \\textrm{cm}$.
|
|
216
216
|
La plante croît chaque jour de $${reason.frPretty(2)}\\ \\textrm{cm}$.
|
|
217
217
|
On note $u_n$ la hauteur de la plante relevée le jour $n$, en $\\textrm{cm}$.`;
|
|
218
218
|
}
|
|
@@ -1189,7 +1189,7 @@ Par exemple, le montant de ses économies après $${target2.frPretty(2)}$ semain
|
|
|
1189
1189
|
const target = rankAsked - firstRank;
|
|
1190
1190
|
return `Quelle est la nature de la suite $u_n$ ?
|
|
1191
1191
|
|
|
1192
|
-
Utilise le terme général de $u_n$ pour déterminer le montant des économies de Manon $${target.
|
|
1192
|
+
Utilise le terme général de $u_n$ pour déterminer le montant des économies de Manon $${target.frenchify()}$ semaines après le début de septembre.`;
|
|
1193
1193
|
},
|
|
1194
1194
|
getCorrectionStuff: (initial, reason, _firstRank, ..._otherArgs) => {
|
|
1195
1195
|
const target1 = 10;
|
|
@@ -1680,8 +1680,8 @@ Le niveau de charge est donc une suite arithmétique de premier terme $${initial
|
|
|
1680
1680
|
},
|
|
1681
1681
|
getStrSituation: (initial, reason, firstRank, superfluousData) => {
|
|
1682
1682
|
if (superfluousData === undefined) {
|
|
1683
|
-
return `Un gigantesque buffet est organisé. Au départ, sur les tables de service, il y a $${initial.
|
|
1684
|
-
$${(-reason).
|
|
1683
|
+
return `Un gigantesque buffet est organisé. Au départ, sur les tables de service, il y a $${initial.frenchify()}$ amuse-bouches.
|
|
1684
|
+
$${(-reason).frenchify()}$ amuse-bouches sont mangés toutes les minutes.
|
|
1685
1685
|
On note $u_n$ le nombre d'amuse-bouches restant après $${getStrFactor(firstRank)} \\ \\textrm{min}$.`;
|
|
1686
1686
|
}
|
|
1687
1687
|
else {
|
|
@@ -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,YAAY,CAAC;AAChF,OAAO,EACL,uBAAuB,EACvB,WAAW,EAEZ,MAAM,mBAAmB,CAAC;AAgB3B,OAAO,EAAE,aAAa,EAAE,eAAe,E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AC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC;IAQxD,UAAU,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,GAAG,aAAa;CAMxD"}
|
|
@@ -249,7 +249,7 @@ export class MultiplyNode {
|
|
|
249
249
|
// return multiply(this.leftChild.toMathjs(), this.rightChild.toMathjs());
|
|
250
250
|
// }
|
|
251
251
|
evaluate(vars) {
|
|
252
|
-
return this.leftChild.evaluate(vars) * this.rightChild.evaluate(vars);
|
|
252
|
+
return round(this.leftChild.evaluate(vars) * this.rightChild.evaluate(vars), 12);
|
|
253
253
|
}
|
|
254
254
|
copy() {
|
|
255
255
|
return new MultiplyNode(this.leftChild, this.rightChild, this.opts);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"substractNode.d.ts","sourceRoot":"","sources":["../../../../src/tree/nodes/operators/substractNode.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAChF,OAAO,EAAE,WAAW,EAAE,YAAY,EAAkB,MAAM,mBAAmB,CAAC;AAE9E,OAAO,EAAO,OAAO,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"substractNode.d.ts","sourceRoot":"","sources":["../../../../src/tree/nodes/operators/substractNode.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAChF,OAAO,EAAE,WAAW,EAAE,YAAY,EAAkB,MAAM,mBAAmB,CAAC;AAE9E,OAAO,EAAO,OAAO,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAIrE,wBAAgB,eAAe,CAAC,CAAC,EAAE,IAAI,GAAG,CAAC,IAAI,aAAa,CAE3D;AAED,eAAO,MAAM,SAAS,GACpB,GAAG,aAAa,GAAG,MAAM,GAAG,MAAM,EAClC,GAAG,aAAa,GAAG,MAAM,GAAG,MAAM,kBAOnC,CAAC;AAEF,qBAAa,aAAc,YAAW,YAAY;IAChD,EAAE,EAAE,WAAW,CAAC;IAChB,SAAS,EAAE,aAAa,CAAC;IACzB,UAAU,EAAE,aAAa,CAAC;IAC1B,IAAI,EAAE,QAAQ,CAAC;IACf,SAAS,EAAE,OAAO,CAAC;IACnB,IAAI,CAAC,EAAE,WAAW,CAAC;gBAEjB,SAAS,EAAE,aAAa,EACxB,UAAU,EAAE,aAAa,EACzB,IAAI,CAAC,EAAE,WAAW;IASpB,YAAY,IAAI,MAAM;IAGtB,aAAa;;;;;;;;;IAOb,mBAAmB;IAOnB,iBAAiB,IAAI,aAAa,EAAE;IAapC,cAAc,IAAI,MAAM,EAAE;IAG1B,kBAAkB;IAIlB,KAAK,CAAC,OAAO,CAAC,EAAE,YAAY,GAAG,MAAM;IAoBrC,mBAAmB,CAAC,IAAI,CAAC,EAAE,eAAe;IAK1C,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;IAStC,QAAQ,CAAC,IAAI,CAAC,EAAE,eAAe;IAM/B,MAAM,CAAC,IAAI,EAAE,aAAa,GAAG,OAAO;IAOpC,oBAAoB,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC;IAMxD,UAAU,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,GAAG,aAAa;IAMvD,OAAO,uBAGL;CACH"}
|
|
@@ -5,6 +5,7 @@ import { opposite, OppositeNode } from "../functions/oppositeNode.js";
|
|
|
5
5
|
import { add, AddNode } from "./addNode.js";
|
|
6
6
|
import { coinFlip } from "../../../utils/alea/coinFlip.js";
|
|
7
7
|
import { colorize } from "../../../utils/latex/colorize.js";
|
|
8
|
+
import { round } from "../../../math/utils/round.js";
|
|
8
9
|
export function isSubstractNode(a) {
|
|
9
10
|
return isOperatorNode(a) && a.id === OperatorIds.substract;
|
|
10
11
|
}
|
|
@@ -86,7 +87,7 @@ export class SubstractNode {
|
|
|
86
87
|
return this.toTex();
|
|
87
88
|
}
|
|
88
89
|
evaluate(vars) {
|
|
89
|
-
return this.leftChild.evaluate(vars) - this.rightChild.evaluate(vars);
|
|
90
|
+
return round(this.leftChild.evaluate(vars) - this.rightChild.evaluate(vars), 12);
|
|
90
91
|
}
|
|
91
92
|
// toMathjs() {
|
|
92
93
|
// return subtract(this.leftChild.toMathjs(), this.rightChild.toMathjs());
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { AlgebraicNode } from "../nodes/algebraicNode.js";
|
|
2
|
+
export declare abstract class NodeUtils {
|
|
3
|
+
static getDepth: <T extends AlgebraicNode>(algebraicNode: T) => number;
|
|
4
|
+
static getChildren(algebraicNode: AlgebraicNode): AlgebraicNode[];
|
|
5
|
+
}
|
|
6
|
+
//# sourceMappingURL=nodeUtils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nodeUtils.d.ts","sourceRoot":"","sources":["../../../src/tree/utilities/nodeUtils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAI1D,8BAAsB,SAAS;IAC7B,MAAM,CAAC,QAAQ,GAAI,CAAC,SAAS,aAAa,EAAE,eAAe,CAAC,KAAG,MAAM,CASnE;IAEF,MAAM,CAAC,WAAW,CAAC,aAAa,EAAE,aAAa;CAShD"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { isFunctionNode } from "../nodes/functions/functionNode.js";
|
|
2
|
+
import { isOperatorNode } from "../nodes/operators/operatorNode.js";
|
|
3
|
+
export class NodeUtils {
|
|
4
|
+
static getDepth = (algebraicNode) => {
|
|
5
|
+
const children = this.getChildren(algebraicNode);
|
|
6
|
+
if (children.length === 0) {
|
|
7
|
+
return 0;
|
|
8
|
+
}
|
|
9
|
+
else {
|
|
10
|
+
return (1 + Math.max(...children.map((nodeChild) => this.getDepth(nodeChild))));
|
|
11
|
+
}
|
|
12
|
+
};
|
|
13
|
+
static getChildren(algebraicNode) {
|
|
14
|
+
if (isOperatorNode(algebraicNode)) {
|
|
15
|
+
return [algebraicNode.leftChild, algebraicNode.rightChild];
|
|
16
|
+
}
|
|
17
|
+
else if (isFunctionNode(algebraicNode)) {
|
|
18
|
+
return [algebraicNode.child];
|
|
19
|
+
}
|
|
20
|
+
else {
|
|
21
|
+
return [];
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prependArticle.d.ts","sourceRoot":"","sources":["../../../src/utils/strings/prependArticle.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|