math-exercises 3.0.177 → 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/readExtremaAbscissFromDerivativeCurve.js +1 -1
- 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/index.d.ts +1 -0
- package/lib/exercises/math/functions/trinoms/sign/index.d.ts.map +1 -1
- package/lib/exercises/math/functions/trinoms/sign/index.js +1 -0
- package/lib/exercises/math/functions/trinoms/sign/signOfProductOfAffineAndTrinom.d.ts +8 -0
- package/lib/exercises/math/functions/trinoms/sign/signOfProductOfAffineAndTrinom.d.ts.map +1 -0
- package/lib/exercises/math/functions/trinoms/sign/signOfProductOfAffineAndTrinom.js +226 -0
- package/lib/exercises/math/geometry/angles/parallelogramFourthAngle.d.ts.map +1 -1
- package/lib/exercises/math/geometry/angles/parallelogramFourthAngle.js +10 -10
- package/lib/exercises/math/geometry/quadrilaterals/parallelogramAngles.js +8 -8
- package/lib/exercises/math/geometry/triangles/similar/isSimilarTrianglesWithAngles.js +6 -6
- package/lib/exercises/math/geometry/triangles/triangleThirdAngleValue.js +8 -8
- package/lib/exercises/math/geometry/vectors/scalarProduct/alKashi/scalarProductAlKashiAngle.js +1 -1
- package/lib/exercises/math/geometry/vectors/scalarProduct/alKashi/scalarProductAlKashiSideLength.js +2 -2
- package/lib/exercises/math/geometry/vectors/scalarProduct/angleFromScalarProduct.js +2 -2
- 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/index.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/randomVariable/index.js +1 -0
- 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/python/index.d.ts +1 -0
- package/lib/exercises/math/python/index.d.ts.map +1 -1
- package/lib/exercises/math/python/index.js +1 -0
- package/lib/exercises/math/python/sequences/pySequenceThresholdInstructionCompletion.d.ts.map +1 -1
- package/lib/exercises/math/python/sequences/pySequenceThresholdInstructionCompletion.js +11 -8
- package/lib/exercises/math/sequences/arithmetic/arithmeticFindExplicitFormulaFromTwoTerms.d.ts.map +1 -1
- package/lib/exercises/math/sequences/arithmetic/arithmeticFindExplicitFormulaFromTwoTerms.js +4 -3
- package/lib/exercises/math/sequences/arithmetic/index.d.ts +4 -3
- package/lib/exercises/math/sequences/arithmetic/index.d.ts.map +1 -1
- package/lib/exercises/math/sequences/arithmetic/index.js +4 -3
- package/lib/exercises/math/sequences/arithmetic/situations/arithmeticFindExplicitFormulaFromSituation.d.ts.map +1 -1
- package/lib/exercises/math/sequences/arithmetic/situations/arithmeticFindExplicitFormulaFromSituation.js +3 -2
- package/lib/exercises/math/sequences/arithmetic/situations/arithmeticFindRankFromSituation.d.ts.map +1 -1
- package/lib/exercises/math/sequences/arithmetic/situations/arithmeticFindRankFromSituation.js +8 -6
- package/lib/exercises/math/sequences/arithmetic/situations/arithmeticFindThresholdFromSituation.d.ts.map +1 -1
- package/lib/exercises/math/sequences/arithmetic/situations/arithmeticFindThresholdFromSituation.js +6 -5
- package/lib/exercises/math/sequences/arithmetic/situations/index.d.ts +0 -2
- package/lib/exercises/math/sequences/arithmetic/situations/index.d.ts.map +1 -1
- package/lib/exercises/math/sequences/arithmetic/situations/index.js +2 -2
- package/lib/exercises/math/sequences/arithmetic/sum/arithmeticComputeSumWithDots.d.ts +1 -0
- package/lib/exercises/math/sequences/arithmetic/sum/arithmeticComputeSumWithDots.d.ts.map +1 -1
- package/lib/exercises/math/sequences/arithmetic/sum/arithmeticComputeSumWithDots.js +65 -14
- package/lib/exercises/math/sequences/arithmetic/sum/index.d.ts +0 -1
- package/lib/exercises/math/sequences/arithmetic/sum/index.d.ts.map +1 -1
- package/lib/exercises/math/sequences/arithmetic/sum/index.js +1 -1
- 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/geometricFindExplicitFormulaFromTwoConsecutiveTerms.d.ts +14 -0
- package/lib/exercises/math/sequences/geometric/geometricFindExplicitFormulaFromTwoConsecutiveTerms.d.ts.map +1 -0
- package/lib/exercises/math/sequences/geometric/geometricFindExplicitFormulaFromTwoConsecutiveTerms.js +291 -0
- package/lib/exercises/math/sequences/geometric/geometricFindExplicitFormulaFromTwoTerms.d.ts.map +1 -1
- package/lib/exercises/math/sequences/geometric/geometricFindExplicitFormulaFromTwoTerms.js +4 -3
- package/lib/exercises/math/sequences/geometric/geometricFindRandomTermFromTwoConsecutiveTerms.d.ts +15 -0
- package/lib/exercises/math/sequences/geometric/geometricFindRandomTermFromTwoConsecutiveTerms.d.ts.map +1 -0
- package/lib/exercises/math/sequences/geometric/geometricFindRandomTermFromTwoConsecutiveTerms.js +249 -0
- package/lib/exercises/math/sequences/geometric/geometricFindRandomTermFromTwoTerms.js +2 -2
- package/lib/exercises/math/sequences/geometric/index.d.ts +3 -2
- package/lib/exercises/math/sequences/geometric/index.d.ts.map +1 -1
- package/lib/exercises/math/sequences/geometric/index.js +6 -2
- package/lib/exercises/math/sequences/geometric/situations/geometricFindExplicitFormulaFromSituation.d.ts.map +1 -1
- package/lib/exercises/math/sequences/geometric/situations/geometricFindExplicitFormulaFromSituation.js +3 -2
- package/lib/exercises/math/sequences/geometric/situations/geometricFindTermFromSituation.js +1 -1
- 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/geometric/sum/geometricComputeSumWithDots.js +2 -2
- package/lib/exercises/math/sequences/graph/placeFirstSequencePoints.js +2 -2
- package/lib/exercises/math/sequences/index.d.ts +1 -0
- package/lib/exercises/math/sequences/index.d.ts.map +1 -1
- package/lib/exercises/math/sequences/index.js +1 -0
- 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/sequences/seqArithmGeom/seqArithmGeomRecurrenceFormulaUsage.d.ts.map +1 -1
- package/lib/exercises/math/sequences/seqArithmGeom/seqArithmGeomRecurrenceFormulaUsage.js +5 -9
- package/lib/exercises/math/spaceGeometry/sphere/sphereLatLonReading.2d.js +1 -1
- 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/math/trigonometry/triangle/trigonometryAngleCalcul.js +2 -2
- package/lib/exercises/pc/snellDescartes.js +2 -2
- 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 +152 -41
- package/lib/index.d.ts.map +1 -1
- package/lib/latexTester.d.ts.map +1 -1
- package/lib/latexTester.js +9 -6
- package/lib/math/polynomials/affine.d.ts +1 -0
- package/lib/math/polynomials/affine.d.ts.map +1 -1
- package/lib/math/polynomials/affine.js +5 -0
- package/lib/math/utils/arithmetic/primeFactors.js +1 -1
- package/lib/math/utils/functions/functionComposition.d.ts.map +1 -1
- package/lib/math/utils/functions/functionComposition.js +18 -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 +18 -4
- package/lib/math/utils/sequences/situations/seqArithmeticSituations.d.ts.map +1 -1
- package/lib/math/utils/sequences/situations/seqArithmeticSituations.js +434 -333
- package/lib/math/utils/sequences/situations/seqArithmeticUtils.d.ts.map +1 -1
- package/lib/math/utils/sequences/situations/seqArithmeticUtils.js +3 -1
- package/lib/math/utils/sequences/situations/seqGeometricSituations.d.ts +5 -0
- package/lib/math/utils/sequences/situations/seqGeometricSituations.d.ts.map +1 -1
- package/lib/math/utils/sequences/situations/seqGeometricSituations.js +58 -25
- package/lib/prototypesEnhancement.d.ts +1 -0
- package/lib/prototypesEnhancement.d.ts.map +1 -1
- package/lib/prototypesEnhancement.js +3 -0
- package/lib/tests/pdfs/mdCodeToLatex.d.ts.map +1 -1
- package/lib/tests/pdfs/mdCodeToLatex.js +8 -15
- package/lib/tests/questionTest.d.ts.map +1 -1
- package/lib/tests/questionTest.js +6 -3
- package/lib/tree/nodes/geometry/degree.js +1 -1
- 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/parsers/degreeParser.js +2 -2
- 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
|
@@ -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
|
+
}
|
|
@@ -5,6 +5,19 @@ export type SituationArithmeticVariation = {
|
|
|
5
5
|
getHint: (firstRank: number, ...otherArgs: unknown[]) => string;
|
|
6
6
|
getCorrectionStuff: (initial: number, reason: number, firstRank: number, ...otherArgs: unknown[]) => Record<string, unknown>;
|
|
7
7
|
};
|
|
8
|
+
export type RankDecoder = {
|
|
9
|
+
rankFromTarget: (nodeTarget: AlgebraicNode, firstRank: number) => number;
|
|
10
|
+
targetFromRank: (rank: number, firstRank: number) => AlgebraicNode;
|
|
11
|
+
};
|
|
12
|
+
export type SituationArithmeticVariationUsingRankDecoder = {
|
|
13
|
+
getStrQuestion?: (initial: number, reason: number, firstRank: number, ...otherArgs: unknown[]) => string;
|
|
14
|
+
getAnswerStuff: (initial: number, reason: number, firstRank: number, ...otherArgs: unknown[]) => {
|
|
15
|
+
answerNode: AlgebraicNode;
|
|
16
|
+
rankNode: AlgebraicNode;
|
|
17
|
+
};
|
|
18
|
+
getHint: (firstRank: number, ...otherArgs: unknown[]) => string;
|
|
19
|
+
getCorrectionStuff: (initial: number, reason: number, firstRank: number, ...otherArgs: unknown[]) => Record<string, unknown>;
|
|
20
|
+
};
|
|
8
21
|
export type SituationArithmeticSuperfluousData = {
|
|
9
22
|
rand: number;
|
|
10
23
|
values: number[];
|
|
@@ -14,12 +27,13 @@ export type SituationArithmetic = {
|
|
|
14
27
|
randReason: () => number;
|
|
15
28
|
randSuperfluousData: () => SituationArithmeticSuperfluousData;
|
|
16
29
|
randThreshold: (initial: number, reason: number, firstRank: number) => number;
|
|
30
|
+
rankDecoder: RankDecoder;
|
|
17
31
|
getStrSituation: (initial: number, reason: number, firstRank: number, superfluousData?: SituationArithmeticSuperfluousData) => string;
|
|
18
32
|
variationFindExplicitFormula: SituationArithmeticVariation;
|
|
19
33
|
variationFindRecurrenceFormula: SituationArithmeticVariation;
|
|
20
34
|
variationFindRandomTerm: SituationArithmeticVariation;
|
|
21
|
-
variationFindRank:
|
|
22
|
-
variationFindThreshold:
|
|
35
|
+
variationFindRank: SituationArithmeticVariationUsingRankDecoder;
|
|
36
|
+
variationFindThreshold: SituationArithmeticVariationUsingRankDecoder;
|
|
23
37
|
};
|
|
24
38
|
export declare const situationsArithmetic: (SituationArithmetic & {
|
|
25
39
|
variationFindExplicitFormula: SituationArithmeticVariation & {
|
|
@@ -39,12 +53,12 @@ export declare const situationsArithmetic: (SituationArithmetic & {
|
|
|
39
53
|
str: string;
|
|
40
54
|
};
|
|
41
55
|
};
|
|
42
|
-
variationFindRank:
|
|
56
|
+
variationFindRank: SituationArithmeticVariationUsingRankDecoder & {
|
|
43
57
|
getCorrectionStuff: (initial: number, reason: number, firstRank: number, ...otherArgs: unknown[]) => {
|
|
44
58
|
str: string;
|
|
45
59
|
};
|
|
46
60
|
};
|
|
47
|
-
variationFindThreshold:
|
|
61
|
+
variationFindThreshold: SituationArithmeticVariationUsingRankDecoder & {
|
|
48
62
|
getCorrectionStuff: (initial: number, reason: number, firstRank: number, ...otherArgs: unknown[]) => {
|
|
49
63
|
str: string;
|
|
50
64
|
};
|
|
@@ -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,GAAG,SAAS,EAAE,OAAO,EAAE,KACpB,MAAM,CAAC;IAEZ,aAAa,EAAE,CACb,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,MAAM,EACjB,GAAG,SAAS,EAAE,OAAO,EAAE,KACpB,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"seqArithmeticSituations.d.ts","sourceRoot":"","sources":["../../../../../src/math/utils/sequences/situations/seqArithmeticSituations.ts"],"names":[],"mappings":"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"}
|