math-exercises 1.3.41 → 1.3.43
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/calcul/addAndSub.d.ts.map +1 -1
- package/lib/exercises/calcul/addAndSub.js +3 -0
- package/lib/exercises/calcul/addAndSubWithoutRelatives.d.ts.map +1 -1
- package/lib/exercises/calcul/addAndSubWithoutRelatives.js +3 -0
- package/lib/exercises/calcul/arithmetics/euclideanDivision.d.ts +4 -0
- package/lib/exercises/calcul/arithmetics/euclideanDivision.d.ts.map +1 -0
- package/lib/exercises/calcul/arithmetics/euclideanDivision.js +70 -0
- package/lib/exercises/calcul/arithmetics/primeNumbers.d.ts.map +1 -1
- package/lib/exercises/calcul/arithmetics/primeNumbers.js +4 -1
- package/lib/exercises/calcul/fractions/fractionAndIntegerDivision.d.ts.map +1 -1
- package/lib/exercises/calcul/fractions/fractionAndIntegerDivision.js +3 -0
- package/lib/exercises/calcul/fractions/fractionAndIntegerProduct.d.ts.map +1 -1
- package/lib/exercises/calcul/fractions/fractionAndIntegerProduct.js +3 -0
- package/lib/exercises/calcul/fractions/fractionAndIntegerSum.d.ts.map +1 -1
- package/lib/exercises/calcul/fractions/fractionAndIntegerSum.js +3 -0
- package/lib/exercises/calcul/fractions/fractionToPercentToDecimal.d.ts.map +1 -1
- package/lib/exercises/calcul/fractions/fractionToPercentToDecimal.js +3 -0
- package/lib/exercises/calcul/fractions/fractionsDivision.d.ts.map +1 -1
- package/lib/exercises/calcul/fractions/fractionsDivision.js +3 -0
- package/lib/exercises/calcul/fractions/fractionsProduct.d.ts.map +1 -1
- package/lib/exercises/calcul/fractions/fractionsProduct.js +3 -0
- package/lib/exercises/calcul/fractions/fractionsSum.d.ts.map +1 -1
- package/lib/exercises/calcul/fractions/fractionsSum.js +3 -0
- package/lib/exercises/calcul/fractions/simplifyFraction.d.ts.map +1 -1
- package/lib/exercises/calcul/fractions/simplifyFraction.js +3 -0
- package/lib/exercises/calcul/mentalCaluls.ts/mentalAddAndSub.d.ts.map +1 -1
- package/lib/exercises/calcul/mentalCaluls.ts/mentalAddAndSub.js +3 -0
- package/lib/exercises/calcul/mentalCaluls.ts/mentalDivisions.d.ts.map +1 -1
- package/lib/exercises/calcul/mentalCaluls.ts/mentalDivisions.js +3 -0
- package/lib/exercises/calcul/mentalCaluls.ts/mentalMultiplications.d.ts.map +1 -1
- package/lib/exercises/calcul/mentalCaluls.ts/mentalMultiplications.js +3 -0
- package/lib/exercises/calcul/mentalCaluls.ts/mentalPercentage.d.ts.map +1 -1
- package/lib/exercises/calcul/mentalCaluls.ts/mentalPercentage.js +3 -0
- package/lib/exercises/calcul/operations/operationsPriorities.d.ts.map +1 -1
- package/lib/exercises/calcul/operations/operationsPriorities.js +3 -0
- package/lib/exercises/calcul/operations/operationsPrioritiesWithoutRelative.d.ts.map +1 -1
- package/lib/exercises/calcul/operations/operationsPrioritiesWithoutRelative.js +3 -0
- package/lib/exercises/calcul/proportionality/proportionalityTable.d.ts.map +1 -1
- package/lib/exercises/calcul/proportionality/proportionalityTable.js +3 -0
- package/lib/exercises/calcul/rounding/rounding.d.ts.map +1 -1
- package/lib/exercises/calcul/rounding/rounding.js +6 -0
- package/lib/exercises/calculLitteral/distributivity/doubleDistributivity.d.ts.map +1 -1
- package/lib/exercises/calculLitteral/distributivity/doubleDistributivity.js +5 -0
- package/lib/exercises/calculLitteral/distributivity/firstIdentity.d.ts.map +1 -1
- package/lib/exercises/calculLitteral/distributivity/firstIdentity.js +6 -0
- package/lib/exercises/calculLitteral/distributivity/secondIdentity.d.ts.map +1 -1
- package/lib/exercises/calculLitteral/distributivity/secondIdentity.js +6 -0
- package/lib/exercises/calculLitteral/distributivity/simpleDistributivity.d.ts.map +1 -1
- package/lib/exercises/calculLitteral/distributivity/simpleDistributivity.js +6 -0
- package/lib/exercises/calculLitteral/distributivity/thirdIdentity.d.ts.map +1 -1
- package/lib/exercises/calculLitteral/distributivity/thirdIdentity.js +6 -0
- package/lib/exercises/calculLitteral/equation/equationSimpleSquare.d.ts.map +1 -1
- package/lib/exercises/calculLitteral/equation/equationSimpleSquare.js +12 -0
- package/lib/exercises/calculLitteral/equation/equationType1Exercise.d.ts.map +1 -1
- package/lib/exercises/calculLitteral/equation/equationType1Exercise.js +3 -0
- package/lib/exercises/calculLitteral/equation/equationType2Exercise.d.ts.map +1 -1
- package/lib/exercises/calculLitteral/equation/equationType2Exercise.js +3 -0
- package/lib/exercises/calculLitteral/equation/equationType3Exercise.d.ts.map +1 -1
- package/lib/exercises/calculLitteral/equation/equationType3Exercise.js +3 -0
- package/lib/exercises/calculLitteral/equation/equationType4Exercise.d.ts.map +1 -1
- package/lib/exercises/calculLitteral/equation/equationType4Exercise.js +3 -0
- package/lib/exercises/calculLitteral/equation/expEquation.d.ts +4 -0
- package/lib/exercises/calculLitteral/equation/expEquation.d.ts.map +1 -0
- package/lib/exercises/calculLitteral/equation/expEquation.js +67 -0
- package/lib/exercises/calculLitteral/equation/firstDegreeEquation.d.ts.map +1 -1
- package/lib/exercises/calculLitteral/equation/firstDegreeEquation.js +3 -0
- package/lib/exercises/calculLitteral/equation/fractionEquation.d.ts.map +1 -1
- package/lib/exercises/calculLitteral/equation/fractionEquation.js +3 -0
- package/lib/exercises/calculLitteral/equation/logEquation.d.ts +4 -0
- package/lib/exercises/calculLitteral/equation/logEquation.d.ts.map +1 -0
- package/lib/exercises/calculLitteral/equation/logEquation.js +67 -0
- package/lib/exercises/calculLitteral/equation/multiplicationEquation.d.ts.map +1 -1
- package/lib/exercises/calculLitteral/equation/multiplicationEquation.js +3 -0
- package/lib/exercises/calculLitteral/factorisation/factoIdRmq1.d.ts.map +1 -1
- package/lib/exercises/calculLitteral/factorisation/factoIdRmq1.js +4 -0
- package/lib/exercises/calculLitteral/factorisation/factoIdRmq2.d.ts.map +1 -1
- package/lib/exercises/calculLitteral/factorisation/factoIdRmq2.js +5 -0
- package/lib/exercises/calculLitteral/factorisation/factoIdRmq3.d.ts.map +1 -1
- package/lib/exercises/calculLitteral/factorisation/factoIdRmq3.js +6 -0
- package/lib/exercises/calculLitteral/factorisation/factoType1Exercise.d.ts.map +1 -1
- package/lib/exercises/calculLitteral/factorisation/factoType1Exercise.js +6 -0
- package/lib/exercises/calculLitteral/simplifying/evaluateExpression.d.ts.map +1 -1
- package/lib/exercises/calculLitteral/simplifying/evaluateExpression.js +3 -0
- package/lib/exercises/calculLitteral/simplifying/expSimplifiying.d.ts +4 -0
- package/lib/exercises/calculLitteral/simplifying/expSimplifiying.d.ts.map +1 -0
- package/lib/exercises/calculLitteral/simplifying/expSimplifiying.js +96 -0
- package/lib/exercises/calculLitteral/simplifying/logSimplifiying.d.ts +4 -0
- package/lib/exercises/calculLitteral/simplifying/logSimplifiying.d.ts.map +1 -0
- package/lib/exercises/calculLitteral/simplifying/logSimplifiying.js +78 -0
- package/lib/exercises/calculLitteral/simplifying/reduceExpression.d.ts.map +1 -1
- package/lib/exercises/calculLitteral/simplifying/reduceExpression.js +3 -0
- package/lib/exercises/conversion/aeraConversion.d.ts.map +1 -1
- package/lib/exercises/conversion/aeraConversion.js +3 -0
- package/lib/exercises/conversion/capacityConversion.d.ts.map +1 -1
- package/lib/exercises/conversion/capacityConversion.js +3 -0
- package/lib/exercises/conversion/lengthConversion.d.ts.map +1 -1
- package/lib/exercises/conversion/lengthConversion.js +3 -0
- package/lib/exercises/conversion/massConversion.d.ts.map +1 -1
- package/lib/exercises/conversion/massConversion.js +3 -0
- package/lib/exercises/conversion/volumeCapacityConversion.d.ts.map +1 -1
- package/lib/exercises/conversion/volumeCapacityConversion.js +3 -0
- package/lib/exercises/conversion/volumeConversion.d.ts.map +1 -1
- package/lib/exercises/conversion/volumeConversion.js +3 -0
- package/lib/exercises/derivation/derivative/constanteDerivative.d.ts.map +1 -1
- package/lib/exercises/derivation/derivative/constanteDerivative.js +4 -1
- package/lib/exercises/derivation/derivative/expDerivativeOne.d.ts +4 -0
- package/lib/exercises/derivation/derivative/expDerivativeOne.d.ts.map +1 -0
- package/lib/exercises/derivation/derivative/expDerivativeOne.js +65 -0
- package/lib/exercises/derivation/derivative/expDerivativeThree.d.ts +4 -0
- package/lib/exercises/derivation/derivative/expDerivativeThree.d.ts.map +1 -0
- package/lib/exercises/derivation/derivative/expDerivativeThree.js +64 -0
- package/lib/exercises/derivation/derivative/expDerivativeTwo.d.ts +4 -0
- package/lib/exercises/derivation/derivative/expDerivativeTwo.d.ts.map +1 -0
- package/lib/exercises/derivation/derivative/expDerivativeTwo.js +65 -0
- package/lib/exercises/derivation/derivative/firstDegreeDerivative.d.ts.map +1 -1
- package/lib/exercises/derivation/derivative/firstDegreeDerivative.js +3 -0
- package/lib/exercises/derivation/derivative/inverseFunctionDerivative.d.ts.map +1 -1
- package/lib/exercises/derivation/derivative/inverseFunctionDerivative.js +3 -0
- package/lib/exercises/derivation/derivative/lnDerivativeOne.d.ts +4 -0
- package/lib/exercises/derivation/derivative/lnDerivativeOne.d.ts.map +1 -0
- package/lib/exercises/derivation/derivative/lnDerivativeOne.js +63 -0
- package/lib/exercises/derivation/derivative/lnDerivativeThree.d.ts +4 -0
- package/lib/exercises/derivation/derivative/lnDerivativeThree.d.ts.map +1 -0
- package/lib/exercises/derivation/derivative/lnDerivativeThree.js +68 -0
- package/lib/exercises/derivation/derivative/lnDerivativeTwo.d.ts +4 -0
- package/lib/exercises/derivation/derivative/lnDerivativeTwo.d.ts.map +1 -0
- package/lib/exercises/derivation/derivative/lnDerivativeTwo.js +66 -0
- package/lib/exercises/derivation/derivative/powerFunctionDerivative.d.ts.map +1 -1
- package/lib/exercises/derivation/derivative/powerFunctionDerivative.js +3 -0
- package/lib/exercises/derivation/derivative/rootFunctionDerivative.d.ts.map +1 -1
- package/lib/exercises/derivation/derivative/rootFunctionDerivative.js +4 -0
- package/lib/exercises/derivation/derivative/secondDegreeDerivative.d.ts.map +1 -1
- package/lib/exercises/derivation/derivative/secondDegreeDerivative.js +3 -0
- package/lib/exercises/derivation/derivative/thirdDegreeDerivative.d.ts.map +1 -1
- package/lib/exercises/derivation/derivative/thirdDegreeDerivative.js +3 -0
- package/lib/exercises/derivation/derivative/thirdDegreeFunctionVariation.d.ts +4 -0
- package/lib/exercises/derivation/derivative/thirdDegreeFunctionVariation.d.ts.map +1 -0
- package/lib/exercises/derivation/derivative/thirdDegreeFunctionVariation.js +101 -0
- package/lib/exercises/derivation/derivativeNumberReading.d.ts.map +1 -1
- package/lib/exercises/derivation/derivativeNumberReading.js +3 -0
- package/lib/exercises/equaDiff/equaDiffGeneralForme.d.ts +4 -0
- package/lib/exercises/equaDiff/equaDiffGeneralForme.d.ts.map +1 -0
- package/lib/exercises/equaDiff/equaDiffGeneralForme.js +66 -0
- package/lib/exercises/equaDiff/equaDiffGeneralFormeWithIC.d.ts +4 -0
- package/lib/exercises/equaDiff/equaDiffGeneralFormeWithIC.d.ts.map +1 -0
- package/lib/exercises/equaDiff/equaDiffGeneralFormeWithIC.js +80 -0
- package/lib/exercises/exercise.d.ts +2 -0
- package/lib/exercises/exercise.d.ts.map +1 -1
- package/lib/exercises/exercises.d.ts.map +1 -1
- package/lib/exercises/exercises.js +66 -4
- package/lib/exercises/geometry/cartesian/distanceBetweenTwoPoints.d.ts.map +1 -1
- package/lib/exercises/geometry/cartesian/distanceBetweenTwoPoints.js +6 -0
- package/lib/exercises/geometry/cartesian/imageFunction.d.ts +4 -0
- package/lib/exercises/geometry/cartesian/imageFunction.d.ts.map +1 -0
- package/lib/exercises/geometry/cartesian/imageFunction.js +65 -0
- package/lib/exercises/geometry/cartesian/imageFunctionGeogebra.d.ts +4 -0
- package/lib/exercises/geometry/cartesian/imageFunctionGeogebra.d.ts.map +1 -0
- package/lib/exercises/geometry/cartesian/imageFunctionGeogebra.js +89 -0
- package/lib/exercises/geometry/cartesian/inverseImageFunction.d.ts +4 -0
- package/lib/exercises/geometry/cartesian/inverseImageFunction.d.ts.map +1 -0
- package/lib/exercises/geometry/cartesian/inverseImageFunction.js +62 -0
- package/lib/exercises/geometry/cartesian/inverseImageFunctionGeogebra.d.ts +4 -0
- package/lib/exercises/geometry/cartesian/inverseImageFunctionGeogebra.d.ts.map +1 -0
- package/lib/exercises/geometry/cartesian/inverseImageFunctionGeogebra.js +154 -0
- package/lib/exercises/geometry/cartesian/leadingCoefficient.d.ts.map +1 -1
- package/lib/exercises/geometry/cartesian/leadingCoefficient.js +3 -0
- package/lib/exercises/geometry/cartesian/leadingCoefficientCalculV1.d.ts.map +1 -1
- package/lib/exercises/geometry/cartesian/leadingCoefficientCalculV1.js +3 -0
- package/lib/exercises/geometry/cartesian/leadingCoefficientCalculV2.d.ts.map +1 -1
- package/lib/exercises/geometry/cartesian/leadingCoefficientCalculV2.js +3 -0
- package/lib/exercises/geometry/cartesian/midpoint.d.ts.map +1 -1
- package/lib/exercises/geometry/cartesian/midpoint.js +3 -0
- package/lib/exercises/geometry/cartesian/signFunction.d.ts +4 -0
- package/lib/exercises/geometry/cartesian/signFunction.d.ts.map +1 -0
- package/lib/exercises/geometry/cartesian/signFunction.js +84 -0
- package/lib/exercises/geometry/euclidean/circleArea.d.ts.map +1 -1
- package/lib/exercises/geometry/euclidean/circleArea.js +3 -0
- package/lib/exercises/geometry/euclidean/circleCircumference.d.ts.map +1 -1
- package/lib/exercises/geometry/euclidean/circleCircumference.js +3 -0
- package/lib/exercises/geometry/euclidean/pythagore.d.ts.map +1 -1
- package/lib/exercises/geometry/euclidean/pythagore.js +8 -0
- package/lib/exercises/geometry/euclidean/pythagoreCalcul.d.ts.map +1 -1
- package/lib/exercises/geometry/euclidean/pythagoreCalcul.js +3 -0
- package/lib/exercises/geometry/euclidean/rectangleArea.d.ts.map +1 -1
- package/lib/exercises/geometry/euclidean/rectangleArea.js +3 -0
- package/lib/exercises/geometry/euclidean/rectanglePerimeter.d.ts.map +1 -1
- package/lib/exercises/geometry/euclidean/rectanglePerimeter.js +3 -0
- package/lib/exercises/geometry/euclidean/rightTriangleArea.d.ts.map +1 -1
- package/lib/exercises/geometry/euclidean/rightTriangleArea.js +3 -0
- package/lib/exercises/geometry/euclidean/squareArea.d.ts.map +1 -1
- package/lib/exercises/geometry/euclidean/squareArea.js +3 -0
- package/lib/exercises/geometry/euclidean/squarePerimeter.d.ts.map +1 -1
- package/lib/exercises/geometry/euclidean/squarePerimeter.js +3 -0
- package/lib/exercises/geometry/euclidean/thales.d.ts.map +1 -1
- package/lib/exercises/geometry/euclidean/thales.js +3 -0
- package/lib/exercises/geometry/euclidean/thalesCalcul.d.ts.map +1 -1
- package/lib/exercises/geometry/euclidean/thalesCalcul.js +3 -0
- package/lib/exercises/geometry/euclidean/triangleArea.d.ts.map +1 -1
- package/lib/exercises/geometry/euclidean/triangleArea.js +3 -0
- package/lib/exercises/geometry/euclidean/triangleAreaV2.d.ts.map +1 -1
- package/lib/exercises/geometry/euclidean/triangleAreaV2.js +4 -0
- package/lib/exercises/geometry/euclidean/trianglePerimeter.d.ts.map +1 -1
- package/lib/exercises/geometry/euclidean/trianglePerimeter.js +3 -0
- package/lib/exercises/geometry/euclidean/trigonometry.d.ts.map +1 -1
- package/lib/exercises/geometry/euclidean/trigonometry.js +3 -0
- package/lib/exercises/geometry/euclidean/trigonometryAngleCalcul.d.ts.map +1 -1
- package/lib/exercises/geometry/euclidean/trigonometryAngleCalcul.js +3 -0
- package/lib/exercises/geometry/euclidean/trigonometrySideCalcul.d.ts.map +1 -1
- package/lib/exercises/geometry/euclidean/trigonometrySideCalcul.js +3 -0
- package/lib/exercises/geometry/vectors/scalarProductViaCoords.d.ts.map +1 -1
- package/lib/exercises/geometry/vectors/scalarProductViaCoords.js +3 -0
- package/lib/exercises/limits/polynomeLimit.d.ts +4 -0
- package/lib/exercises/limits/polynomeLimit.d.ts.map +1 -0
- package/lib/exercises/limits/polynomeLimit.js +132 -0
- package/lib/exercises/percent/applyPercent.d.ts.map +1 -1
- package/lib/exercises/percent/applyPercent.js +3 -0
- package/lib/exercises/percent/averageEvolutionRate.d.ts.map +1 -1
- package/lib/exercises/percent/averageEvolutionRate.js +3 -0
- package/lib/exercises/percent/globalPercent.d.ts.map +1 -1
- package/lib/exercises/percent/globalPercent.js +3 -0
- package/lib/exercises/percent/reciprocalPercentage.d.ts.map +1 -1
- package/lib/exercises/percent/reciprocalPercentage.js +3 -0
- package/lib/exercises/powers/powersDivision.d.ts.map +1 -1
- package/lib/exercises/powers/powersDivision.js +3 -0
- package/lib/exercises/powers/powersOfTenToDecimal.d.ts.map +1 -1
- package/lib/exercises/powers/powersOfTenToDecimal.js +3 -0
- package/lib/exercises/powers/powersPower.d.ts.map +1 -1
- package/lib/exercises/powers/powersPower.js +3 -0
- package/lib/exercises/powers/powersProduct.d.ts.map +1 -1
- package/lib/exercises/powers/powersProduct.js +3 -0
- package/lib/exercises/powers/scientificToDecimal.d.ts.map +1 -1
- package/lib/exercises/powers/scientificToDecimal.js +3 -0
- package/lib/exercises/primitve/constantPrimitive.d.ts +4 -0
- package/lib/exercises/primitve/constantPrimitive.d.ts.map +1 -0
- package/lib/exercises/primitve/constantPrimitive.js +56 -0
- package/lib/exercises/primitve/exponentialPrimitive.d.ts +4 -0
- package/lib/exercises/primitve/exponentialPrimitive.d.ts.map +1 -0
- package/lib/exercises/primitve/exponentialPrimitive.js +103 -0
- package/lib/exercises/primitve/logarithmePrimitive.d.ts +4 -0
- package/lib/exercises/primitve/logarithmePrimitive.d.ts.map +1 -0
- package/lib/exercises/primitve/logarithmePrimitive.js +74 -0
- package/lib/exercises/primitve/polynomialPrimitive.d.ts +4 -0
- package/lib/exercises/primitve/polynomialPrimitive.d.ts.map +1 -0
- package/lib/exercises/primitve/polynomialPrimitive.js +80 -0
- package/lib/exercises/primitve/sinCosPrimitive.d.ts +4 -0
- package/lib/exercises/primitve/sinCosPrimitive.d.ts.map +1 -0
- package/lib/exercises/primitve/sinCosPrimitive.js +112 -0
- package/lib/exercises/primitve/usualPrimitives.d.ts +4 -0
- package/lib/exercises/primitve/usualPrimitives.d.ts.map +1 -0
- package/lib/exercises/primitve/usualPrimitives.js +39 -0
- package/lib/exercises/probaStat/conditionalProbability.d.ts +4 -0
- package/lib/exercises/probaStat/conditionalProbability.d.ts.map +1 -0
- package/lib/exercises/probaStat/conditionalProbability.js +102 -0
- package/lib/exercises/probaStat/frequencyTable.d.ts +4 -0
- package/lib/exercises/probaStat/frequencyTable.d.ts.map +1 -0
- package/lib/exercises/probaStat/frequencyTable.js +76 -0
- package/lib/exercises/probaStat/marginalAndConditionalFrequency.d.ts +4 -0
- package/lib/exercises/probaStat/marginalAndConditionalFrequency.d.ts.map +1 -0
- package/lib/exercises/probaStat/marginalAndConditionalFrequency.js +109 -0
- package/lib/exercises/probaStat/median.d.ts +4 -0
- package/lib/exercises/probaStat/median.d.ts.map +1 -0
- package/lib/exercises/probaStat/median.js +82 -0
- package/lib/exercises/probaStat/medianList.d.ts +4 -0
- package/lib/exercises/probaStat/medianList.d.ts.map +1 -0
- package/lib/exercises/probaStat/medianList.js +67 -0
- package/lib/exercises/probaStat/probabilityTree.d.ts +4 -0
- package/lib/exercises/probaStat/probabilityTree.d.ts.map +1 -0
- package/lib/exercises/probaStat/probabilityTree.js +135 -0
- package/lib/exercises/probaStat/quartiles.d.ts +4 -0
- package/lib/exercises/probaStat/quartiles.d.ts.map +1 -0
- package/lib/exercises/probaStat/quartiles.js +96 -0
- package/lib/exercises/probaStat/quartilesList.d.ts +4 -0
- package/lib/exercises/probaStat/quartilesList.d.ts.map +1 -0
- package/lib/exercises/probaStat/quartilesList.js +81 -0
- package/lib/exercises/sequences/arithmetic/arithmeticExplicitFormulaUsage.d.ts.map +1 -1
- package/lib/exercises/sequences/arithmetic/arithmeticExplicitFormulaUsage.js +3 -0
- package/lib/exercises/sequences/arithmetic/arithmeticFindExplicitFormula.d.ts.map +1 -1
- package/lib/exercises/sequences/arithmetic/arithmeticFindExplicitFormula.js +3 -0
- package/lib/exercises/sequences/arithmetic/arithmeticFindReason.d.ts.map +1 -1
- package/lib/exercises/sequences/arithmetic/arithmeticFindReason.js +3 -0
- package/lib/exercises/sequences/arithmetic/arithmeticReasonUsage.d.ts.map +1 -1
- package/lib/exercises/sequences/arithmetic/arithmeticReasonUsage.js +3 -0
- package/lib/exercises/sequences/arithmetic/arithmeticRecurrenceFormulaUsage.d.ts.map +1 -1
- package/lib/exercises/sequences/arithmetic/arithmeticRecurrenceFormulaUsage.js +3 -0
- package/lib/exercises/sequences/arithmetic/arithmeticThresholdFind.d.ts.map +1 -1
- package/lib/exercises/sequences/arithmetic/arithmeticThresholdFind.js +3 -0
- package/lib/exercises/sequences/geometric/geometricExplicitFormulaUsage.d.ts.map +1 -1
- package/lib/exercises/sequences/geometric/geometricExplicitFormulaUsage.js +3 -0
- package/lib/exercises/sequences/geometric/geometricFindExplicitFormula.d.ts.map +1 -1
- package/lib/exercises/sequences/geometric/geometricFindExplicitFormula.js +4 -0
- package/lib/exercises/sequences/geometric/geometricFindReason.d.ts.map +1 -1
- package/lib/exercises/sequences/geometric/geometricFindReason.js +4 -0
- package/lib/exercises/sequences/geometric/geometricReasonUsage.d.ts.map +1 -1
- package/lib/exercises/sequences/geometric/geometricReasonUsage.js +4 -0
- package/lib/exercises/sequences/geometric/geometricRecurrenceFormulaUsage.d.ts.map +1 -1
- package/lib/exercises/sequences/geometric/geometricRecurrenceFormulaUsage.js +4 -0
- package/lib/exercises/squareRoots/simpifySquareRoot.d.ts.map +1 -1
- package/lib/exercises/squareRoots/simpifySquareRoot.js +3 -0
- package/lib/index.d.ts +2 -2
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +3 -3
- package/lib/math/polynomials/polynomial.d.ts +3 -1
- package/lib/math/polynomials/polynomial.d.ts.map +1 -1
- package/lib/math/polynomials/polynomial.js +48 -2
- package/lib/tree/nodes/functions/expNode.d.ts +10 -0
- package/lib/tree/nodes/functions/expNode.d.ts.map +1 -0
- package/lib/tree/nodes/functions/expNode.js +21 -0
- package/lib/tree/nodes/functions/functionNode.d.ts +3 -1
- package/lib/tree/nodes/functions/functionNode.d.ts.map +1 -1
- package/lib/tree/nodes/functions/functionNode.js +2 -0
- package/lib/tree/nodes/functions/logNode.d.ts +10 -0
- package/lib/tree/nodes/functions/logNode.d.ts.map +1 -0
- package/lib/tree/nodes/functions/logNode.js +21 -0
- package/lib/tree/nodes/functions/sinNode.d.ts +9 -0
- package/lib/tree/nodes/functions/sinNode.d.ts.map +1 -1
- package/lib/tree/nodes/functions/sinNode.js +20 -0
- package/lib/tree/parsers/simplify.d.ts.map +1 -1
- package/lib/tree/parsers/simplify.js +12 -0
- package/package.json +1 -1
|
@@ -37,6 +37,7 @@ function getArithmeticThresholdFind() {
|
|
|
37
37
|
id: (0, uuid_1.v4)() + '',
|
|
38
38
|
statement: (Math.floor((randValue - firstValue) / reason) + 1).toString(),
|
|
39
39
|
isRightAnswer: true,
|
|
40
|
+
format: 'tex',
|
|
40
41
|
});
|
|
41
42
|
for (let i = 0; i < n - 1; i++) {
|
|
42
43
|
let isDuplicate;
|
|
@@ -46,6 +47,7 @@ function getArithmeticThresholdFind() {
|
|
|
46
47
|
id: (0, uuid_1.v4)() + '',
|
|
47
48
|
statement: (Math.floor((randValue - firstValue) / reason) + (0, randint_1.randint)(-5, 6, [1])).toString(),
|
|
48
49
|
isRightAnswer: false,
|
|
50
|
+
format: 'tex',
|
|
49
51
|
};
|
|
50
52
|
isDuplicate = res.some((p) => p.statement === proposition.statement);
|
|
51
53
|
} while (isDuplicate);
|
|
@@ -59,6 +61,7 @@ function getArithmeticThresholdFind() {
|
|
|
59
61
|
answer: (Math.floor((randValue - firstValue) / reason) + 1).toString(),
|
|
60
62
|
keys: ['r', 'n', 'u', 'underscore', 'inf', 'sup', 'approx'],
|
|
61
63
|
getPropositions,
|
|
64
|
+
answerFormat: 'tex',
|
|
62
65
|
};
|
|
63
66
|
return question;
|
|
64
67
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"geometricExplicitFormulaUsage.d.ts","sourceRoot":"","sources":["../../../../src/exercises/sequences/geometric/geometricExplicitFormulaUsage.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAe,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAW3E,eAAO,MAAM,6BAA6B,EAAE,QAU3C,CAAC;AAEF,wBAAgB,gCAAgC,IAAI,QAAQ,
|
|
1
|
+
{"version":3,"file":"geometricExplicitFormulaUsage.d.ts","sourceRoot":"","sources":["../../../../src/exercises/sequences/geometric/geometricExplicitFormulaUsage.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAe,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAW3E,eAAO,MAAM,6BAA6B,EAAE,QAU3C,CAAC;AAEF,wBAAgB,gCAAgC,IAAI,QAAQ,CAmD3D"}
|
|
@@ -33,6 +33,7 @@ function getGeometricExplicitFormulaUsage() {
|
|
|
33
33
|
id: (0, uuid_1.v4)() + '',
|
|
34
34
|
statement: (firstValue * Math.pow(reason, askedRank)).toString(),
|
|
35
35
|
isRightAnswer: true,
|
|
36
|
+
format: 'tex',
|
|
36
37
|
});
|
|
37
38
|
for (let i = 0; i < n - 1; i++) {
|
|
38
39
|
let isDuplicate;
|
|
@@ -42,6 +43,7 @@ function getGeometricExplicitFormulaUsage() {
|
|
|
42
43
|
id: (0, uuid_1.v4)() + '',
|
|
43
44
|
statement: (firstValue * Math.pow(reason, (0, randint_1.randint)(0, 9, [askedRank]))).toString(),
|
|
44
45
|
isRightAnswer: false,
|
|
46
|
+
format: 'tex',
|
|
45
47
|
};
|
|
46
48
|
isDuplicate = res.some((p) => p.statement === proposition.statement);
|
|
47
49
|
} while (isDuplicate);
|
|
@@ -55,6 +57,7 @@ function getGeometricExplicitFormulaUsage() {
|
|
|
55
57
|
answer: (firstValue * Math.pow(reason, askedRank)).toString(),
|
|
56
58
|
keys: ['n', 'u', 'underscore'],
|
|
57
59
|
getPropositions,
|
|
60
|
+
answerFormat: 'tex',
|
|
58
61
|
};
|
|
59
62
|
return question;
|
|
60
63
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"geometricFindExplicitFormula.d.ts","sourceRoot":"","sources":["../../../../src/exercises/sequences/geometric/geometricFindExplicitFormula.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAe,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAW3E,eAAO,MAAM,4BAA4B,EAAE,QAU1C,CAAC;AAEF,wBAAgB,+BAA+B,IAAI,QAAQ,
|
|
1
|
+
{"version":3,"file":"geometricFindExplicitFormula.d.ts","sourceRoot":"","sources":["../../../../src/exercises/sequences/geometric/geometricFindExplicitFormula.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAe,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAW3E,eAAO,MAAM,4BAA4B,EAAE,QAU1C,CAAC;AAEF,wBAAgB,+BAA+B,IAAI,QAAQ,CA+D1D"}
|
|
@@ -32,11 +32,13 @@ function getGeometricFindExplicitFormula() {
|
|
|
32
32
|
id: (0, uuid_1.v4)() + '',
|
|
33
33
|
statement: (0, simplify_1.simplifyNode)(formula).toTex(),
|
|
34
34
|
isRightAnswer: true,
|
|
35
|
+
format: 'tex',
|
|
35
36
|
});
|
|
36
37
|
res.push({
|
|
37
38
|
id: (0, uuid_1.v4)() + '',
|
|
38
39
|
statement: (0, simplify_1.simplifyNode)(new multiplyNode_1.MultiplyNode(new numberNode_1.NumberNode(reason), new powerNode_1.PowerNode(new numberNode_1.NumberNode(firstValue), new variableNode_1.VariableNode('n')))).toTex(),
|
|
39
40
|
isRightAnswer: false,
|
|
41
|
+
format: 'tex',
|
|
40
42
|
});
|
|
41
43
|
for (let i = 0; i < n - 2; i++) {
|
|
42
44
|
let isDuplicate;
|
|
@@ -47,6 +49,7 @@ function getGeometricFindExplicitFormula() {
|
|
|
47
49
|
id: (0, uuid_1.v4)() + '',
|
|
48
50
|
statement: (0, simplify_1.simplifyNode)(wrongAnswer).toTex(),
|
|
49
51
|
isRightAnswer: false,
|
|
52
|
+
format: 'tex',
|
|
50
53
|
};
|
|
51
54
|
isDuplicate = res.some((p) => p.statement === proposition.statement);
|
|
52
55
|
} while (isDuplicate);
|
|
@@ -60,6 +63,7 @@ function getGeometricFindExplicitFormula() {
|
|
|
60
63
|
answer: (0, simplify_1.simplifyNode)(formula).toTex(),
|
|
61
64
|
keys: ['q', 'n', 'u', 'underscore'],
|
|
62
65
|
getPropositions,
|
|
66
|
+
answerFormat: 'tex',
|
|
63
67
|
};
|
|
64
68
|
return question;
|
|
65
69
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"geometricFindReason.d.ts","sourceRoot":"","sources":["../../../../src/exercises/sequences/geometric/geometricFindReason.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAe,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAM3E,eAAO,MAAM,mBAAmB,EAAE,QAUjC,CAAC;AAEF,wBAAgB,sBAAsB,IAAI,QAAQ,
|
|
1
|
+
{"version":3,"file":"geometricFindReason.d.ts","sourceRoot":"","sources":["../../../../src/exercises/sequences/geometric/geometricFindReason.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAe,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAM3E,eAAO,MAAM,mBAAmB,EAAE,QAUjC,CAAC;AAEF,wBAAgB,sBAAsB,IAAI,QAAQ,CAuDjD"}
|
|
@@ -28,12 +28,14 @@ function getGeometricFindReason() {
|
|
|
28
28
|
id: (0, uuid_1.v4)() + '',
|
|
29
29
|
statement: reason + '',
|
|
30
30
|
isRightAnswer: true,
|
|
31
|
+
format: 'tex',
|
|
31
32
|
});
|
|
32
33
|
if (value2 - value1 !== 2)
|
|
33
34
|
res.push({
|
|
34
35
|
id: (0, uuid_1.v4)() + '',
|
|
35
36
|
statement: value2 - value1 + '',
|
|
36
37
|
isRightAnswer: false,
|
|
38
|
+
format: 'tex',
|
|
37
39
|
});
|
|
38
40
|
for (let i = 0; i < (value2 - value1 === 2 ? n - 1 : n - 2); i++) {
|
|
39
41
|
let isDuplicate;
|
|
@@ -43,6 +45,7 @@ function getGeometricFindReason() {
|
|
|
43
45
|
id: (0, uuid_1.v4)() + '',
|
|
44
46
|
statement: reason + (0, randint_1.randint)(1, 10) + '',
|
|
45
47
|
isRightAnswer: false,
|
|
48
|
+
format: 'tex',
|
|
46
49
|
};
|
|
47
50
|
isDuplicate = res.some((p) => p.statement === proposition.statement);
|
|
48
51
|
} while (isDuplicate);
|
|
@@ -56,6 +59,7 @@ function getGeometricFindReason() {
|
|
|
56
59
|
answer: reason.toString(),
|
|
57
60
|
keys: ['q', 'n', 'u', 'underscore'],
|
|
58
61
|
getPropositions,
|
|
62
|
+
answerFormat: 'tex',
|
|
59
63
|
};
|
|
60
64
|
return question;
|
|
61
65
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"geometricReasonUsage.d.ts","sourceRoot":"","sources":["../../../../src/exercises/sequences/geometric/geometricReasonUsage.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAe,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAM3E,eAAO,MAAM,oBAAoB,EAAE,QAUlC,CAAC;AAEF,wBAAgB,uBAAuB,IAAI,QAAQ,
|
|
1
|
+
{"version":3,"file":"geometricReasonUsage.d.ts","sourceRoot":"","sources":["../../../../src/exercises/sequences/geometric/geometricReasonUsage.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAe,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAM3E,eAAO,MAAM,oBAAoB,EAAE,QAUlC,CAAC;AAEF,wBAAgB,uBAAuB,IAAI,QAAQ,CAsDlD"}
|
|
@@ -27,12 +27,14 @@ function getGeometricReasonUsage() {
|
|
|
27
27
|
id: (0, uuid_1.v4)() + '',
|
|
28
28
|
statement: (startValue * reason).toString(),
|
|
29
29
|
isRightAnswer: true,
|
|
30
|
+
format: 'tex',
|
|
30
31
|
});
|
|
31
32
|
if (startValue + reason !== 4)
|
|
32
33
|
res.push({
|
|
33
34
|
id: (0, uuid_1.v4)() + '',
|
|
34
35
|
statement: (startValue + reason).toString(),
|
|
35
36
|
isRightAnswer: false,
|
|
37
|
+
format: 'tex',
|
|
36
38
|
});
|
|
37
39
|
for (let i = 0; i < (startValue + reason === 4 ? n - 1 : n - 2); i++) {
|
|
38
40
|
let isDuplicate;
|
|
@@ -42,6 +44,7 @@ function getGeometricReasonUsage() {
|
|
|
42
44
|
id: (0, uuid_1.v4)() + '',
|
|
43
45
|
statement: startValue * (reason + (0, randint_1.randint)(-reason + 1, 6, [0])) + '',
|
|
44
46
|
isRightAnswer: false,
|
|
47
|
+
format: 'tex',
|
|
45
48
|
};
|
|
46
49
|
isDuplicate = res.some((p) => p.statement === proposition.statement);
|
|
47
50
|
} while (isDuplicate);
|
|
@@ -55,6 +58,7 @@ function getGeometricReasonUsage() {
|
|
|
55
58
|
answer: (startValue * reason).toString(),
|
|
56
59
|
keys: ['q', 'n', 'u', 'underscore'],
|
|
57
60
|
getPropositions,
|
|
61
|
+
answerFormat: 'tex',
|
|
58
62
|
};
|
|
59
63
|
return question;
|
|
60
64
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"geometricRecurrenceFormulaUsage.d.ts","sourceRoot":"","sources":["../../../../src/exercises/sequences/geometric/geometricRecurrenceFormulaUsage.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,gBAAgB,EAAe,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAM7F,UAAU,sCAAuC,SAAQ,gBAAgB;IACvE,IAAI,EAAE,OAAO,CAAC;CACf;AAED,eAAO,MAAM,+BAA+B,EAAE,QAY7C,CAAC;AAEF,wBAAgB,kCAAkC,CAAC,OAAO,EAAE,sCAAsC,GAAG,QAAQ,
|
|
1
|
+
{"version":3,"file":"geometricRecurrenceFormulaUsage.d.ts","sourceRoot":"","sources":["../../../../src/exercises/sequences/geometric/geometricRecurrenceFormulaUsage.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,gBAAgB,EAAe,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAM7F,UAAU,sCAAuC,SAAQ,gBAAgB;IACvE,IAAI,EAAE,OAAO,CAAC;CACf;AAED,eAAO,MAAM,+BAA+B,EAAE,QAY7C,CAAC;AAEF,wBAAgB,kCAAkC,CAAC,OAAO,EAAE,sCAAsC,GAAG,QAAQ,CAsD5G"}
|
|
@@ -27,12 +27,14 @@ function getGeometricRecurrenceFormulaUsage(options) {
|
|
|
27
27
|
id: (0, uuid_1.v4)() + '',
|
|
28
28
|
statement: (firstValue * reason).toString(),
|
|
29
29
|
isRightAnswer: true,
|
|
30
|
+
format: 'tex',
|
|
30
31
|
});
|
|
31
32
|
if (firstValue + reason !== 4)
|
|
32
33
|
res.push({
|
|
33
34
|
id: (0, uuid_1.v4)() + '',
|
|
34
35
|
statement: (firstValue + reason).toString(),
|
|
35
36
|
isRightAnswer: false,
|
|
37
|
+
format: 'tex',
|
|
36
38
|
});
|
|
37
39
|
for (let i = 0; i < (firstValue + reason === 4 ? n - 1 : n - 2); i++) {
|
|
38
40
|
let isDuplicate;
|
|
@@ -42,6 +44,7 @@ function getGeometricRecurrenceFormulaUsage(options) {
|
|
|
42
44
|
id: (0, uuid_1.v4)() + '',
|
|
43
45
|
statement: firstValue * (reason + (0, randint_1.randint)(-reason + 1, 6, [0])) + '',
|
|
44
46
|
isRightAnswer: false,
|
|
47
|
+
format: 'tex',
|
|
45
48
|
};
|
|
46
49
|
isDuplicate = res.some((p) => p.statement === proposition.statement);
|
|
47
50
|
} while (isDuplicate);
|
|
@@ -55,6 +58,7 @@ function getGeometricRecurrenceFormulaUsage(options) {
|
|
|
55
58
|
answer: (firstValue * reason).toString(),
|
|
56
59
|
keys: ['q', 'n', 'u', 'underscore'],
|
|
57
60
|
getPropositions,
|
|
61
|
+
answerFormat: 'tex',
|
|
58
62
|
};
|
|
59
63
|
return question;
|
|
60
64
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"simpifySquareRoot.d.ts","sourceRoot":"","sources":["../../../src/exercises/squareRoots/simpifySquareRoot.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,QAAQ,EAAe,QAAQ,EAAE,MAAM,aAAa,CAAC;AAI9D,eAAO,MAAM,kBAAkB,EAAE,QAUhC,CAAC;AAEF,wBAAgB,qBAAqB,IAAI,QAAQ,
|
|
1
|
+
{"version":3,"file":"simpifySquareRoot.d.ts","sourceRoot":"","sources":["../../../src/exercises/squareRoots/simpifySquareRoot.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,QAAQ,EAAe,QAAQ,EAAE,MAAM,aAAa,CAAC;AAI9D,eAAO,MAAM,kBAAkB,EAAE,QAUhC,CAAC;AAEF,wBAAgB,qBAAqB,IAAI,QAAQ,CAkDhD"}
|
|
@@ -27,6 +27,7 @@ function getSimplifySquareRoot() {
|
|
|
27
27
|
id: (0, uuid_1.v4)() + '',
|
|
28
28
|
statement: squareRoot.simplify().toTree().toTex(),
|
|
29
29
|
isRightAnswer: true,
|
|
30
|
+
format: 'tex',
|
|
30
31
|
});
|
|
31
32
|
for (let i = 0; i < n - 1; i++) {
|
|
32
33
|
let isDuplicate;
|
|
@@ -40,6 +41,7 @@ function getSimplifySquareRoot() {
|
|
|
40
41
|
id: (0, uuid_1.v4)() + '',
|
|
41
42
|
statement: squareRoot.simplify().toTree().toTex(),
|
|
42
43
|
isRightAnswer: false,
|
|
44
|
+
format: 'tex',
|
|
43
45
|
};
|
|
44
46
|
isDuplicate = res.some((p) => p.statement === proposition.statement);
|
|
45
47
|
} while (isDuplicate);
|
|
@@ -52,6 +54,7 @@ function getSimplifySquareRoot() {
|
|
|
52
54
|
answer: squareRoot.simplify().toTree().toTex(),
|
|
53
55
|
keys: [],
|
|
54
56
|
getPropositions,
|
|
57
|
+
answerFormat: 'tex',
|
|
55
58
|
};
|
|
56
59
|
return question;
|
|
57
60
|
}
|
package/lib/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
declare const
|
|
2
|
-
export {
|
|
1
|
+
declare const allMathExercises: import("./exercises/exercise").Exercise[];
|
|
2
|
+
export { allMathExercises };
|
|
3
3
|
//# sourceMappingURL=index.d.ts.map
|
package/lib/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,QAAA,MAAM,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,QAAA,MAAM,gBAAgB,2CAAiB,CAAC;AAQxC,OAAO,EAAE,gBAAgB,EAAE,CAAC"}
|
package/lib/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.allMathExercises = void 0;
|
|
4
4
|
const exercises_1 = require("./exercises/exercises");
|
|
5
|
-
const
|
|
6
|
-
exports.
|
|
5
|
+
const allMathExercises = [...exercises_1.exercises];
|
|
6
|
+
exports.allMathExercises = allMathExercises;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Node } from '../../tree/nodes/node';
|
|
2
|
+
export declare function createRandomPolynomialWithOrder(order: number, variable?: string): Polynomial;
|
|
2
3
|
export declare class Polynomial {
|
|
3
4
|
degree: number;
|
|
4
5
|
variable: string;
|
|
@@ -13,12 +14,13 @@ export declare class Polynomial {
|
|
|
13
14
|
*/
|
|
14
15
|
constructor(coefficients: number[], variable?: string);
|
|
15
16
|
equals(P: Polynomial): boolean;
|
|
16
|
-
getRoots():
|
|
17
|
+
getRoots(): number[];
|
|
17
18
|
add(P: Polynomial): Polynomial;
|
|
18
19
|
times(nb: number): Polynomial;
|
|
19
20
|
multiply(Q: Polynomial): Polynomial;
|
|
20
21
|
opposite(): Polynomial;
|
|
21
22
|
derivate(): Polynomial;
|
|
23
|
+
integrate(): Polynomial;
|
|
22
24
|
calculate(x: number): number;
|
|
23
25
|
toTree(): Node;
|
|
24
26
|
toTex(): string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"polynomial.d.ts","sourceRoot":"","sources":["../../../src/math/polynomials/polynomial.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"polynomial.d.ts","sourceRoot":"","sources":["../../../src/math/polynomials/polynomial.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAU7C,wBAAgB,+BAA+B,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,GAAE,MAAY,GAAG,UAAU,CAYjG;AAED,qBAAa,UAAU;IACrB,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB;;OAEG;IACH,YAAY,EAAE,MAAM,EAAE,CAAC;IAEvB;;;;OAIG;gBACS,YAAY,EAAE,MAAM,EAAE,EAAE,QAAQ,GAAE,MAAY;IAS1D,MAAM,CAAC,CAAC,EAAE,UAAU,GAAG,OAAO;IAG9B,QAAQ,IAAI,MAAM,EAAE;IA8BpB,GAAG,CAAC,CAAC,EAAE,UAAU,GAAG,UAAU;IAc9B,KAAK,CAAC,EAAE,EAAE,MAAM,GAAG,UAAU;IAM7B,QAAQ,CAAC,CAAC,EAAE,UAAU,GAAG,UAAU;IAkBnC,QAAQ,IAAI,UAAU;IAOtB,QAAQ,IAAI,UAAU;IAQtB,SAAS,IAAI,UAAU;IAMvB,SAAS,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM;IAM5B,MAAM,IAAI,IAAI;IAmCd,KAAK,IAAI,MAAM;IAkBf,QAAQ,IAAI,MAAM;CAGnB"}
|
|
@@ -1,12 +1,25 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Polynomial = void 0;
|
|
3
|
+
exports.Polynomial = exports.createRandomPolynomialWithOrder = void 0;
|
|
4
4
|
const numberNode_1 = require("../../tree/nodes/numbers/numberNode");
|
|
5
5
|
const addNode_1 = require("../../tree/nodes/operators/addNode");
|
|
6
6
|
const multiplyNode_1 = require("../../tree/nodes/operators/multiplyNode");
|
|
7
7
|
const oppositeNode_1 = require("../../tree/nodes/functions/oppositeNode");
|
|
8
8
|
const powerNode_1 = require("../../tree/nodes/operators/powerNode");
|
|
9
9
|
const variableNode_1 = require("../../tree/nodes/variables/variableNode");
|
|
10
|
+
const randint_1 = require("../../math/utils/random/randint");
|
|
11
|
+
function createRandomPolynomialWithOrder(order, variable = 'x') {
|
|
12
|
+
if (order < 0) {
|
|
13
|
+
throw Error('Order must be a non-negative integer');
|
|
14
|
+
}
|
|
15
|
+
const coefficients = [];
|
|
16
|
+
for (let i = 0; i <= order - 1; i++) {
|
|
17
|
+
coefficients.push((0, randint_1.randint)(-9, 10));
|
|
18
|
+
}
|
|
19
|
+
coefficients.push((0, randint_1.randint)(-9, 10, [0]));
|
|
20
|
+
return new Polynomial(coefficients, variable);
|
|
21
|
+
}
|
|
22
|
+
exports.createRandomPolynomialWithOrder = createRandomPolynomialWithOrder;
|
|
10
23
|
class Polynomial {
|
|
11
24
|
/**
|
|
12
25
|
*
|
|
@@ -26,7 +39,35 @@ class Polynomial {
|
|
|
26
39
|
equals(P) {
|
|
27
40
|
return P.degree === this.degree && this.coefficients.every((coeff, i) => coeff === P.coefficients[i]);
|
|
28
41
|
}
|
|
29
|
-
getRoots() {
|
|
42
|
+
getRoots() {
|
|
43
|
+
const roots = [];
|
|
44
|
+
if (this.degree === 1) {
|
|
45
|
+
// Polynôme de degré 1 : ax + b = 0
|
|
46
|
+
const a = this.coefficients[1];
|
|
47
|
+
const b = this.coefficients[0];
|
|
48
|
+
if (a !== 0) {
|
|
49
|
+
roots.push(-b / a);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
else if (this.degree === 2) {
|
|
53
|
+
// Polynôme de degré 2 : ax^2 + bx + c = 0
|
|
54
|
+
const a = this.coefficients[2];
|
|
55
|
+
const b = this.coefficients[1];
|
|
56
|
+
const c = this.coefficients[0];
|
|
57
|
+
const delta = b * b - 4 * a * c;
|
|
58
|
+
if (delta > 0) {
|
|
59
|
+
roots.push((-b + Math.sqrt(delta)) / (2 * a));
|
|
60
|
+
roots.push((-b - Math.sqrt(delta)) / (2 * a));
|
|
61
|
+
}
|
|
62
|
+
else if (delta === 0) {
|
|
63
|
+
roots.push(-b / (2 * a));
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
else {
|
|
67
|
+
//méthode de Newton-Raphson ou des bibliothèques de calcul symbolique pour obtenir les racines.
|
|
68
|
+
}
|
|
69
|
+
return roots.sort((a, b) => a - b);
|
|
70
|
+
}
|
|
30
71
|
add(P) {
|
|
31
72
|
var _a, _b;
|
|
32
73
|
if (P.variable !== this.variable)
|
|
@@ -67,6 +108,11 @@ class Polynomial {
|
|
|
67
108
|
res.push(i * this.coefficients[i]);
|
|
68
109
|
return new Polynomial(res, this.variable);
|
|
69
110
|
}
|
|
111
|
+
integrate() {
|
|
112
|
+
const newCoefficients = this.coefficients.map((coeff, exp) => coeff / (exp + 1));
|
|
113
|
+
newCoefficients.unshift(0);
|
|
114
|
+
return new Polynomial(newCoefficients, this.variable);
|
|
115
|
+
}
|
|
70
116
|
calculate(x) {
|
|
71
117
|
let res = 0;
|
|
72
118
|
for (let i = 0; i < this.coefficients.length; i++)
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Node, NodeType } from '../node';
|
|
2
|
+
import { FunctionNode } from './functionNode';
|
|
3
|
+
export declare class ExpNode extends FunctionNode implements Node {
|
|
4
|
+
type: NodeType;
|
|
5
|
+
constructor(child: Node);
|
|
6
|
+
toMathString(): string;
|
|
7
|
+
toTex(): string;
|
|
8
|
+
simplify(): Node;
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=expNode.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"expNode.d.ts","sourceRoot":"","sources":["../../../../src/tree/nodes/functions/expNode.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACzC,OAAO,EAAE,YAAY,EAAgB,MAAM,gBAAgB,CAAC;AAE5D,qBAAa,OAAQ,SAAQ,YAAa,YAAW,IAAI;IACvD,IAAI,EAAE,QAAQ,CAAqB;gBAEvB,KAAK,EAAE,IAAI;IAIvB,YAAY,IAAI,MAAM;IAItB,KAAK,IAAI,MAAM;IAIf,QAAQ,IAAI,IAAI;CAGjB"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ExpNode = void 0;
|
|
4
|
+
const node_1 = require("../node");
|
|
5
|
+
const functionNode_1 = require("./functionNode");
|
|
6
|
+
class ExpNode extends functionNode_1.FunctionNode {
|
|
7
|
+
constructor(child) {
|
|
8
|
+
super(functionNode_1.FunctionsIds.exp, child, '\\exp');
|
|
9
|
+
this.type = node_1.NodeType.function;
|
|
10
|
+
}
|
|
11
|
+
toMathString() {
|
|
12
|
+
return `e^(${this.child.toMathString()})`;
|
|
13
|
+
}
|
|
14
|
+
toTex() {
|
|
15
|
+
return `e^{${this.child.toTex()}}`;
|
|
16
|
+
}
|
|
17
|
+
simplify() {
|
|
18
|
+
return this;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
exports.ExpNode = ExpNode;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"functionNode.d.ts","sourceRoot":"","sources":["../../../../src/tree/nodes/functions/functionNode.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAEzC,oBAAY,YAAY;IACtB,QAAQ,IAAA;IACR,IAAI,IAAA;IACJ,GAAG,IAAA;IACH,GAAG,IAAA;CACJ;AAED,8BAAsB,YAAY;IAChC,EAAE,EAAE,YAAY,CAAC;IACjB,KAAK,EAAE,IAAI,CAAC;IACZ,IAAI,WAAqB;IACzB,GAAG,EAAE,MAAM,CAAC;gBACA,EAAE,EAAE,YAAY,EAAE,KAAK,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM;CAKvD"}
|
|
1
|
+
{"version":3,"file":"functionNode.d.ts","sourceRoot":"","sources":["../../../../src/tree/nodes/functions/functionNode.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAEzC,oBAAY,YAAY;IACtB,QAAQ,IAAA;IACR,IAAI,IAAA;IACJ,GAAG,IAAA;IACH,GAAG,IAAA;IACH,GAAG,IAAA;IACH,GAAG,IAAA;CACJ;AAED,8BAAsB,YAAY;IAChC,EAAE,EAAE,YAAY,CAAC;IACjB,KAAK,EAAE,IAAI,CAAC;IACZ,IAAI,WAAqB;IACzB,GAAG,EAAE,MAAM,CAAC;gBACA,EAAE,EAAE,YAAY,EAAE,KAAK,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM;CAKvD"}
|
|
@@ -8,6 +8,8 @@ var FunctionsIds;
|
|
|
8
8
|
FunctionsIds[FunctionsIds["sqrt"] = 1] = "sqrt";
|
|
9
9
|
FunctionsIds[FunctionsIds["cos"] = 2] = "cos";
|
|
10
10
|
FunctionsIds[FunctionsIds["sin"] = 3] = "sin";
|
|
11
|
+
FunctionsIds[FunctionsIds["log"] = 4] = "log";
|
|
12
|
+
FunctionsIds[FunctionsIds["exp"] = 5] = "exp";
|
|
11
13
|
})(FunctionsIds = exports.FunctionsIds || (exports.FunctionsIds = {}));
|
|
12
14
|
class FunctionNode {
|
|
13
15
|
constructor(id, child, tex) {
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Node, NodeType } from '../node';
|
|
2
|
+
import { FunctionNode } from './functionNode';
|
|
3
|
+
export declare class LogNode extends FunctionNode implements Node {
|
|
4
|
+
type: NodeType;
|
|
5
|
+
constructor(child: Node);
|
|
6
|
+
toMathString(): string;
|
|
7
|
+
toTex(): string;
|
|
8
|
+
simplify(): Node;
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=logNode.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logNode.d.ts","sourceRoot":"","sources":["../../../../src/tree/nodes/functions/logNode.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACzC,OAAO,EAAE,YAAY,EAAgB,MAAM,gBAAgB,CAAC;AAE5D,qBAAa,OAAQ,SAAQ,YAAa,YAAW,IAAI;IACvD,IAAI,EAAE,QAAQ,CAAqB;gBAEvB,KAAK,EAAE,IAAI;IAIvB,YAAY,IAAI,MAAM;IAItB,KAAK,IAAI,MAAM;IAIf,QAAQ,IAAI,IAAI;CAGjB"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.LogNode = void 0;
|
|
4
|
+
const node_1 = require("../node");
|
|
5
|
+
const functionNode_1 = require("./functionNode");
|
|
6
|
+
class LogNode extends functionNode_1.FunctionNode {
|
|
7
|
+
constructor(child) {
|
|
8
|
+
super(functionNode_1.FunctionsIds.log, child, '\\ln');
|
|
9
|
+
this.type = node_1.NodeType.function;
|
|
10
|
+
}
|
|
11
|
+
toMathString() {
|
|
12
|
+
return `log(${this.child.toMathString()})`;
|
|
13
|
+
}
|
|
14
|
+
toTex() {
|
|
15
|
+
return `\\ln\\left(${this.child.toTex()}\\right)`;
|
|
16
|
+
}
|
|
17
|
+
simplify() {
|
|
18
|
+
return this;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
exports.LogNode = LogNode;
|
|
@@ -1 +1,10 @@
|
|
|
1
|
+
import { Node, NodeType } from '../node';
|
|
2
|
+
import { FunctionNode } from './functionNode';
|
|
3
|
+
export declare class SinNode extends FunctionNode implements Node {
|
|
4
|
+
type: NodeType;
|
|
5
|
+
constructor(child: Node);
|
|
6
|
+
toMathString(): string;
|
|
7
|
+
toTex(): string;
|
|
8
|
+
simplify(): Node;
|
|
9
|
+
}
|
|
1
10
|
//# sourceMappingURL=sinNode.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sinNode.d.ts","sourceRoot":"","sources":["../../../../src/tree/nodes/functions/sinNode.ts"],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"sinNode.d.ts","sourceRoot":"","sources":["../../../../src/tree/nodes/functions/sinNode.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACzC,OAAO,EAAE,YAAY,EAAgB,MAAM,gBAAgB,CAAC;AAE5D,qBAAa,OAAQ,SAAQ,YAAa,YAAW,IAAI;IACvD,IAAI,EAAE,QAAQ,CAAqB;gBAEvB,KAAK,EAAE,IAAI;IAIvB,YAAY,IAAI,MAAM;IAItB,KAAK,IAAI,MAAM;IAIf,QAAQ,IAAI,IAAI;CAGjB"}
|
|
@@ -1 +1,21 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SinNode = void 0;
|
|
4
|
+
const node_1 = require("../node");
|
|
5
|
+
const functionNode_1 = require("./functionNode");
|
|
6
|
+
class SinNode extends functionNode_1.FunctionNode {
|
|
7
|
+
constructor(child) {
|
|
8
|
+
super(functionNode_1.FunctionsIds.sin, child, '\\sin');
|
|
9
|
+
this.type = node_1.NodeType.function;
|
|
10
|
+
}
|
|
11
|
+
toMathString() {
|
|
12
|
+
return `sin(${this.child.toMathString()})`;
|
|
13
|
+
}
|
|
14
|
+
toTex() {
|
|
15
|
+
return `\\sin\\left(${this.child.toTex()}\\right)`;
|
|
16
|
+
}
|
|
17
|
+
simplify() {
|
|
18
|
+
return this;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
exports.SinNode = SinNode;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"simplify.d.ts","sourceRoot":"","sources":["../../../src/tree/parsers/simplify.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"simplify.d.ts","sourceRoot":"","sources":["../../../src/tree/parsers/simplify.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAyBrC,eAAO,MAAM,YAAY,SAAU,IAAI,KAAG,IAEzC,CAAC"}
|
|
@@ -12,6 +12,10 @@ const multiplyNode_1 = require("../nodes/operators/multiplyNode");
|
|
|
12
12
|
const powerNode_1 = require("../nodes/operators/powerNode");
|
|
13
13
|
const substractNode_1 = require("../nodes/operators/substractNode");
|
|
14
14
|
const variableNode_1 = require("../nodes/variables/variableNode");
|
|
15
|
+
const logNode_1 = require("../nodes/functions/logNode");
|
|
16
|
+
const expNode_1 = require("../nodes/functions/expNode");
|
|
17
|
+
const cosNode_1 = require("../../tree/nodes/functions/cosNode");
|
|
18
|
+
const sinNode_1 = require("../../tree/nodes/functions/sinNode");
|
|
15
19
|
const simplifyNode = (node) => {
|
|
16
20
|
return mathjsNodeToNode((0, mathjs_1.simplify)(node.toMathString()));
|
|
17
21
|
};
|
|
@@ -46,6 +50,14 @@ const mathjsNodeToNode = (mathjsNode) => {
|
|
|
46
50
|
switch (fn.name) {
|
|
47
51
|
case 'sqrt':
|
|
48
52
|
return new sqrtNode_1.SqrtNode(mathjsNodeToNode(mathjsNode.args[0]));
|
|
53
|
+
case 'log':
|
|
54
|
+
return new logNode_1.LogNode(mathjsNodeToNode(mathjsNode.args[0]));
|
|
55
|
+
case 'exp':
|
|
56
|
+
return new expNode_1.ExpNode(mathjsNodeToNode(mathjsNode.args[0]));
|
|
57
|
+
case 'cos':
|
|
58
|
+
return new cosNode_1.CosNode(mathjsNodeToNode(mathjsNode.args[0]));
|
|
59
|
+
case 'sin':
|
|
60
|
+
return new sinNode_1.SinNode(mathjsNodeToNode(mathjsNode.args[0]));
|
|
49
61
|
}
|
|
50
62
|
}
|
|
51
63
|
throw Error('unrecognized mathjs node');
|