math-exercises 1.3.31 → 1.3.33
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/README.md +73 -73
- package/lib/exercises/calcul/addAndSub.d.ts +6 -6
- package/lib/exercises/calcul/addAndSub.js +41 -41
- package/lib/exercises/calcul/addAndSubWithoutRelatives.d.ts +6 -6
- package/lib/exercises/calcul/addAndSubWithoutRelatives.js +51 -51
- package/lib/exercises/calcul/fractions/fractionAndIntegerDivision.d.ts +3 -3
- package/lib/exercises/calcul/fractions/fractionAndIntegerDivision.js +37 -37
- package/lib/exercises/calcul/fractions/fractionAndIntegerProduct.d.ts +3 -3
- package/lib/exercises/calcul/fractions/fractionAndIntegerProduct.js +34 -34
- package/lib/exercises/calcul/fractions/fractionAndIntegerSum.d.ts +3 -3
- package/lib/exercises/calcul/fractions/fractionAndIntegerSum.js +34 -34
- package/lib/exercises/calcul/fractions/fractionToPercentToDecimal.d.ts +3 -3
- package/lib/exercises/calcul/fractions/fractionToPercentToDecimal.js +69 -69
- package/lib/exercises/calcul/fractions/fractionsDivision.d.ts +3 -3
- package/lib/exercises/calcul/fractions/fractionsDivision.js +31 -31
- package/lib/exercises/calcul/fractions/fractionsProduct.d.ts +3 -3
- package/lib/exercises/calcul/fractions/fractionsProduct.js +30 -30
- package/lib/exercises/calcul/fractions/fractionsSum.d.ts +3 -3
- package/lib/exercises/calcul/fractions/fractionsSum.js +30 -30
- package/lib/exercises/calcul/fractions/simplifyFraction.d.ts +3 -3
- package/lib/exercises/calcul/fractions/simplifyFraction.js +26 -26
- package/lib/exercises/calcul/mentalCaluls.ts/mentalAddAndSub.d.ts +3 -3
- package/lib/exercises/calcul/mentalCaluls.ts/mentalAddAndSub.js +46 -46
- package/lib/exercises/calcul/mentalCaluls.ts/mentalDivisions.d.ts +3 -3
- package/lib/exercises/calcul/mentalCaluls.ts/mentalDivisions.js +64 -64
- package/lib/exercises/calcul/mentalCaluls.ts/mentalMultiplications.d.ts +3 -3
- package/lib/exercises/calcul/mentalCaluls.ts/mentalMultiplications.js +51 -51
- package/lib/exercises/calcul/mentalCaluls.ts/mentalPercentage.d.ts +3 -3
- package/lib/exercises/calcul/mentalCaluls.ts/mentalPercentage.js +67 -67
- package/lib/exercises/calcul/operations/operationsPriorities.d.ts +10 -10
- package/lib/exercises/calcul/operations/operationsPriorities.js +100 -100
- package/lib/exercises/calcul/operations/operationsPrioritiesWithoutRelative.d.ts +10 -10
- package/lib/exercises/calcul/operations/operationsPrioritiesWithoutRelative.js +181 -181
- package/lib/exercises/calcul/operationsPriorities.js +88 -0
- package/lib/exercises/calcul/rounding/rounding.d.ts +19 -19
- package/lib/exercises/calcul/rounding/rounding.js +87 -87
- package/lib/exercises/calculLitteral/distributivity/allIdentities.d.ts +3 -3
- package/lib/exercises/calculLitteral/distributivity/allIdentities.js +27 -27
- package/lib/exercises/calculLitteral/distributivity/doubleDistributivity.d.ts +3 -3
- package/lib/exercises/calculLitteral/distributivity/doubleDistributivity.js +32 -32
- package/lib/exercises/calculLitteral/distributivity/firstIdentity.d.ts +3 -3
- package/lib/exercises/calculLitteral/distributivity/firstIdentity.js +33 -33
- package/lib/exercises/calculLitteral/distributivity/secondIdentity.d.ts +3 -3
- package/lib/exercises/calculLitteral/distributivity/secondIdentity.js +34 -34
- package/lib/exercises/calculLitteral/distributivity/simpleDistributivity.d.ts +3 -3
- package/lib/exercises/calculLitteral/distributivity/simpleDistributivity.js +34 -34
- package/lib/exercises/calculLitteral/distributivity/thirdIdentity.d.ts +3 -3
- package/lib/exercises/calculLitteral/distributivity/thirdIdentity.js +33 -33
- package/lib/exercises/calculLitteral/equation/equationSimpleSquare.d.ts +3 -3
- package/lib/exercises/calculLitteral/equation/equationSimpleSquare.js +47 -47
- package/lib/exercises/calculLitteral/equation/equationType1Exercise.d.ts +6 -6
- package/lib/exercises/calculLitteral/equation/equationType1Exercise.js +39 -39
- package/lib/exercises/calculLitteral/equation/equationType2Exercise.d.ts +6 -6
- package/lib/exercises/calculLitteral/equation/equationType2Exercise.js +42 -42
- package/lib/exercises/calculLitteral/equation/equationType3Exercise.d.ts +6 -6
- package/lib/exercises/calculLitteral/equation/equationType3Exercise.js +43 -43
- package/lib/exercises/calculLitteral/equation/equationType4Exercise.d.ts +6 -6
- package/lib/exercises/calculLitteral/equation/equationType4Exercise.js +45 -45
- package/lib/exercises/calculLitteral/equation/firstDegreeEquation.d.ts +3 -3
- package/lib/exercises/calculLitteral/equation/firstDegreeEquation.js +30 -30
- package/lib/exercises/calculLitteral/equation/firstDegreeGeneralEquation.d.ts +3 -3
- package/lib/exercises/calculLitteral/equation/firstDegreeGeneralEquation.js +32 -32
- package/lib/exercises/calculLitteral/equation/fractionEquation.d.ts +4 -0
- package/lib/exercises/calculLitteral/equation/fractionEquation.d.ts.map +1 -0
- package/lib/exercises/calculLitteral/equation/fractionEquation.js +39 -0
- package/lib/exercises/calculLitteral/equation/multiplicationEquation.d.ts +4 -0
- package/lib/exercises/calculLitteral/equation/multiplicationEquation.d.ts.map +1 -0
- package/lib/exercises/calculLitteral/equation/multiplicationEquation.js +39 -0
- package/lib/exercises/calculLitteral/factorisation/factoIdRmq1.d.ts +3 -3
- package/lib/exercises/calculLitteral/factorisation/factoIdRmq1.js +34 -34
- package/lib/exercises/calculLitteral/factorisation/factoIdRmq2.d.ts +3 -3
- package/lib/exercises/calculLitteral/factorisation/factoIdRmq2.js +35 -35
- package/lib/exercises/calculLitteral/factorisation/factoIdRmq3.d.ts +3 -3
- package/lib/exercises/calculLitteral/factorisation/factoIdRmq3.js +34 -34
- package/lib/exercises/calculLitteral/factorisation/factoType1Exercise.d.ts +6 -6
- package/lib/exercises/calculLitteral/factorisation/factoType1Exercise.js +40 -40
- package/lib/exercises/conversion/aeraConversion.d.ts +3 -3
- package/lib/exercises/conversion/aeraConversion.js +32 -32
- package/lib/exercises/conversion/capacityConversion.d.ts +3 -3
- package/lib/exercises/conversion/capacityConversion.js +30 -30
- package/lib/exercises/conversion/lengthConversion.d.ts +3 -3
- package/lib/exercises/conversion/lengthConversion.js +30 -30
- package/lib/exercises/conversion/massConversion.d.ts +3 -3
- package/lib/exercises/conversion/massConversion.js +30 -30
- package/lib/exercises/conversion/volumeCapacityConversion.d.ts +3 -3
- package/lib/exercises/conversion/volumeCapacityConversion.js +47 -47
- package/lib/exercises/conversion/volumeConversion.d.ts +3 -3
- package/lib/exercises/conversion/volumeConversion.js +32 -32
- package/lib/exercises/derivation/derivative/affineDerivative.d.ts +4 -0
- package/lib/exercises/derivation/derivative/affineDerivative.d.ts.map +1 -0
- package/lib/exercises/derivation/derivative/affineDerivative.js +27 -0
- package/lib/exercises/derivation/derivative/constanteDerivative.d.ts +3 -3
- package/lib/exercises/derivation/derivative/constanteDerivative.js +27 -27
- package/lib/exercises/derivation/derivative/firstDegreeDerivative.d.ts +3 -3
- package/lib/exercises/derivation/derivative/firstDegreeDerivative.js +29 -29
- package/lib/exercises/derivation/derivative/inverseFunctionDerivative.d.ts +3 -3
- package/lib/exercises/derivation/derivative/inverseFunctionDerivative.js +27 -27
- package/lib/exercises/derivation/derivative/powerFunctionDerivative.d.ts +3 -3
- package/lib/exercises/derivation/derivative/powerFunctionDerivative.js +35 -35
- package/lib/exercises/derivation/derivative/rootFunctionDerivative.d.ts +3 -3
- package/lib/exercises/derivation/derivative/rootFunctionDerivative.js +40 -40
- package/lib/exercises/derivation/derivative/secondDegreeDerivative.d.ts +3 -3
- package/lib/exercises/derivation/derivative/secondDegreeDerivative.js +30 -30
- package/lib/exercises/derivation/derivative/thirdDegreeDerivative.d.ts +3 -3
- package/lib/exercises/derivation/derivative/thirdDegreeDerivative.js +33 -33
- package/lib/exercises/derivation/derivative/thridDegreeDerivative.d.ts +1 -0
- package/lib/exercises/derivation/derivative/thridDegreeDerivative.d.ts.map +1 -0
- package/lib/exercises/derivation/derivative/thridDegreeDerivative.js +1 -0
- package/lib/exercises/derivation/derivative/usualderivative.d.ts +3 -3
- package/lib/exercises/derivation/derivative/usualderivative.js +36 -36
- package/lib/exercises/exercise.d.ts +21 -21
- package/lib/exercises/exercise.js +7 -7
- package/lib/exercises/exercises.d.ts +1 -1
- package/lib/exercises/exercises.d.ts.map +1 -1
- package/lib/exercises/exercises.js +224 -198
- package/lib/exercises/geometry/cartesian/derivativeNumberReading.d.ts +3 -3
- package/lib/exercises/geometry/cartesian/derivativeNumberReading.js +51 -51
- package/lib/exercises/geometry/cartesian/derivativeNumberReading2.js +91 -91
- package/lib/exercises/geometry/cartesian/leadingCoefficient.d.ts +3 -3
- package/lib/exercises/geometry/cartesian/leadingCoefficient.js +60 -60
- package/lib/exercises/geometry/cartesian/leadingCoefficientCalculV1.d.ts +4 -0
- package/lib/exercises/geometry/cartesian/leadingCoefficientCalculV1.d.ts.map +1 -0
- package/lib/exercises/geometry/cartesian/leadingCoefficientCalculV1.js +30 -0
- package/lib/exercises/geometry/cartesian/leadingCoefficientCalculV2.d.ts +4 -0
- package/lib/exercises/geometry/cartesian/leadingCoefficientCalculV2.d.ts.map +1 -0
- package/lib/exercises/geometry/cartesian/leadingCoefficientCalculV2.js +29 -0
- package/lib/exercises/geometry/cartesian/midpoint.d.ts +3 -3
- package/lib/exercises/geometry/cartesian/midpoint.js +31 -31
- package/lib/exercises/geometry/euclidean/TriangleArea.d.ts +4 -0
- package/lib/exercises/geometry/euclidean/TriangleArea.d.ts.map +1 -0
- package/lib/exercises/geometry/euclidean/TriangleArea.js +53 -0
- package/lib/exercises/geometry/euclidean/pythagore.d.ts +4 -0
- package/lib/exercises/geometry/euclidean/pythagore.d.ts.map +1 -0
- package/lib/exercises/geometry/euclidean/pythagore.js +31 -0
- package/lib/exercises/geometry/euclidean/pythagoreCalcul.d.ts +4 -0
- package/lib/exercises/geometry/euclidean/pythagoreCalcul.d.ts.map +1 -0
- package/lib/exercises/geometry/euclidean/pythagoreCalcul.js +60 -0
- package/lib/exercises/geometry/euclidean/rightTriangleArea.d.ts +4 -0
- package/lib/exercises/geometry/euclidean/rightTriangleArea.d.ts.map +1 -0
- package/lib/exercises/geometry/euclidean/rightTriangleArea.js +39 -0
- package/lib/exercises/geometry/euclidean/thales.d.ts +4 -0
- package/lib/exercises/geometry/euclidean/thales.d.ts.map +1 -0
- package/lib/exercises/geometry/euclidean/thales.js +67 -0
- package/lib/exercises/geometry/euclidean/thalesCalcul.d.ts +4 -0
- package/lib/exercises/geometry/euclidean/thalesCalcul.d.ts.map +1 -0
- package/lib/exercises/geometry/euclidean/thalesCalcul.js +104 -0
- package/lib/exercises/geometry/euclidean/trigonometry.d.ts +4 -0
- package/lib/exercises/geometry/euclidean/trigonometry.d.ts.map +1 -0
- package/lib/exercises/geometry/euclidean/trigonometry.js +55 -0
- package/lib/exercises/geometry/euclidean/trigonometryAngleCalcul.d.ts +4 -0
- package/lib/exercises/geometry/euclidean/trigonometryAngleCalcul.d.ts.map +1 -0
- package/lib/exercises/geometry/euclidean/trigonometryAngleCalcul.js +42 -0
- package/lib/exercises/geometry/euclidean/trigonometrySideCalcul.d.ts +4 -0
- package/lib/exercises/geometry/euclidean/trigonometrySideCalcul.d.ts.map +1 -0
- package/lib/exercises/geometry/euclidean/trigonometrySideCalcul.js +52 -0
- package/lib/exercises/geometry/vectors/scalarProductViaCoords.d.ts +3 -3
- package/lib/exercises/geometry/vectors/scalarProductViaCoords.js +30 -30
- package/lib/exercises/geometry/vectors/scalarProductViaNorms.js +27 -27
- package/lib/exercises/percent/applyPercent.d.ts +3 -3
- package/lib/exercises/percent/applyPercent.js +41 -41
- package/lib/exercises/percent/averageEvolutionRate.d.ts +3 -3
- package/lib/exercises/percent/averageEvolutionRate.js +30 -30
- package/lib/exercises/percent/globalPercent.d.ts +3 -3
- package/lib/exercises/percent/globalPercent.js +44 -44
- package/lib/exercises/percent/reciprocalPercentage.d.ts +3 -3
- package/lib/exercises/percent/reciprocalPercentage.js +32 -32
- package/lib/exercises/powers/powersDivision.d.ts +7 -7
- package/lib/exercises/powers/powersDivision.js +46 -46
- package/lib/exercises/powers/powersOfTenToDecimal.d.ts +6 -6
- package/lib/exercises/powers/powersOfTenToDecimal.js +34 -34
- package/lib/exercises/powers/powersPower.d.ts +7 -7
- package/lib/exercises/powers/powersPower.js +45 -45
- package/lib/exercises/powers/powersProduct.d.ts +7 -7
- package/lib/exercises/powers/powersProduct.js +46 -46
- package/lib/exercises/powers/scientificToDecimal.d.ts +6 -6
- package/lib/exercises/powers/scientificToDecimal.js +39 -39
- package/lib/exercises/proba/conditionalProbability.d.ts +3 -3
- package/lib/exercises/proba/conditionalProbability.js +74 -74
- package/lib/exercises/proba/marginalAndConditionalFrequency.d.ts +3 -3
- package/lib/exercises/proba/marginalAndConditionalFrequency.js +81 -81
- package/lib/exercises/proba/probabilityTree.d.ts +3 -3
- package/lib/exercises/proba/probabilityTree.js +105 -105
- package/lib/exercises/sequences/arithmetic/arithmeticExplicitFormulaUsage.d.ts +3 -3
- package/lib/exercises/sequences/arithmetic/arithmeticExplicitFormulaUsage.js +31 -31
- package/lib/exercises/sequences/arithmetic/arithmeticFindExplicitFormula.d.ts +3 -3
- package/lib/exercises/sequences/arithmetic/arithmeticFindExplicitFormula.js +31 -31
- package/lib/exercises/sequences/arithmetic/arithmeticFindReason.d.ts +3 -3
- package/lib/exercises/sequences/arithmetic/arithmeticFindReason.js +31 -31
- package/lib/exercises/sequences/arithmetic/arithmeticReasonUsage.d.ts +3 -3
- package/lib/exercises/sequences/arithmetic/arithmeticReasonUsage.js +30 -30
- package/lib/exercises/sequences/arithmetic/arithmeticRecurrenceFormulaUsage.d.ts +3 -3
- package/lib/exercises/sequences/arithmetic/arithmeticRecurrenceFormulaUsage.js +30 -30
- package/lib/exercises/sequences/arithmetic/arithmeticThresholdFind.d.ts +3 -3
- package/lib/exercises/sequences/arithmetic/arithmeticThresholdFind.js +40 -40
- package/lib/exercises/sequences/geometric/geometricExplicitFormulaUsage.d.ts +3 -3
- package/lib/exercises/sequences/geometric/geometricExplicitFormulaUsage.js +36 -36
- package/lib/exercises/sequences/geometric/geometricFindExplicitFormula.d.ts +3 -3
- package/lib/exercises/sequences/geometric/geometricFindExplicitFormula.js +35 -35
- package/lib/exercises/sequences/geometric/geometricFindReason.d.ts +3 -3
- package/lib/exercises/sequences/geometric/geometricFindReason.js +31 -31
- package/lib/exercises/sequences/geometric/geometricReasonUsage.d.ts +3 -3
- package/lib/exercises/sequences/geometric/geometricReasonUsage.js +30 -30
- package/lib/exercises/sequences/geometric/geometricRecurrenceFormulaUsage.d.ts +7 -7
- package/lib/exercises/sequences/geometric/geometricRecurrenceFormulaUsage.js +30 -30
- package/lib/exercises/squareRoots/simpifySquareRoot.d.ts +3 -3
- package/lib/exercises/squareRoots/simpifySquareRoot.js +29 -29
- package/lib/exercises/trigonometry/mainRemarkableValues.d.ts +3 -3
- package/lib/exercises/trigonometry/mainRemarkableValues.js +30 -30
- package/lib/exercises/trigonometry/remarkableValues.d.ts +3 -3
- package/lib/exercises/trigonometry/remarkableValues.js +30 -30
- package/lib/exercises/utils/getDistinctQuestions.d.ts +3 -3
- package/lib/exercises/utils/getDistinctQuestions.js +28 -28
- package/lib/geometry/point.js +27 -0
- package/lib/geometry/vector.js +31 -0
- package/lib/index.d.ts +2 -2
- package/lib/index.js +6 -6
- package/lib/math/geometry/droite.d.ts +19 -19
- package/lib/math/geometry/droite.d.ts.map +1 -1
- package/lib/math/geometry/droite.js +62 -61
- package/lib/math/geometry/point.d.ts +29 -25
- package/lib/math/geometry/point.d.ts.map +1 -1
- package/lib/math/geometry/point.js +55 -40
- package/lib/math/geometry/triangles.d.ts +54 -0
- package/lib/math/geometry/triangles.d.ts.map +1 -0
- package/lib/math/geometry/triangles.js +183 -0
- package/lib/math/geometry/vector.d.ts +15 -15
- package/lib/math/geometry/vector.js +31 -31
- package/lib/math/numbers/decimals/decimal.d.ts +24 -24
- package/lib/math/numbers/decimals/decimal.js +140 -140
- package/lib/math/numbers/epsilon.d.ts +1 -1
- package/lib/math/numbers/epsilon.js +10 -10
- package/lib/math/numbers/integer/integer.d.ts +14 -14
- package/lib/math/numbers/integer/integer.js +68 -68
- package/lib/math/numbers/integer/power.d.ts +13 -13
- package/lib/math/numbers/integer/power.js +52 -52
- package/lib/math/numbers/nombre.d.ts +13 -13
- package/lib/math/numbers/nombre.js +10 -10
- package/lib/math/numbers/rationals/rational.d.ts +25 -25
- package/lib/math/numbers/rationals/rational.js +113 -113
- package/lib/math/numbers/reals/real.d.ts +9 -9
- package/lib/math/numbers/reals/real.js +16 -16
- package/lib/math/numbers/reals/squareRoot.d.ts +18 -18
- package/lib/math/numbers/reals/squareRoot.js +63 -63
- package/lib/math/polynomials/affine.d.ts +15 -15
- package/lib/math/polynomials/affine.js +42 -42
- package/lib/math/polynomials/polynomial.d.ts +25 -25
- package/lib/math/polynomials/polynomial.js +131 -131
- package/lib/math/sequences/arithmeticSequence.js +1 -1
- package/lib/math/sequences/geometricSequence.d.ts +3 -3
- package/lib/math/sequences/geometricSequence.js +8 -8
- package/lib/math/sequences/sequence.d.ts +22 -22
- package/lib/math/sequences/sequence.js +21 -21
- package/lib/math/sets/discreteSet.d.ts +10 -10
- package/lib/math/sets/discreteSet.js +28 -28
- package/lib/math/sets/emptySet.js +6 -6
- package/lib/math/sets/intervals/intervals.d.ts +26 -26
- package/lib/math/sets/intervals/intervals.js +104 -104
- package/lib/math/sets/mathSet.d.ts +7 -7
- package/lib/math/sets/mathSet.js +10 -10
- package/lib/math/sets/mathSetInterface.d.ts +5 -5
- package/lib/math/sets/mathSetInterface.js +2 -2
- package/lib/math/trigonometry/remarkableValue.d.ts +10 -10
- package/lib/math/trigonometry/remarkableValue.js +29 -29
- package/lib/math/trigonometry/remarkableValues.d.ts +2 -2
- package/lib/math/trigonometry/remarkableValues.js +51 -51
- package/lib/math/utils/arithmetic/coprimesOf.d.ts +1 -1
- package/lib/math/utils/arithmetic/coprimesOf.js +13 -13
- package/lib/math/utils/arithmetic/dividersOf.d.ts +1 -1
- package/lib/math/utils/arithmetic/dividersOf.js +12 -12
- package/lib/math/utils/arithmetic/gcd.d.ts +1 -1
- package/lib/math/utils/arithmetic/gcd.js +7 -7
- package/lib/math/utils/arithmetic/isSquare.d.ts +1 -1
- package/lib/math/utils/arithmetic/isSquare.js +7 -7
- package/lib/math/utils/arithmetic/lcd.d.ts +1 -1
- package/lib/math/utils/arithmetic/lcd.js +12 -12
- package/lib/math/utils/arithmetic/nonCoprimesOf.d.ts +1 -1
- package/lib/math/utils/arithmetic/nonCoprimesOf.js +13 -13
- package/lib/math/utils/arithmetic/nonDividersOf.d.ts +1 -1
- package/lib/math/utils/arithmetic/nonDividersOf.js +14 -14
- package/lib/math/utils/arithmetic/primeFactors.d.ts +5 -5
- package/lib/math/utils/arithmetic/primeFactors.js +22 -22
- package/lib/math/utils/decimals/decimalPartLengthOf.d.ts +1 -1
- package/lib/math/utils/decimals/decimalPartLengthOf.js +14 -14
- package/lib/math/utils/random/randTupleInt.d.ts +13 -13
- package/lib/math/utils/random/randTupleInt.js +30 -30
- package/lib/math/utils/random/randint.d.ts +4 -4
- package/lib/math/utils/random/randint.js +18 -18
- package/lib/math/utils/round.d.ts +1 -1
- package/lib/math/utils/round.js +8 -8
- package/lib/mathutils/arithmetic/coprimesOf.js +13 -0
- package/lib/mathutils/arithmetic/dividersOf.js +12 -0
- package/lib/mathutils/arithmetic/gcd.js +7 -0
- package/lib/mathutils/arithmetic/isSquare.js +7 -0
- package/lib/mathutils/arithmetic/lcd.js +12 -0
- package/lib/mathutils/arithmetic/nonCoprimesOf.js +13 -0
- package/lib/mathutils/arithmetic/nonDividersOf.js +14 -0
- package/lib/mathutils/arithmetic/primeFactors.js +22 -0
- package/lib/mathutils/decimals/decimalPartLengthOf.js +14 -0
- package/lib/mathutils/random/randTupleInt.js +30 -0
- package/lib/mathutils/random/randint.js +18 -0
- package/lib/mathutils/round.js +8 -0
- package/lib/numbers/decimals/decimal.js +140 -0
- package/lib/numbers/epsilon.js +10 -0
- package/lib/numbers/integer/integer.js +68 -0
- package/lib/numbers/integer/power.js +52 -0
- package/lib/numbers/nombre.js +10 -0
- package/lib/numbers/rationals/rational.js +113 -0
- package/lib/numbers/reals/real.js +16 -0
- package/lib/numbers/reals/squareRoot.js +63 -0
- package/lib/polynomials/affine.js +42 -0
- package/lib/polynomials/polynomial.js +125 -0
- package/lib/server.d.ts +1 -1
- package/lib/server.js +53 -53
- package/lib/sets/discreteSet.js +28 -0
- package/lib/sets/emptySet.js +6 -0
- package/lib/sets/intervals/intervals.js +108 -0
- package/lib/sets/intervals/union.js +1 -0
- package/lib/sets/mathSet.js +10 -0
- package/lib/sets/mathSetInterface.js +2 -0
- package/lib/tree/nodes/functions/cosNode.d.ts +9 -9
- package/lib/tree/nodes/functions/cosNode.js +21 -21
- package/lib/tree/nodes/functions/functionNode.d.ts +14 -14
- package/lib/tree/nodes/functions/functionNode.js +20 -20
- package/lib/tree/nodes/functions/oppositeNode.d.ts +7 -7
- package/lib/tree/nodes/functions/oppositeNode.js +26 -26
- package/lib/tree/nodes/functions/sinNode.js +1 -1
- package/lib/tree/nodes/functions/sqrtNode.d.ts +8 -8
- package/lib/tree/nodes/functions/sqrtNode.js +18 -18
- package/lib/tree/nodes/node.d.ts +12 -12
- package/lib/tree/nodes/node.js +11 -11
- package/lib/tree/nodes/numbers/constantNode.d.ts +9 -9
- package/lib/tree/nodes/numbers/constantNode.js +18 -18
- package/lib/tree/nodes/numbers/numberNode.d.ts +10 -10
- package/lib/tree/nodes/numbers/numberNode.js +19 -19
- package/lib/tree/nodes/numbers/piNode.d.ts +2 -2
- package/lib/tree/nodes/numbers/piNode.js +5 -5
- package/lib/tree/nodes/operators/addNode.d.ts +7 -7
- package/lib/tree/nodes/operators/addNode.js +19 -19
- package/lib/tree/nodes/operators/divideNode.d.ts +11 -11
- package/lib/tree/nodes/operators/divideNode.js +34 -34
- package/lib/tree/nodes/operators/equalNode.d.ts +7 -7
- package/lib/tree/nodes/operators/equalNode.js +16 -16
- package/lib/tree/nodes/operators/fractionNode.d.ts +11 -11
- package/lib/tree/nodes/operators/fractionNode.js +20 -20
- package/lib/tree/nodes/operators/multiplyNode.d.ts +7 -7
- package/lib/tree/nodes/operators/multiplyNode.js +43 -43
- package/lib/tree/nodes/operators/operatorNode.d.ts +21 -21
- package/lib/tree/nodes/operators/operatorNode.js +35 -35
- package/lib/tree/nodes/operators/powerNode.d.ts +7 -7
- package/lib/tree/nodes/operators/powerNode.js +33 -33
- package/lib/tree/nodes/operators/substractNode.d.ts +7 -7
- package/lib/tree/nodes/operators/substractNode.js +24 -24
- package/lib/tree/nodes/variables/variableNode.d.ts +8 -8
- package/lib/tree/nodes/variables/variableNode.js +19 -19
- package/lib/tree/parsers/derivateParser.js +62 -62
- package/lib/tree/parsers/latexParser.js +110 -0
- package/lib/tree/parsers/simplify.d.ts +2 -2
- package/lib/tree/parsers/simplify.js +52 -52
- package/lib/utils/arrayEqual.d.ts +1 -1
- package/lib/utils/arrayEqual.js +13 -13
- package/lib/utils/coin.js +7 -0
- package/lib/utils/coinFlip.d.ts +1 -1
- package/lib/utils/coinFlip.js +7 -7
- package/lib/utils/random.d.ts +1 -1
- package/lib/utils/random.js +7 -7
- package/lib/utils/shuffle.d.ts +1 -1
- package/lib/utils/shuffle.js +15 -15
- package/package.json +50 -50
|
@@ -1,91 +1,91 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/*import { Exercise, Question } from '../../../exercises/exercise';
|
|
3
|
-
import { getDistinctQuestions } from '../../../exercises/utils/getDistinctQuestions';
|
|
4
|
-
import { DroiteConstructor } from '../../../math/geometry/droite';
|
|
5
|
-
import { Point } from '../../../math/geometry/point';
|
|
6
|
-
import { Polynomial } from '../../../math/polynomials/polynomial';
|
|
7
|
-
import { randint } from '../../../math/utils/random/randint';
|
|
8
|
-
import { NumberNode } from '../../../tree/nodes/numbers/numberNode';
|
|
9
|
-
import { evaluate } from 'mathjs';
|
|
10
|
-
|
|
11
|
-
export const derivativeNumberReading2: Exercise = {
|
|
12
|
-
id: 'derivativeNumberReading2',
|
|
13
|
-
connector: '=',
|
|
14
|
-
instruction: '',
|
|
15
|
-
label: 'Lecture de nombre dérivé 2',
|
|
16
|
-
levels: ['3', '2', '1'],
|
|
17
|
-
isSingleStep: false,
|
|
18
|
-
section: 'Géométrie cartésienne',
|
|
19
|
-
generator: (nb: number) => getDistinctQuestions(getDerivativeNumberReading, nb),
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
export function getDerivativeNumberReading(): Question {
|
|
23
|
-
function computePolynomial(
|
|
24
|
-
x0: number,
|
|
25
|
-
y0: number,
|
|
26
|
-
m: number,
|
|
27
|
-
x1: number,
|
|
28
|
-
y1: number,
|
|
29
|
-
x2: number,
|
|
30
|
-
y2: number,
|
|
31
|
-
x3: number,
|
|
32
|
-
y3: number,
|
|
33
|
-
): [number, number, number, number] {
|
|
34
|
-
const a = (-2 * x0 * x1 * x2 + x0 * x1 * x3 + x0 * x2 * x3 + x1 * x2 * x3) / ((x0 - x1) * (x0 - x2) * (x0 - x3));
|
|
35
|
-
const b =
|
|
36
|
-
((y0 - y1) / ((x0 - x1) * (x0 - x1)) -
|
|
37
|
-
(y0 - y2) / ((x0 - x2) * (x0 - x2)) +
|
|
38
|
-
(y0 - y3) / ((x0 - x3) * (x0 - x3))) /
|
|
39
|
-
(x0 - x1);
|
|
40
|
-
const c =
|
|
41
|
-
((m - 2 * a * x0 - b) * (x0 - x1) * (x0 - x2) * (x0 - x3) -
|
|
42
|
-
(y0 - y1) / ((x0 - x1) * (x0 - x1)) +
|
|
43
|
-
a * (x1 * x1 * (x0 - x2) + x2 * x2 * (x0 - x1) - 2 * x1 * x2 * x0) +
|
|
44
|
-
b * (x1 + x2 - 2 * x0)) /
|
|
45
|
-
((x0 - x2) * (x0 - x3));
|
|
46
|
-
const d = y0 - a * x0 * x0 * x0 - b * x0 * x0 - c * x0;
|
|
47
|
-
return [a, b, c, d];
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
function generatePolynomial(
|
|
51
|
-
x0: number,
|
|
52
|
-
y0: number,
|
|
53
|
-
m: number,
|
|
54
|
-
x1: number,
|
|
55
|
-
y1: number,
|
|
56
|
-
x2: number,
|
|
57
|
-
y2: number,
|
|
58
|
-
x3: number,
|
|
59
|
-
y3: number,
|
|
60
|
-
): Polynomial {
|
|
61
|
-
const [a, b, c, d] = computePolynomial(x0, y0, m, x1, y1, x2, y2, x3, y3);
|
|
62
|
-
return new Polynomial([d, c, b, a]);
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
const [x1, y1, x2, y2, x3, y3] = [1, 2, 3, 4, 5, 6].map((el) => randint(-5, 6));
|
|
66
|
-
|
|
67
|
-
let xA: number, yA, xB, yB: number;
|
|
68
|
-
let pointA, pointB: Point;
|
|
69
|
-
do {
|
|
70
|
-
[xA, yA] = [1, 2].map((el) => randint(-5, 6));
|
|
71
|
-
xB = xA > 0 ? randint(xA - 4, 6) : randint(-4, xA + 5); // l'écart entre les deux points ne soit pas grand
|
|
72
|
-
yB = yA > 0 ? randint(yA - 4, 6) : randint(-4, yA + 5);
|
|
73
|
-
pointA = new Point('A', new NumberNode(xA), new NumberNode(yA));
|
|
74
|
-
pointB = new Point('B', new NumberNode(xB), new NumberNode(yB));
|
|
75
|
-
} while (xB - xA === 0);
|
|
76
|
-
|
|
77
|
-
const droite = DroiteConstructor.fromTwoPoints(pointA, pointB, 'D');
|
|
78
|
-
|
|
79
|
-
const polynome = generatePolynomial(xA, yA, evaluate(droite.a.toMathString()), x1, y1, x2, y2, x3, y3);
|
|
80
|
-
|
|
81
|
-
let instruction = `$f(x) = ${polynome.toTex()}$, $${pointA.toTexWithCoords()}$, $${pointB.toTexWithCoords()}$, $f'(${xA}) = ${droite.getLeadingCoefficient()}$`;
|
|
82
|
-
|
|
83
|
-
const question: Question = {
|
|
84
|
-
instruction,
|
|
85
|
-
//startStatement: pointA.toTexWithCoords() + ' ' + pointB.toTexWithCoords(),
|
|
86
|
-
answer: droite.a.toTex(),
|
|
87
|
-
};
|
|
88
|
-
|
|
89
|
-
return question;
|
|
90
|
-
}
|
|
91
|
-
*/
|
|
1
|
+
"use strict";
|
|
2
|
+
/*import { Exercise, Question } from '../../../exercises/exercise';
|
|
3
|
+
import { getDistinctQuestions } from '../../../exercises/utils/getDistinctQuestions';
|
|
4
|
+
import { DroiteConstructor } from '../../../math/geometry/droite';
|
|
5
|
+
import { Point } from '../../../math/geometry/point';
|
|
6
|
+
import { Polynomial } from '../../../math/polynomials/polynomial';
|
|
7
|
+
import { randint } from '../../../math/utils/random/randint';
|
|
8
|
+
import { NumberNode } from '../../../tree/nodes/numbers/numberNode';
|
|
9
|
+
import { evaluate } from 'mathjs';
|
|
10
|
+
|
|
11
|
+
export const derivativeNumberReading2: Exercise = {
|
|
12
|
+
id: 'derivativeNumberReading2',
|
|
13
|
+
connector: '=',
|
|
14
|
+
instruction: '',
|
|
15
|
+
label: 'Lecture de nombre dérivé 2',
|
|
16
|
+
levels: ['3', '2', '1'],
|
|
17
|
+
isSingleStep: false,
|
|
18
|
+
section: 'Géométrie cartésienne',
|
|
19
|
+
generator: (nb: number) => getDistinctQuestions(getDerivativeNumberReading, nb),
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export function getDerivativeNumberReading(): Question {
|
|
23
|
+
function computePolynomial(
|
|
24
|
+
x0: number,
|
|
25
|
+
y0: number,
|
|
26
|
+
m: number,
|
|
27
|
+
x1: number,
|
|
28
|
+
y1: number,
|
|
29
|
+
x2: number,
|
|
30
|
+
y2: number,
|
|
31
|
+
x3: number,
|
|
32
|
+
y3: number,
|
|
33
|
+
): [number, number, number, number] {
|
|
34
|
+
const a = (-2 * x0 * x1 * x2 + x0 * x1 * x3 + x0 * x2 * x3 + x1 * x2 * x3) / ((x0 - x1) * (x0 - x2) * (x0 - x3));
|
|
35
|
+
const b =
|
|
36
|
+
((y0 - y1) / ((x0 - x1) * (x0 - x1)) -
|
|
37
|
+
(y0 - y2) / ((x0 - x2) * (x0 - x2)) +
|
|
38
|
+
(y0 - y3) / ((x0 - x3) * (x0 - x3))) /
|
|
39
|
+
(x0 - x1);
|
|
40
|
+
const c =
|
|
41
|
+
((m - 2 * a * x0 - b) * (x0 - x1) * (x0 - x2) * (x0 - x3) -
|
|
42
|
+
(y0 - y1) / ((x0 - x1) * (x0 - x1)) +
|
|
43
|
+
a * (x1 * x1 * (x0 - x2) + x2 * x2 * (x0 - x1) - 2 * x1 * x2 * x0) +
|
|
44
|
+
b * (x1 + x2 - 2 * x0)) /
|
|
45
|
+
((x0 - x2) * (x0 - x3));
|
|
46
|
+
const d = y0 - a * x0 * x0 * x0 - b * x0 * x0 - c * x0;
|
|
47
|
+
return [a, b, c, d];
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
function generatePolynomial(
|
|
51
|
+
x0: number,
|
|
52
|
+
y0: number,
|
|
53
|
+
m: number,
|
|
54
|
+
x1: number,
|
|
55
|
+
y1: number,
|
|
56
|
+
x2: number,
|
|
57
|
+
y2: number,
|
|
58
|
+
x3: number,
|
|
59
|
+
y3: number,
|
|
60
|
+
): Polynomial {
|
|
61
|
+
const [a, b, c, d] = computePolynomial(x0, y0, m, x1, y1, x2, y2, x3, y3);
|
|
62
|
+
return new Polynomial([d, c, b, a]);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
const [x1, y1, x2, y2, x3, y3] = [1, 2, 3, 4, 5, 6].map((el) => randint(-5, 6));
|
|
66
|
+
|
|
67
|
+
let xA: number, yA, xB, yB: number;
|
|
68
|
+
let pointA, pointB: Point;
|
|
69
|
+
do {
|
|
70
|
+
[xA, yA] = [1, 2].map((el) => randint(-5, 6));
|
|
71
|
+
xB = xA > 0 ? randint(xA - 4, 6) : randint(-4, xA + 5); // l'écart entre les deux points ne soit pas grand
|
|
72
|
+
yB = yA > 0 ? randint(yA - 4, 6) : randint(-4, yA + 5);
|
|
73
|
+
pointA = new Point('A', new NumberNode(xA), new NumberNode(yA));
|
|
74
|
+
pointB = new Point('B', new NumberNode(xB), new NumberNode(yB));
|
|
75
|
+
} while (xB - xA === 0);
|
|
76
|
+
|
|
77
|
+
const droite = DroiteConstructor.fromTwoPoints(pointA, pointB, 'D');
|
|
78
|
+
|
|
79
|
+
const polynome = generatePolynomial(xA, yA, evaluate(droite.a.toMathString()), x1, y1, x2, y2, x3, y3);
|
|
80
|
+
|
|
81
|
+
let instruction = `$f(x) = ${polynome.toTex()}$, $${pointA.toTexWithCoords()}$, $${pointB.toTexWithCoords()}$, $f'(${xA}) = ${droite.getLeadingCoefficient()}$`;
|
|
82
|
+
|
|
83
|
+
const question: Question = {
|
|
84
|
+
instruction,
|
|
85
|
+
//startStatement: pointA.toTexWithCoords() + ' ' + pointB.toTexWithCoords(),
|
|
86
|
+
answer: droite.a.toTex(),
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
return question;
|
|
90
|
+
}
|
|
91
|
+
*/
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Exercise, Question } from '../../../exercises/exercise';
|
|
2
|
-
export declare const leadingCoefficient: Exercise;
|
|
3
|
-
export declare function getLeadingCoefficientQuestion(): Question;
|
|
1
|
+
import { Exercise, Question } from '../../../exercises/exercise';
|
|
2
|
+
export declare const leadingCoefficient: Exercise;
|
|
3
|
+
export declare function getLeadingCoefficientQuestion(): Question;
|
|
4
4
|
//# sourceMappingURL=leadingCoefficient.d.ts.map
|
|
@@ -1,60 +1,60 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getLeadingCoefficientQuestion = exports.leadingCoefficient = void 0;
|
|
4
|
-
const getDistinctQuestions_1 = require("../../../exercises/utils/getDistinctQuestions");
|
|
5
|
-
const droite_1 = require("../../../math/geometry/droite");
|
|
6
|
-
const point_1 = require("../../../math/geometry/point");
|
|
7
|
-
const randint_1 = require("../../../math/utils/random/randint");
|
|
8
|
-
const numberNode_1 = require("../../../tree/nodes/numbers/numberNode");
|
|
9
|
-
const mathjs_1 = require("mathjs");
|
|
10
|
-
exports.leadingCoefficient = {
|
|
11
|
-
id: 'leadingCoefficient',
|
|
12
|
-
connector: '=',
|
|
13
|
-
instruction: 'Déterminer le coefficient directeur de la droite représentée ci-dessous :',
|
|
14
|
-
label: 'Déterminer le coefficient directeur',
|
|
15
|
-
levels: ['3', '2', '1'],
|
|
16
|
-
isSingleStep: false,
|
|
17
|
-
section: 'Géométrie cartésienne',
|
|
18
|
-
generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getLeadingCoefficientQuestion, nb),
|
|
19
|
-
};
|
|
20
|
-
function getLeadingCoefficientQuestion() {
|
|
21
|
-
let xA, yA, xB, yB;
|
|
22
|
-
let pointA, pointB;
|
|
23
|
-
do {
|
|
24
|
-
[xA, yA] = [1, 2].map((el) => (0, randint_1.randint)(-5, 6));
|
|
25
|
-
xB = xA > 0 ? (0, randint_1.randint)(xA - 4, 6) : (0, randint_1.randint)(-4, xA + 5); // l'écart entre les deux points ne soit pas grand
|
|
26
|
-
yB = yA > 0 ? (0, randint_1.randint)(yA - 4, 6) : (0, randint_1.randint)(-4, yA + 5);
|
|
27
|
-
pointA = new point_1.Point('A', new numberNode_1.NumberNode(xA), new numberNode_1.NumberNode(yA));
|
|
28
|
-
pointB = new point_1.Point('B', new numberNode_1.NumberNode(xB), new numberNode_1.NumberNode(yB));
|
|
29
|
-
} while (xB - xA === 0);
|
|
30
|
-
const droite = droite_1.DroiteConstructor.fromTwoPoints(pointA, pointB, 'D');
|
|
31
|
-
const a = droite.a.toMathString();
|
|
32
|
-
const b = droite.b.toMathString();
|
|
33
|
-
const aValue = (0, mathjs_1.evaluate)(a);
|
|
34
|
-
const bValue = (0, mathjs_1.evaluate)(b);
|
|
35
|
-
let xmin, xmax, ymin, ymax;
|
|
36
|
-
if (bValue > 0) {
|
|
37
|
-
ymax = bValue + 1;
|
|
38
|
-
ymin = -1;
|
|
39
|
-
}
|
|
40
|
-
else {
|
|
41
|
-
ymin = bValue - 1;
|
|
42
|
-
ymax = 1;
|
|
43
|
-
}
|
|
44
|
-
if (-bValue / aValue > 0) {
|
|
45
|
-
xmax = -bValue / aValue + 1;
|
|
46
|
-
xmin = -1;
|
|
47
|
-
}
|
|
48
|
-
else {
|
|
49
|
-
xmin = -bValue / aValue - 1;
|
|
50
|
-
xmax = 1;
|
|
51
|
-
}
|
|
52
|
-
const question = {
|
|
53
|
-
answer: droite.getLeadingCoefficient(),
|
|
54
|
-
keys: [],
|
|
55
|
-
commands: [`f(x) = (${a}) * x + (${b})`],
|
|
56
|
-
coords: [xmin, xmax, ymin, ymax],
|
|
57
|
-
};
|
|
58
|
-
return question;
|
|
59
|
-
}
|
|
60
|
-
exports.getLeadingCoefficientQuestion = getLeadingCoefficientQuestion;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getLeadingCoefficientQuestion = exports.leadingCoefficient = void 0;
|
|
4
|
+
const getDistinctQuestions_1 = require("../../../exercises/utils/getDistinctQuestions");
|
|
5
|
+
const droite_1 = require("../../../math/geometry/droite");
|
|
6
|
+
const point_1 = require("../../../math/geometry/point");
|
|
7
|
+
const randint_1 = require("../../../math/utils/random/randint");
|
|
8
|
+
const numberNode_1 = require("../../../tree/nodes/numbers/numberNode");
|
|
9
|
+
const mathjs_1 = require("mathjs");
|
|
10
|
+
exports.leadingCoefficient = {
|
|
11
|
+
id: 'leadingCoefficient',
|
|
12
|
+
connector: '=',
|
|
13
|
+
instruction: 'Déterminer le coefficient directeur de la droite représentée ci-dessous :',
|
|
14
|
+
label: 'Déterminer le coefficient directeur',
|
|
15
|
+
levels: ['3', '2', '1'],
|
|
16
|
+
isSingleStep: false,
|
|
17
|
+
section: 'Géométrie cartésienne',
|
|
18
|
+
generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getLeadingCoefficientQuestion, nb),
|
|
19
|
+
};
|
|
20
|
+
function getLeadingCoefficientQuestion() {
|
|
21
|
+
let xA, yA, xB, yB;
|
|
22
|
+
let pointA, pointB;
|
|
23
|
+
do {
|
|
24
|
+
[xA, yA] = [1, 2].map((el) => (0, randint_1.randint)(-5, 6));
|
|
25
|
+
xB = xA > 0 ? (0, randint_1.randint)(xA - 4, 6) : (0, randint_1.randint)(-4, xA + 5); // l'écart entre les deux points ne soit pas grand
|
|
26
|
+
yB = yA > 0 ? (0, randint_1.randint)(yA - 4, 6) : (0, randint_1.randint)(-4, yA + 5);
|
|
27
|
+
pointA = new point_1.Point('A', new numberNode_1.NumberNode(xA), new numberNode_1.NumberNode(yA));
|
|
28
|
+
pointB = new point_1.Point('B', new numberNode_1.NumberNode(xB), new numberNode_1.NumberNode(yB));
|
|
29
|
+
} while (xB - xA === 0);
|
|
30
|
+
const droite = droite_1.DroiteConstructor.fromTwoPoints(pointA, pointB, 'D');
|
|
31
|
+
const a = droite.a.toMathString();
|
|
32
|
+
const b = droite.b.toMathString();
|
|
33
|
+
const aValue = (0, mathjs_1.evaluate)(a);
|
|
34
|
+
const bValue = (0, mathjs_1.evaluate)(b);
|
|
35
|
+
let xmin, xmax, ymin, ymax;
|
|
36
|
+
if (bValue > 0) {
|
|
37
|
+
ymax = bValue + 1;
|
|
38
|
+
ymin = -1;
|
|
39
|
+
}
|
|
40
|
+
else {
|
|
41
|
+
ymin = bValue - 1;
|
|
42
|
+
ymax = 1;
|
|
43
|
+
}
|
|
44
|
+
if (-bValue / aValue > 0) {
|
|
45
|
+
xmax = -bValue / aValue + 1;
|
|
46
|
+
xmin = -1;
|
|
47
|
+
}
|
|
48
|
+
else {
|
|
49
|
+
xmin = -bValue / aValue - 1;
|
|
50
|
+
xmax = 1;
|
|
51
|
+
}
|
|
52
|
+
const question = {
|
|
53
|
+
answer: droite.getLeadingCoefficient(),
|
|
54
|
+
keys: [],
|
|
55
|
+
commands: [`f(x) = (${a}) * x + (${b})`],
|
|
56
|
+
coords: [xmin, xmax, ymin, ymax],
|
|
57
|
+
};
|
|
58
|
+
return question;
|
|
59
|
+
}
|
|
60
|
+
exports.getLeadingCoefficientQuestion = getLeadingCoefficientQuestion;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"leadingCoefficientCalculV1.d.ts","sourceRoot":"","sources":["../../../../src/exercises/geometry/cartesian/leadingCoefficientCalculV1.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAO9D,eAAO,MAAM,0BAA0B,EAAE,QASxC,CAAC;AAEF,wBAAgB,qCAAqC,IAAI,QAAQ,CAWhE"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getLeadingCoefficientCalculV1Question = exports.leadingCoefficientCalculV1 = void 0;
|
|
4
|
+
const getDistinctQuestions_1 = require("../../../exercises/utils/getDistinctQuestions");
|
|
5
|
+
const randint_1 = require("../../../math/utils/random/randint");
|
|
6
|
+
const numberNode_1 = require("../../../tree/nodes/numbers/numberNode");
|
|
7
|
+
const fractionNode_1 = require("../../../tree/nodes/operators/fractionNode");
|
|
8
|
+
const simplify_1 = require("../../../tree/parsers/simplify");
|
|
9
|
+
exports.leadingCoefficientCalculV1 = {
|
|
10
|
+
id: 'leadingCoefficientCalculV1',
|
|
11
|
+
connector: '=',
|
|
12
|
+
instruction: '',
|
|
13
|
+
label: "Calculer le coefficient directeur d'une fonction affine",
|
|
14
|
+
levels: ['3', '2', '1'],
|
|
15
|
+
isSingleStep: true,
|
|
16
|
+
section: 'Fonctions affines',
|
|
17
|
+
generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getLeadingCoefficientCalculV1Question, nb),
|
|
18
|
+
};
|
|
19
|
+
function getLeadingCoefficientCalculV1Question() {
|
|
20
|
+
const [xA, yA] = [1, 2].map((el) => (0, randint_1.randint)(-9, 10));
|
|
21
|
+
const xB = (0, randint_1.randint)(-9, 10, [xA]);
|
|
22
|
+
const yB = (0, randint_1.randint)(-9, 10);
|
|
23
|
+
const question = {
|
|
24
|
+
instruction: `Soit $f$ une fonction affine telle que $f(${xA})$ = $${yA}$ et $f(${xB})$ = $${yB}$.$\\\\$Quel est le coefficient directeur de $f$ ?`,
|
|
25
|
+
startStatement: 'a',
|
|
26
|
+
answer: (0, simplify_1.simplifyNode)(new fractionNode_1.FractionNode(new numberNode_1.NumberNode(yB - yA), new numberNode_1.NumberNode(xB - xA))).toTex(),
|
|
27
|
+
};
|
|
28
|
+
return question;
|
|
29
|
+
}
|
|
30
|
+
exports.getLeadingCoefficientCalculV1Question = getLeadingCoefficientCalculV1Question;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"leadingCoefficientCalculV2.d.ts","sourceRoot":"","sources":["../../../../src/exercises/geometry/cartesian/leadingCoefficientCalculV2.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAO9D,eAAO,MAAM,0BAA0B,EAAE,QASxC,CAAC;AAEF,wBAAgB,qCAAqC,IAAI,QAAQ,CAUhE"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getLeadingCoefficientCalculV1Question = exports.leadingCoefficientCalculV2 = void 0;
|
|
4
|
+
const getDistinctQuestions_1 = require("../../../exercises/utils/getDistinctQuestions");
|
|
5
|
+
const randint_1 = require("../../../math/utils/random/randint");
|
|
6
|
+
const numberNode_1 = require("../../../tree/nodes/numbers/numberNode");
|
|
7
|
+
const fractionNode_1 = require("../../../tree/nodes/operators/fractionNode");
|
|
8
|
+
const simplify_1 = require("../../../tree/parsers/simplify");
|
|
9
|
+
exports.leadingCoefficientCalculV2 = {
|
|
10
|
+
id: 'leadingCoefficientCalculV2',
|
|
11
|
+
connector: '=',
|
|
12
|
+
instruction: '',
|
|
13
|
+
label: "Coefficient directeur à l'aide de deux points",
|
|
14
|
+
levels: ['3', '2', '1'],
|
|
15
|
+
isSingleStep: false,
|
|
16
|
+
section: 'Droites',
|
|
17
|
+
generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getLeadingCoefficientCalculV1Question, nb),
|
|
18
|
+
};
|
|
19
|
+
function getLeadingCoefficientCalculV1Question() {
|
|
20
|
+
const [xA, yA] = [1, 2].map((el) => (0, randint_1.randint)(-9, 10));
|
|
21
|
+
const xB = (0, randint_1.randint)(-9, 10, [xA]);
|
|
22
|
+
const yB = (0, randint_1.randint)(-9, 10);
|
|
23
|
+
const question = {
|
|
24
|
+
instruction: `Soit $d$ une droite passant par les points A(${xA},${yA}) et B(${xB},${yB}).$\\\\$Déterminer le coefficient directeur de $d$.`,
|
|
25
|
+
answer: (0, simplify_1.simplifyNode)(new fractionNode_1.FractionNode(new numberNode_1.NumberNode(yB - yA), new numberNode_1.NumberNode(xB - xA))).toTex(),
|
|
26
|
+
};
|
|
27
|
+
return question;
|
|
28
|
+
}
|
|
29
|
+
exports.getLeadingCoefficientCalculV1Question = getLeadingCoefficientCalculV1Question;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Exercise, Question } from '../../../exercises/exercise';
|
|
2
|
-
export declare const midpoint: Exercise;
|
|
3
|
-
export declare function getMidpointQuestion(): Question;
|
|
1
|
+
import { Exercise, Question } from '../../../exercises/exercise';
|
|
2
|
+
export declare const midpoint: Exercise;
|
|
3
|
+
export declare function getMidpointQuestion(): Question;
|
|
4
4
|
//# sourceMappingURL=midpoint.d.ts.map
|
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getMidpointQuestion = exports.midpoint = void 0;
|
|
4
|
-
const getDistinctQuestions_1 = require("../../../exercises/utils/getDistinctQuestions");
|
|
5
|
-
const point_1 = require("../../../math/geometry/point");
|
|
6
|
-
const randTupleInt_1 = require("../../../math/utils/random/randTupleInt");
|
|
7
|
-
const numberNode_1 = require("../../../tree/nodes/numbers/numberNode");
|
|
8
|
-
exports.midpoint = {
|
|
9
|
-
id: 'midpoint',
|
|
10
|
-
connector: '=',
|
|
11
|
-
instruction: '',
|
|
12
|
-
label: 'Coordonnées du milieu',
|
|
13
|
-
levels: ['3', '2', '1'],
|
|
14
|
-
isSingleStep: false,
|
|
15
|
-
section: 'Géométrie cartésienne',
|
|
16
|
-
generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getMidpointQuestion, nb),
|
|
17
|
-
keys: ['semicolon'],
|
|
18
|
-
};
|
|
19
|
-
function getMidpointQuestion() {
|
|
20
|
-
const [coords1, coords2] = (0, randTupleInt_1.distinctRandTupleInt)(2, 2, { from: -9, to: 10 });
|
|
21
|
-
const A = new point_1.Point('A', new numberNode_1.NumberNode(coords1[0]), new numberNode_1.NumberNode(coords1[1]));
|
|
22
|
-
const B = new point_1.Point('B', new numberNode_1.NumberNode(coords2[0]), new numberNode_1.NumberNode(coords2[1]));
|
|
23
|
-
const question = {
|
|
24
|
-
instruction: `Soit $${A.toTexWithCoords()}$ et $${B.toTexWithCoords()}$. Quelles sont les coordonnées du milieu $I$ de $[AB]$ ?`,
|
|
25
|
-
startStatement: 'I',
|
|
26
|
-
answer: A.midpoint(B).toTexWithCoords(),
|
|
27
|
-
keys: ['semicolon'],
|
|
28
|
-
};
|
|
29
|
-
return question;
|
|
30
|
-
}
|
|
31
|
-
exports.getMidpointQuestion = getMidpointQuestion;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getMidpointQuestion = exports.midpoint = void 0;
|
|
4
|
+
const getDistinctQuestions_1 = require("../../../exercises/utils/getDistinctQuestions");
|
|
5
|
+
const point_1 = require("../../../math/geometry/point");
|
|
6
|
+
const randTupleInt_1 = require("../../../math/utils/random/randTupleInt");
|
|
7
|
+
const numberNode_1 = require("../../../tree/nodes/numbers/numberNode");
|
|
8
|
+
exports.midpoint = {
|
|
9
|
+
id: 'midpoint',
|
|
10
|
+
connector: '=',
|
|
11
|
+
instruction: '',
|
|
12
|
+
label: 'Coordonnées du milieu',
|
|
13
|
+
levels: ['3', '2', '1'],
|
|
14
|
+
isSingleStep: false,
|
|
15
|
+
section: 'Géométrie cartésienne',
|
|
16
|
+
generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getMidpointQuestion, nb),
|
|
17
|
+
keys: ['semicolon'],
|
|
18
|
+
};
|
|
19
|
+
function getMidpointQuestion() {
|
|
20
|
+
const [coords1, coords2] = (0, randTupleInt_1.distinctRandTupleInt)(2, 2, { from: -9, to: 10 });
|
|
21
|
+
const A = new point_1.Point('A', new numberNode_1.NumberNode(coords1[0]), new numberNode_1.NumberNode(coords1[1]));
|
|
22
|
+
const B = new point_1.Point('B', new numberNode_1.NumberNode(coords2[0]), new numberNode_1.NumberNode(coords2[1]));
|
|
23
|
+
const question = {
|
|
24
|
+
instruction: `Soit $${A.toTexWithCoords()}$ et $${B.toTexWithCoords()}$. Quelles sont les coordonnées du milieu $I$ de $[AB]$ ?`,
|
|
25
|
+
startStatement: 'I',
|
|
26
|
+
answer: A.midpoint(B).toTexWithCoords(),
|
|
27
|
+
keys: ['semicolon'],
|
|
28
|
+
};
|
|
29
|
+
return question;
|
|
30
|
+
}
|
|
31
|
+
exports.getMidpointQuestion = getMidpointQuestion;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TriangleArea.d.ts","sourceRoot":"","sources":["../../../../src/exercises/geometry/euclidean/TriangleArea.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAM9D,eAAO,MAAM,YAAY,EAAE,QAS1B,CAAC;AAEF,wBAAgB,eAAe,IAAI,QAAQ,CA4C1C"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getTriangleArea = exports.triangleArea = void 0;
|
|
4
|
+
const getDistinctQuestions_1 = require("../../../exercises/utils/getDistinctQuestions");
|
|
5
|
+
const triangles_1 = require("../../../math/geometry/triangles");
|
|
6
|
+
const randint_1 = require("../../../math/utils/random/randint");
|
|
7
|
+
const shuffle_1 = require("../../../utils/shuffle");
|
|
8
|
+
exports.triangleArea = {
|
|
9
|
+
id: 'triangleArea',
|
|
10
|
+
connector: '=',
|
|
11
|
+
instruction: '',
|
|
12
|
+
label: "Calculer l'aire d'un triangle",
|
|
13
|
+
levels: ['4', '3', '2'],
|
|
14
|
+
isSingleStep: false,
|
|
15
|
+
section: 'Géométrie euclidienne',
|
|
16
|
+
generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getTriangleArea, nb),
|
|
17
|
+
};
|
|
18
|
+
function getTriangleArea() {
|
|
19
|
+
const vertices = [];
|
|
20
|
+
const code = 65 + (0, randint_1.randint)(0, 24); // Générer un code de caractère majuscule aléatoire (A-Z)
|
|
21
|
+
for (let i = 0; i < 3; i++)
|
|
22
|
+
vertices.push(String.fromCharCode(code + i));
|
|
23
|
+
const triangle = triangles_1.TriangleConstructor.createRandomTriangle({ minAngle: 0.69, maxAngle: 1.5, names: vertices });
|
|
24
|
+
const sides = [triangle.getSideAName(), triangle.getSideBName(), triangle.getSideCName()];
|
|
25
|
+
const sidesLength = [triangle.getSideAnumber(), triangle.getSideBnumber(), triangle.getSideCnumber()].map((el) => Math.round(el / 2));
|
|
26
|
+
const angles = [triangle.getAngleA(), triangle.getAngleB(), triangle.getAngleC()];
|
|
27
|
+
const randoms = (0, shuffle_1.shuffle)([0, 1, 2]);
|
|
28
|
+
const height = Math.round(sidesLength[randoms[1]] * Math.sin(angles[randoms[2]]));
|
|
29
|
+
const commands = [
|
|
30
|
+
...triangle.generateCommands({
|
|
31
|
+
showLabels: [sides[randoms[0]]],
|
|
32
|
+
setCaptions: [sidesLength[randoms[0]] + ''],
|
|
33
|
+
}),
|
|
34
|
+
`poi = Intersect(PerpendicularLine(${vertices[randoms[0]]},${sides[randoms[0]]}),${sides[randoms[0]]})`,
|
|
35
|
+
`ShowLabel(poi, true)`,
|
|
36
|
+
`SetCaption(poi, "${String.fromCharCode(code + 3)}")`,
|
|
37
|
+
`seg = Segment(${vertices[randoms[0]]}, poi)`,
|
|
38
|
+
`ShowLabel(seg, true)`,
|
|
39
|
+
`SetCaption(seg, "${height}")`,
|
|
40
|
+
`SetLineStyle(seg, 1)`,
|
|
41
|
+
`alpha = Angle(${vertices[randoms[0]]},poi ,${vertices[randoms[1]]}, Line(${vertices[randoms[0]]},poi))`,
|
|
42
|
+
`ShowLabel(alpha, false)`,
|
|
43
|
+
];
|
|
44
|
+
const question = {
|
|
45
|
+
instruction: `Calculer l'aire du triangle ${triangle.getTriangleName()} sachant que ${sides[randoms[0]]} = $${sidesLength[randoms[0]]}$ cm et la hauteur ${vertices[randoms[0]]}${String.fromCharCode(code + 3)} = $${height}$ cm.`,
|
|
46
|
+
answer: (sidesLength[randoms[0]] * height) / 2 + '',
|
|
47
|
+
keys: [...vertices, 'equal', 'cm2'],
|
|
48
|
+
commands,
|
|
49
|
+
coords: triangle.generateCoords(),
|
|
50
|
+
};
|
|
51
|
+
return question;
|
|
52
|
+
}
|
|
53
|
+
exports.getTriangleArea = getTriangleArea;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pythagore.d.ts","sourceRoot":"","sources":["../../../../src/exercises/geometry/euclidean/pythagore.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAK9D,eAAO,MAAM,SAAS,EAAE,QASvB,CAAC;AAEF,wBAAgB,YAAY,IAAI,QAAQ,CAevC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getPythagore = exports.pythagore = void 0;
|
|
4
|
+
const getDistinctQuestions_1 = require("../../../exercises/utils/getDistinctQuestions");
|
|
5
|
+
const triangles_1 = require("../../../math/geometry/triangles");
|
|
6
|
+
const randint_1 = require("../../../math/utils/random/randint");
|
|
7
|
+
exports.pythagore = {
|
|
8
|
+
id: 'pythagore',
|
|
9
|
+
connector: '=',
|
|
10
|
+
instruction: "Écrire l'égalité de Pythagore pour la figure suivante : ",
|
|
11
|
+
label: "Ecrire l'égalité de Pythagore",
|
|
12
|
+
levels: ['4', '3', '2'],
|
|
13
|
+
isSingleStep: false,
|
|
14
|
+
section: 'Géométrie euclidienne',
|
|
15
|
+
generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getPythagore, nb),
|
|
16
|
+
};
|
|
17
|
+
function getPythagore() {
|
|
18
|
+
const vertices = [];
|
|
19
|
+
const code = 65 + (0, randint_1.randint)(0, 24); // Générer un code de caractère majuscule aléatoire (A-Z)
|
|
20
|
+
for (let i = 0; i < 3; i++)
|
|
21
|
+
vertices.push(String.fromCharCode(code + i));
|
|
22
|
+
const triangle = triangles_1.TriangleConstructor.createRandomRightTriangle({ minRapport: 0.7, maxRapport: 1.3, names: vertices });
|
|
23
|
+
const question = {
|
|
24
|
+
answer: `${triangle.getSideAName()}^2 = ${triangle.getSideBName()}^2 + ${triangle.getSideCName()}^2`,
|
|
25
|
+
keys: [...vertices, 'equal'],
|
|
26
|
+
commands: triangle.generateCommands({}),
|
|
27
|
+
coords: triangle.generateCoords(),
|
|
28
|
+
};
|
|
29
|
+
return question;
|
|
30
|
+
}
|
|
31
|
+
exports.getPythagore = getPythagore;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pythagoreCalcul.d.ts","sourceRoot":"","sources":["../../../../src/exercises/geometry/euclidean/pythagoreCalcul.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAO9D,eAAO,MAAM,eAAe,EAAE,QAS7B,CAAC;AAEF,wBAAgB,kBAAkB,IAAI,QAAQ,CAoD7C"}
|