math-exercises 3.0.213 → 3.0.215
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/exercises/math/arithmetic/findLeftInHugeNumberDivision.d.ts +9 -0
- package/lib/exercises/math/arithmetic/findLeftInHugeNumberDivision.d.ts.map +1 -0
- package/lib/exercises/math/arithmetic/findLeftInHugeNumberDivision.js +194 -0
- package/lib/exercises/math/arithmetic/findMissingNumberToMakeNumberDivisibleBy9.d.ts +8 -0
- package/lib/exercises/math/arithmetic/findMissingNumberToMakeNumberDivisibleBy9.d.ts.map +1 -0
- package/lib/exercises/math/arithmetic/findMissingNumberToMakeNumberDivisibleBy9.js +121 -0
- package/lib/exercises/math/arithmetic/hasDiophantianEquationSolution.js +4 -4
- package/lib/exercises/math/arithmetic/index.d.ts +7 -0
- package/lib/exercises/math/arithmetic/index.d.ts.map +1 -1
- package/lib/exercises/math/arithmetic/index.js +7 -0
- package/lib/exercises/math/arithmetic/isBigNumberPrime.d.ts +7 -0
- package/lib/exercises/math/arithmetic/isBigNumberPrime.d.ts.map +1 -0
- package/lib/exercises/math/arithmetic/isBigNumberPrime.js +107 -0
- package/lib/exercises/math/arithmetic/numberOfEndingZerosOfBigProduct.d.ts +8 -0
- package/lib/exercises/math/arithmetic/numberOfEndingZerosOfBigProduct.d.ts.map +1 -0
- package/lib/exercises/math/arithmetic/numberOfEndingZerosOfBigProduct.js +139 -0
- package/lib/exercises/math/arithmetic/pgcdFromEuclid.d.ts +8 -0
- package/lib/exercises/math/arithmetic/pgcdFromEuclid.d.ts.map +1 -0
- package/lib/exercises/math/arithmetic/pgcdFromEuclid.js +123 -0
- package/lib/exercises/math/arithmetic/solveDiophantianEquationByUsingPrimality.d.ts +7 -0
- package/lib/exercises/math/arithmetic/solveDiophantianEquationByUsingPrimality.d.ts.map +1 -0
- package/lib/exercises/math/arithmetic/solveDiophantianEquationByUsingPrimality.js +117 -0
- package/lib/exercises/math/arithmetic/whichDayInXDays.d.ts +8 -0
- package/lib/exercises/math/arithmetic/whichDayInXDays.d.ts.map +1 -0
- package/lib/exercises/math/arithmetic/whichDayInXDays.js +81 -0
- package/lib/exercises/math/calcul/fractions/fractionsSumFillInTheBlank.d.ts +15 -0
- package/lib/exercises/math/calcul/fractions/fractionsSumFillInTheBlank.d.ts.map +1 -0
- package/lib/exercises/math/calcul/fractions/fractionsSumFillInTheBlank.js +256 -0
- package/lib/exercises/math/calcul/fractions/index.d.ts +1 -0
- package/lib/exercises/math/calcul/fractions/index.d.ts.map +1 -1
- package/lib/exercises/math/calcul/fractions/index.js +1 -0
- package/lib/exercises/math/calcul/index.d.ts +1 -0
- package/lib/exercises/math/calcul/index.d.ts.map +1 -1
- package/lib/exercises/math/calcul/index.js +1 -0
- package/lib/exercises/math/calcul/mentalCaluls/index.d.ts +3 -0
- package/lib/exercises/math/calcul/mentalCaluls/index.d.ts.map +1 -1
- package/lib/exercises/math/calcul/mentalCaluls/index.js +3 -0
- package/lib/exercises/math/calcul/mentalCaluls/mentalMultiplication101AndFriends.d.ts +10 -0
- package/lib/exercises/math/calcul/mentalCaluls/mentalMultiplication101AndFriends.d.ts.map +1 -0
- package/lib/exercises/math/calcul/mentalCaluls/mentalMultiplication101AndFriends.js +264 -0
- package/lib/exercises/math/calcul/mentalCaluls/mentalMultiplication11AndFriends.d.ts +10 -0
- package/lib/exercises/math/calcul/mentalCaluls/mentalMultiplication11AndFriends.d.ts.map +1 -0
- package/lib/exercises/math/calcul/mentalCaluls/mentalMultiplication11AndFriends.js +264 -0
- package/lib/exercises/math/calcul/mentalCaluls/mentalMultiplicationTable.d.ts +11 -0
- package/lib/exercises/math/calcul/mentalCaluls/mentalMultiplicationTable.d.ts.map +1 -0
- package/lib/exercises/math/calcul/mentalCaluls/mentalMultiplicationTable.js +141 -0
- package/lib/exercises/math/calcul/ratio/index.d.ts +1 -0
- package/lib/exercises/math/calcul/ratio/index.d.ts.map +1 -1
- package/lib/exercises/math/calcul/ratio/index.js +1 -0
- package/lib/exercises/math/calcul/ratio/partsUsingRatio.d.ts +13 -0
- package/lib/exercises/math/calcul/ratio/partsUsingRatio.d.ts.map +1 -0
- package/lib/exercises/math/calcul/ratio/partsUsingRatio.js +237 -0
- package/lib/exercises/math/calcul/relatives/index.d.ts +2 -0
- package/lib/exercises/math/calcul/relatives/index.d.ts.map +1 -0
- package/lib/exercises/math/calcul/relatives/index.js +1 -0
- package/lib/exercises/math/calcul/relatives/relativesAddAndSub.d.ts +17 -0
- package/lib/exercises/math/calcul/relatives/relativesAddAndSub.d.ts.map +1 -0
- package/lib/exercises/math/calcul/relatives/relativesAddAndSub.js +448 -0
- package/lib/exercises/math/calculLitteral/factorisation/factoByXK.d.ts +10 -0
- package/lib/exercises/math/calculLitteral/factorisation/factoByXK.d.ts.map +1 -0
- package/lib/exercises/math/calculLitteral/factorisation/factoByXK.js +190 -0
- package/lib/exercises/math/calculLitteral/factorisation/index.d.ts +1 -0
- package/lib/exercises/math/calculLitteral/factorisation/index.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/factorisation/index.js +1 -0
- package/lib/exercises/math/complex/algebraic/addComplex.d.ts +10 -0
- package/lib/exercises/math/complex/algebraic/addComplex.d.ts.map +1 -0
- package/lib/exercises/math/complex/algebraic/addComplex.js +125 -0
- package/lib/exercises/math/complex/algebraic/conjugateComplex.d.ts +8 -0
- package/lib/exercises/math/complex/algebraic/conjugateComplex.d.ts.map +1 -0
- package/lib/exercises/math/complex/algebraic/conjugateComplex.js +105 -0
- package/lib/exercises/math/complex/algebraic/conjugateDivideComplex.d.ts +8 -0
- package/lib/exercises/math/complex/algebraic/conjugateDivideComplex.d.ts.map +1 -0
- package/lib/exercises/math/complex/algebraic/conjugateDivideComplex.js +137 -0
- package/lib/exercises/math/complex/algebraic/conjugateMultiplyComplex.d.ts +8 -0
- package/lib/exercises/math/complex/algebraic/conjugateMultiplyComplex.d.ts.map +1 -0
- package/lib/exercises/math/complex/algebraic/conjugateMultiplyComplex.js +116 -0
- package/lib/exercises/math/complex/algebraic/divideComplex.d.ts +8 -0
- package/lib/exercises/math/complex/algebraic/divideComplex.d.ts.map +1 -0
- package/lib/exercises/math/complex/algebraic/divideComplex.js +128 -0
- package/lib/exercises/math/complex/algebraic/index.d.ts +11 -0
- package/lib/exercises/math/complex/algebraic/index.d.ts.map +1 -0
- package/lib/exercises/math/complex/algebraic/index.js +10 -0
- package/lib/exercises/math/complex/algebraic/inverseComplex.d.ts +8 -0
- package/lib/exercises/math/complex/algebraic/inverseComplex.d.ts.map +1 -0
- package/lib/exercises/math/complex/algebraic/inverseComplex.js +95 -0
- package/lib/exercises/math/complex/algebraic/linearCombinaisonComplex.d.ts +10 -0
- package/lib/exercises/math/complex/algebraic/linearCombinaisonComplex.d.ts.map +1 -0
- package/lib/exercises/math/complex/algebraic/linearCombinaisonComplex.js +105 -0
- package/lib/exercises/math/complex/algebraic/moduloFromAlgebraicComplex.d.ts +8 -0
- package/lib/exercises/math/complex/algebraic/moduloFromAlgebraicComplex.d.ts.map +1 -0
- package/lib/exercises/math/complex/algebraic/moduloFromAlgebraicComplex.js +93 -0
- package/lib/exercises/math/complex/algebraic/mutiplyComplex.d.ts +8 -0
- package/lib/exercises/math/complex/algebraic/mutiplyComplex.d.ts.map +1 -0
- package/lib/exercises/math/complex/algebraic/mutiplyComplex.js +106 -0
- package/lib/exercises/math/complex/algebraic/reAndIm.d.ts +9 -0
- package/lib/exercises/math/complex/algebraic/reAndIm.d.ts.map +1 -0
- package/lib/exercises/math/complex/algebraic/reAndIm.js +92 -0
- package/lib/exercises/math/complex/geometric/complexAlgebraicFromModuloAndArg.d.ts +9 -0
- package/lib/exercises/math/complex/geometric/complexAlgebraicFromModuloAndArg.d.ts.map +1 -0
- package/lib/exercises/math/complex/geometric/complexAlgebraicFromModuloAndArg.js +151 -0
- package/lib/exercises/math/complex/geometric/complexDistance.d.ts +11 -0
- package/lib/exercises/math/complex/geometric/complexDistance.d.ts.map +1 -0
- package/lib/exercises/math/complex/geometric/complexDistance.js +125 -0
- package/lib/exercises/math/complex/geometric/complexGeomAffixAlgFromPoint.d.ts +9 -0
- package/lib/exercises/math/complex/geometric/complexGeomAffixAlgFromPoint.d.ts.map +1 -0
- package/lib/exercises/math/complex/geometric/complexGeomAffixAlgFromPoint.js +326 -0
- package/lib/exercises/math/complex/geometric/complexGeomAffixExpFromCenteredRegularPolygon.d.ts +10 -0
- package/lib/exercises/math/complex/geometric/complexGeomAffixExpFromCenteredRegularPolygon.d.ts.map +1 -0
- package/lib/exercises/math/complex/geometric/complexGeomAffixExpFromCenteredRegularPolygon.js +459 -0
- package/lib/exercises/math/complex/geometric/complexGeomAffixExpFromPoint.d.ts +14 -0
- package/lib/exercises/math/complex/geometric/complexGeomAffixExpFromPoint.d.ts.map +1 -0
- package/lib/exercises/math/complex/geometric/complexGeomAffixExpFromPoint.js +539 -0
- package/lib/exercises/math/complex/geometric/complexGeomAffixTrigFromPoint.d.ts +13 -0
- package/lib/exercises/math/complex/geometric/complexGeomAffixTrigFromPoint.d.ts.map +1 -0
- package/lib/exercises/math/complex/geometric/complexGeomAffixTrigFromPoint.js +485 -0
- package/lib/exercises/math/complex/geometric/complexGeomApproxOfCosArgOrSinArgFromPointAndAffixTrig.d.ts +12 -0
- package/lib/exercises/math/complex/geometric/complexGeomApproxOfCosArgOrSinArgFromPointAndAffixTrig.d.ts.map +1 -0
- package/lib/exercises/math/complex/geometric/complexGeomApproxOfCosArgOrSinArgFromPointAndAffixTrig.js +224 -0
- package/lib/exercises/math/complex/geometric/complexGeomArgumentOfFracCBABFromFigure.d.ts +11 -0
- package/lib/exercises/math/complex/geometric/complexGeomArgumentOfFracCBABFromFigure.d.ts.map +1 -0
- package/lib/exercises/math/complex/geometric/complexGeomArgumentOfFracCBABFromFigure.js +448 -0
- package/lib/exercises/math/complex/geometric/complexGeomFindPointFromAffixExp.d.ts +11 -0
- package/lib/exercises/math/complex/geometric/complexGeomFindPointFromAffixExp.d.ts.map +1 -0
- package/lib/exercises/math/complex/geometric/complexGeomFindPointFromAffixExp.js +223 -0
- package/lib/exercises/math/complex/geometric/complexGeomFindPointFromPowerOfUnitRootFromFigure.d.ts +11 -0
- package/lib/exercises/math/complex/geometric/complexGeomFindPointFromPowerOfUnitRootFromFigure.d.ts.map +1 -0
- package/lib/exercises/math/complex/geometric/complexGeomFindPointFromPowerOfUnitRootFromFigure.js +348 -0
- package/lib/exercises/math/complex/geometric/complexGeomPlaceAffixPoint.d.ts +8 -0
- package/lib/exercises/math/complex/geometric/complexGeomPlaceAffixPoint.d.ts.map +1 -0
- package/lib/exercises/math/complex/geometric/complexGeomPlaceAffixPoint.js +86 -0
- package/lib/exercises/math/complex/geometric/complexGeomPlacePointFromZAPlusZ.d.ts +11 -0
- package/lib/exercises/math/complex/geometric/complexGeomPlacePointFromZAPlusZ.d.ts.map +1 -0
- package/lib/exercises/math/complex/geometric/complexGeomPlacePointFromZAPlusZ.js +311 -0
- package/lib/exercises/math/complex/geometric/complexGeomPlacePointFromZATimesZ.d.ts +11 -0
- package/lib/exercises/math/complex/geometric/complexGeomPlacePointFromZATimesZ.d.ts.map +1 -0
- package/lib/exercises/math/complex/geometric/complexGeomPlacePointFromZATimesZ.js +345 -0
- package/lib/exercises/math/complex/geometric/complexGeomPlacePointFromZATransformed.d.ts +16 -0
- package/lib/exercises/math/complex/geometric/complexGeomPlacePointFromZATransformed.d.ts.map +1 -0
- package/lib/exercises/math/complex/geometric/complexGeomPlacePointFromZATransformed.js +729 -0
- package/lib/exercises/math/complex/geometric/complexGeomPlacePointWithAffixInU.d.ts +11 -0
- package/lib/exercises/math/complex/geometric/complexGeomPlacePointWithAffixInU.d.ts.map +1 -0
- package/lib/exercises/math/complex/geometric/complexGeomPlacePointWithAffixInU.js +253 -0
- package/lib/exercises/math/complex/geometric/index.d.ts +12 -0
- package/lib/exercises/math/complex/geometric/index.d.ts.map +1 -0
- package/lib/exercises/math/complex/geometric/index.js +19 -0
- package/lib/exercises/math/complex/index.d.ts +4 -10
- package/lib/exercises/math/complex/index.d.ts.map +1 -1
- package/lib/exercises/math/complex/index.js +4 -11
- package/lib/exercises/math/complex/polynomials/factorizePolynomialInC.d.ts +10 -0
- package/lib/exercises/math/complex/polynomials/factorizePolynomialInC.d.ts.map +1 -0
- package/lib/exercises/math/complex/polynomials/factorizePolynomialInC.js +176 -0
- package/lib/exercises/math/complex/polynomials/index.d.ts +4 -0
- package/lib/exercises/math/complex/polynomials/index.d.ts.map +1 -0
- package/lib/exercises/math/complex/polynomials/index.js +3 -0
- package/lib/exercises/math/complex/polynomials/solveSecondDegreeInComplex.d.ts +10 -0
- package/lib/exercises/math/complex/polynomials/solveSecondDegreeInComplex.d.ts.map +1 -0
- package/lib/exercises/math/complex/polynomials/solveSecondDegreeInComplex.js +190 -0
- package/lib/exercises/math/complex/polynomials/solveZSquareEqualsA.d.ts +11 -0
- package/lib/exercises/math/complex/polynomials/solveZSquareEqualsA.d.ts.map +1 -0
- package/lib/exercises/math/complex/polynomials/solveZSquareEqualsA.js +158 -0
- package/lib/exercises/math/complex/unitRoots/giveNUnitRoot.d.ts +7 -0
- package/lib/exercises/math/complex/unitRoots/giveNUnitRoot.d.ts.map +1 -0
- package/lib/exercises/math/complex/unitRoots/giveNUnitRoot.js +122 -0
- package/lib/exercises/math/complex/unitRoots/giveOneSolutionToComplexPowNEqualsOne.d.ts +8 -0
- package/lib/exercises/math/complex/unitRoots/giveOneSolutionToComplexPowNEqualsOne.d.ts.map +1 -0
- package/lib/exercises/math/complex/unitRoots/giveOneSolutionToComplexPowNEqualsOne.js +138 -0
- package/lib/exercises/math/complex/unitRoots/index.d.ts +3 -0
- package/lib/exercises/math/complex/unitRoots/index.d.ts.map +1 -0
- package/lib/exercises/math/complex/unitRoots/index.js +2 -0
- package/lib/exercises/math/conversion/clock/clockReading.d.ts +12 -0
- package/lib/exercises/math/conversion/clock/clockReading.d.ts.map +1 -0
- package/lib/exercises/math/conversion/clock/clockReading.js +385 -0
- package/lib/exercises/math/conversion/clock/clockReadingPlusTimeOperation.d.ts +2 -0
- package/lib/exercises/math/conversion/clock/clockReadingPlusTimeOperation.d.ts.map +1 -0
- package/lib/exercises/math/conversion/clock/clockReadingPlusTimeOperation.js +521 -0
- package/lib/exercises/math/conversion/clock/clockWritingByManipulatingNeedles.d.ts +2 -0
- package/lib/exercises/math/conversion/clock/clockWritingByManipulatingNeedles.d.ts.map +1 -0
- package/lib/exercises/math/conversion/clock/clockWritingByManipulatingNeedles.js +359 -0
- package/lib/exercises/math/conversion/clock/dateTimeOperationAdd.d.ts +16 -0
- package/lib/exercises/math/conversion/clock/dateTimeOperationAdd.d.ts.map +1 -0
- package/lib/exercises/math/conversion/clock/dateTimeOperationAdd.js +319 -0
- package/lib/exercises/math/conversion/clock/index.d.ts +3 -0
- package/lib/exercises/math/conversion/clock/index.d.ts.map +1 -0
- package/lib/exercises/math/conversion/clock/index.js +4 -0
- package/lib/exercises/math/conversion/index.d.ts +1 -0
- package/lib/exercises/math/conversion/index.d.ts.map +1 -1
- package/lib/exercises/math/conversion/index.js +1 -0
- package/lib/exercises/math/geometry/angles/angleNatureFromFigure.d.ts +11 -0
- package/lib/exercises/math/geometry/angles/angleNatureFromFigure.d.ts.map +1 -0
- package/lib/exercises/math/geometry/angles/angleNatureFromFigure.js +233 -0
- package/lib/exercises/math/geometry/angles/angleNatureFromMeasure.d.ts +10 -0
- package/lib/exercises/math/geometry/angles/angleNatureFromMeasure.d.ts.map +1 -0
- package/lib/exercises/math/geometry/angles/angleNatureFromMeasure.js +137 -0
- package/lib/exercises/math/geometry/angles/index.d.ts +2 -0
- package/lib/exercises/math/geometry/angles/index.d.ts.map +1 -1
- package/lib/exercises/math/geometry/angles/index.js +2 -0
- package/lib/exercises/math/geometry/circles/buildCircleFromRadius.d.ts +9 -0
- package/lib/exercises/math/geometry/circles/buildCircleFromRadius.d.ts.map +1 -0
- package/lib/exercises/math/geometry/circles/buildCircleFromRadius.js +187 -0
- package/lib/exercises/math/geometry/circles/index.d.ts +1 -0
- package/lib/exercises/math/geometry/circles/index.d.ts.map +1 -1
- package/lib/exercises/math/geometry/circles/index.js +1 -0
- package/lib/exercises/math/geometry/lines/buildParallelFromLineAndPoint.d.ts +11 -0
- package/lib/exercises/math/geometry/lines/buildParallelFromLineAndPoint.d.ts.map +1 -0
- package/lib/exercises/math/geometry/lines/buildParallelFromLineAndPoint.js +154 -0
- package/lib/exercises/math/geometry/lines/buildPerpendicularFromLineAndPoint.d.ts +11 -0
- package/lib/exercises/math/geometry/lines/buildPerpendicularFromLineAndPoint.d.ts.map +1 -0
- package/lib/exercises/math/geometry/lines/buildPerpendicularFromLineAndPoint.js +157 -0
- package/lib/exercises/math/geometry/lines/index.d.ts +2 -0
- package/lib/exercises/math/geometry/lines/index.d.ts.map +1 -1
- package/lib/exercises/math/geometry/lines/index.js +2 -0
- package/lib/exercises/math/geometry/triangles/index.d.ts +2 -0
- package/lib/exercises/math/geometry/triangles/index.d.ts.map +1 -1
- package/lib/exercises/math/geometry/triangles/index.js +2 -1
- package/lib/exercises/math/geometry/triangles/traceHeightInTriangle.d.ts +13 -0
- package/lib/exercises/math/geometry/triangles/traceHeightInTriangle.d.ts.map +1 -0
- package/lib/exercises/math/geometry/triangles/traceHeightInTriangle.js +271 -0
- package/lib/exercises/math/geometry/triangles/traceMedianInTriangle.d.ts +8 -0
- package/lib/exercises/math/geometry/triangles/traceMedianInTriangle.d.ts.map +1 -1
- package/lib/exercises/math/geometry/triangles/traceMedianInTriangle.js +284 -53
- package/lib/exercises/math/geometry/vectors/constructions/index.d.ts +1 -0
- package/lib/exercises/math/geometry/vectors/constructions/index.d.ts.map +1 -1
- package/lib/exercises/math/geometry/vectors/constructions/index.js +1 -0
- package/lib/exercises/math/geometry/vectors/constructions/traceVectorSumFromVecs.d.ts +8 -0
- package/lib/exercises/math/geometry/vectors/constructions/traceVectorSumFromVecs.d.ts.map +1 -0
- package/lib/exercises/math/geometry/vectors/constructions/traceVectorSumFromVecs.js +165 -0
- package/lib/exercises/math/geometry/volumes/index.d.ts +1 -0
- package/lib/exercises/math/geometry/volumes/index.d.ts.map +1 -1
- package/lib/exercises/math/geometry/volumes/index.js +1 -0
- package/lib/exercises/math/geometry/volumes/volumeOfCylinder.d.ts +8 -0
- package/lib/exercises/math/geometry/volumes/volumeOfCylinder.d.ts.map +1 -0
- package/lib/exercises/math/geometry/volumes/volumeOfCylinder.js +157 -0
- package/lib/exercises/math/spaceGeometry/basis/index.d.ts +1 -0
- package/lib/exercises/math/spaceGeometry/basis/index.d.ts.map +1 -1
- package/lib/exercises/math/spaceGeometry/basis/index.js +1 -0
- package/lib/exercises/math/spaceGeometry/basis/spaceSegmentLengthInRectangularPrism.d.ts +18 -0
- package/lib/exercises/math/spaceGeometry/basis/spaceSegmentLengthInRectangularPrism.d.ts.map +1 -0
- package/lib/exercises/math/spaceGeometry/basis/spaceSegmentLengthInRectangularPrism.js +538 -0
- package/lib/exercises/math/trigonometry/formulas/trigoAdditionFormulaUsage.d.ts.map +1 -1
- package/lib/exercises/math/trigonometry/formulas/trigoAdditionFormulaUsage.js +6 -5
- package/lib/exercises/math/trigonometry/triangle/trigonometrySohcahtoaCalcul.js +1 -1
- package/lib/exercises/utils/geogebra/toolBarConstructor.d.ts +1 -0
- package/lib/exercises/utils/geogebra/toolBarConstructor.d.ts.map +1 -1
- package/lib/exercises/utils/geogebra/toolBarConstructor.js +2 -0
- package/lib/geogebra/parsers/geogebraParser.d.ts +3 -0
- package/lib/geogebra/parsers/geogebraParser.d.ts.map +1 -1
- package/lib/geogebra/parsers/geogebraParser.js +27 -0
- package/lib/index.d.ts +213 -23
- package/lib/index.d.ts.map +1 -1
- package/lib/latexTester.js +2 -0
- package/lib/math/geometry/angle.d.ts.map +1 -1
- package/lib/math/geometry/angle.js +3 -0
- package/lib/math/geometry/segment.d.ts +1 -1
- package/lib/math/geometry/segment.d.ts.map +1 -1
- package/lib/math/geometry/segment.js +5 -2
- package/lib/math/utils/geometry/angleBetweenPoints.d.ts +4 -0
- package/lib/math/utils/geometry/angleBetweenPoints.d.ts.map +1 -0
- package/lib/math/utils/geometry/angleBetweenPoints.js +58 -0
- package/lib/math/utils/geometry/angleNWSE.d.ts +3 -0
- package/lib/math/utils/geometry/angleNWSE.d.ts.map +1 -0
- package/lib/math/utils/geometry/angleNWSE.js +56 -0
- package/lib/tests/singleExo.test.d.ts.map +1 -1
- package/lib/tests/singleExo.test.js +2 -2
- package/lib/utils/strings/frenchDays.d.ts +2 -0
- package/lib/utils/strings/frenchDays.d.ts.map +1 -0
- package/lib/utils/strings/frenchDays.js +9 -0
- package/package.json +1 -1
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
import { addValidProp, shuffleProps, propWhile, tryToAddWrongProp, } from "../../../../exercises/exercise.js";
|
|
2
|
+
import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions.js";
|
|
3
|
+
import { randint } from "../../../../math/utils/random/randint.js";
|
|
4
|
+
import { EquationSolutionNode } from "../../../../tree/nodes/equations/equationSolutionNode.js";
|
|
5
|
+
import { abs } from "../../../../tree/nodes/functions/absNode.js";
|
|
6
|
+
import { opposite } from "../../../../tree/nodes/functions/oppositeNode.js";
|
|
7
|
+
import { sqrt } from "../../../../tree/nodes/functions/sqrtNode.js";
|
|
8
|
+
import { reifyAlgebraic, } from "../../../../tree/nodes/nodeConstructor.js";
|
|
9
|
+
import { add } from "../../../../tree/nodes/operators/addNode.js";
|
|
10
|
+
import { frac } from "../../../../tree/nodes/operators/fractionNode.js";
|
|
11
|
+
import { multiply } from "../../../../tree/nodes/operators/multiplyNode.js";
|
|
12
|
+
import { square } from "../../../../tree/nodes/operators/powerNode.js";
|
|
13
|
+
import { substract } from "../../../../tree/nodes/operators/substractNode.js";
|
|
14
|
+
import { DiscreteSetNode, EmptySet, } from "../../../../tree/nodes/sets/discreteSetNode.js";
|
|
15
|
+
import { discreteSetParser } from "../../../../tree/parsers/discreteSetParser.js";
|
|
16
|
+
import { handleVEAError } from "../../../../utils/errors/handleVEAError.js";
|
|
17
|
+
import { alignTex } from "../../../../utils/latex/alignTex.js";
|
|
18
|
+
const getPropositions = (n, { answer }) => {
|
|
19
|
+
const propositions = [];
|
|
20
|
+
addValidProp(propositions, answer);
|
|
21
|
+
tryToAddWrongProp(propositions, new EquationSolutionNode(EmptySet).toTex());
|
|
22
|
+
propWhile(propositions, n, () => {
|
|
23
|
+
const z1Re = randint(-5, 6, [0]);
|
|
24
|
+
const z1Im = randint(-5, 6, [0]);
|
|
25
|
+
const complex = add(z1Re, multiply(z1Im, "i"));
|
|
26
|
+
const conj = add(z1Re, multiply(-z1Im, "i"));
|
|
27
|
+
if (answer.includes(complex.toTex()))
|
|
28
|
+
return;
|
|
29
|
+
tryToAddWrongProp(propositions, new EquationSolutionNode(new DiscreteSetNode([complex, conj])).toTex());
|
|
30
|
+
});
|
|
31
|
+
return shuffleProps(propositions, n);
|
|
32
|
+
};
|
|
33
|
+
const getSolutions = (identifiers) => {
|
|
34
|
+
const { aIds, bIds, cIds } = identifiers;
|
|
35
|
+
const a = reifyAlgebraic(aIds);
|
|
36
|
+
const b = reifyAlgebraic(bIds);
|
|
37
|
+
const c = reifyAlgebraic(cIds);
|
|
38
|
+
const delta = substract(square(b), multiply(4, multiply(a, c))).simplify();
|
|
39
|
+
const squareRoot = sqrt(abs(delta)).simplify();
|
|
40
|
+
const firstSol = frac(add(opposite(b), multiply("i", squareRoot)), multiply(2, a)).simplify({
|
|
41
|
+
towardsDistribute: true,
|
|
42
|
+
forbidFactorize: true,
|
|
43
|
+
forceDistributeFractions: true,
|
|
44
|
+
noAddOrder: true,
|
|
45
|
+
});
|
|
46
|
+
const secondSol = frac(substract(opposite(b), multiply("i", squareRoot)), multiply(2, a)).simplify({
|
|
47
|
+
towardsDistribute: true,
|
|
48
|
+
forbidFactorize: true,
|
|
49
|
+
forceDistributeFractions: true,
|
|
50
|
+
noAddOrder: true,
|
|
51
|
+
});
|
|
52
|
+
return [firstSol, secondSol];
|
|
53
|
+
};
|
|
54
|
+
const getAnswer = (identifiers) => {
|
|
55
|
+
return new EquationSolutionNode(new DiscreteSetNode(getSolutions(identifiers))).toTex();
|
|
56
|
+
};
|
|
57
|
+
const getEquation = (identifiers) => {
|
|
58
|
+
const { aIds, bIds, cIds } = identifiers;
|
|
59
|
+
const a = reifyAlgebraic(aIds);
|
|
60
|
+
const b = reifyAlgebraic(bIds);
|
|
61
|
+
const c = reifyAlgebraic(cIds);
|
|
62
|
+
return add(multiply(a, "z^2"), add(multiply(b, "z"), c)).simplify({
|
|
63
|
+
towardsDistribute: true,
|
|
64
|
+
forbidFactorize: true,
|
|
65
|
+
});
|
|
66
|
+
};
|
|
67
|
+
const getInstruction = (identifiers) => {
|
|
68
|
+
return `Résoudre dans $\\mathbb{C}$ l'équation suivante :
|
|
69
|
+
|
|
70
|
+
$$
|
|
71
|
+
${getEquation(identifiers).toTex()} = 0
|
|
72
|
+
$$
|
|
73
|
+
|
|
74
|
+
On donnera la réponse sous la forme $S = \\{...\\}$.`;
|
|
75
|
+
};
|
|
76
|
+
const getHint = () => {
|
|
77
|
+
return `L'équation $az^2+bz+c=0$ admet toujours au moins une solution dans $\\mathbb{C}$.
|
|
78
|
+
|
|
79
|
+
On peut la résoudre comme dans $\\mathbb{R}$, à l'exception prêt du cas où le discriminant $\\Delta$ est négatif : dans ce cas, l'équation admet deux solutions complexes conjuguées :
|
|
80
|
+
|
|
81
|
+
$$
|
|
82
|
+
z_1 = \\frac{-b+i\\sqrt{-\\Delta}}{2a}
|
|
83
|
+
$$
|
|
84
|
+
|
|
85
|
+
et
|
|
86
|
+
|
|
87
|
+
$$
|
|
88
|
+
z_1 = \\frac{-b-i\\sqrt{-\\Delta}}{2a}
|
|
89
|
+
$$`;
|
|
90
|
+
};
|
|
91
|
+
const getCorrection = (identifiers) => {
|
|
92
|
+
const { aIds, bIds, cIds } = identifiers;
|
|
93
|
+
const a = reifyAlgebraic(aIds);
|
|
94
|
+
const b = reifyAlgebraic(bIds);
|
|
95
|
+
const c = reifyAlgebraic(cIds);
|
|
96
|
+
const delta = substract(square(b), multiply(4, multiply(a, c)));
|
|
97
|
+
const squareRoot = sqrt(abs(delta)).simplify();
|
|
98
|
+
const firstSol = frac(add(opposite(b), multiply("i", squareRoot)), multiply(2, a));
|
|
99
|
+
const firstSolSimp = firstSol.simplify({
|
|
100
|
+
towardsDistribute: true,
|
|
101
|
+
forbidFactorize: true,
|
|
102
|
+
forceDistributeFractions: true,
|
|
103
|
+
noAddOrder: true,
|
|
104
|
+
});
|
|
105
|
+
const secondSol = frac(substract(opposite(b), multiply("i", squareRoot)), multiply(2, a)).simplify({
|
|
106
|
+
towardsDistribute: true,
|
|
107
|
+
forbidFactorize: true,
|
|
108
|
+
forceDistributeFractions: true,
|
|
109
|
+
noAddOrder: true,
|
|
110
|
+
});
|
|
111
|
+
return `On calcule le discriminant $\\Delta$ :
|
|
112
|
+
|
|
113
|
+
$$
|
|
114
|
+
\\Delta = ${delta.toSimplificationTex()}
|
|
115
|
+
$$
|
|
116
|
+
|
|
117
|
+
Puisque $\\Delta<0$, l'équation possède deux solutions complexes conjuguées. On calcule la première solution $z_1$ :
|
|
118
|
+
|
|
119
|
+
${alignTex([
|
|
120
|
+
["z_1", "=", "\\frac{-b+i\\sqrt{-\\Delta}}{2a}"],
|
|
121
|
+
["", "=", firstSol.toTex()],
|
|
122
|
+
["", "=", firstSolSimp.toTex()],
|
|
123
|
+
])}
|
|
124
|
+
|
|
125
|
+
|
|
126
|
+
On obtient alors la deuxième solution $z_2 = \\overline{z_1}$ :
|
|
127
|
+
|
|
128
|
+
$$
|
|
129
|
+
z_2 = \\overline{${firstSolSimp.toTex()}} = ${secondSol.toTex()}
|
|
130
|
+
$$`;
|
|
131
|
+
};
|
|
132
|
+
const getKeys = () => {
|
|
133
|
+
return ["S", "equal", "lbrace", "i", "semicolon", "rbrace", "varnothing"];
|
|
134
|
+
};
|
|
135
|
+
const isAnswerValid = (ans, { answer: _answer, aIds, bIds, cIds }) => {
|
|
136
|
+
try {
|
|
137
|
+
const setParsed = discreteSetParser(ans);
|
|
138
|
+
if (!setParsed || setParsed.elements.length > 2)
|
|
139
|
+
return false;
|
|
140
|
+
const sols = getSolutions({ aIds, bIds, cIds });
|
|
141
|
+
return sols.every((sol) => setParsed.elements.some((studentSol) => studentSol.simplify().toTex() === sol.simplify().toTex()));
|
|
142
|
+
}
|
|
143
|
+
catch (err) {
|
|
144
|
+
return handleVEAError(err);
|
|
145
|
+
}
|
|
146
|
+
};
|
|
147
|
+
const getSolveSecondDegreeInComplexQuestion = () => {
|
|
148
|
+
//on build a(z-z1)(z-z2) et on en déduit a,b,c
|
|
149
|
+
const a = randint(-5, 6, [0]);
|
|
150
|
+
const z1Re = randint(-5, 6, [0]);
|
|
151
|
+
const b = -2 * a * z1Re;
|
|
152
|
+
const z1Im = randint(-5, 6, [0]);
|
|
153
|
+
const moduleSquared = z1Re * z1Re + z1Im * z1Im;
|
|
154
|
+
const c = a * moduleSquared;
|
|
155
|
+
const identifiers = {
|
|
156
|
+
aIds: a.toTree().toIdentifiers(),
|
|
157
|
+
bIds: b.toTree().toIdentifiers(),
|
|
158
|
+
cIds: c.toTree().toIdentifiers(),
|
|
159
|
+
};
|
|
160
|
+
return getQuestionFromIdentifiers(identifiers);
|
|
161
|
+
};
|
|
162
|
+
const getQuestionFromIdentifiers = (identifiers) => {
|
|
163
|
+
return {
|
|
164
|
+
answer: getAnswer(identifiers),
|
|
165
|
+
instruction: getInstruction(identifiers),
|
|
166
|
+
keys: getKeys(identifiers),
|
|
167
|
+
answerFormat: "tex",
|
|
168
|
+
identifiers,
|
|
169
|
+
hint: getHint(identifiers),
|
|
170
|
+
correction: getCorrection(identifiers),
|
|
171
|
+
};
|
|
172
|
+
};
|
|
173
|
+
export const solveSecondDegreeInComplex = {
|
|
174
|
+
id: "solveSecondDegreeInComplex",
|
|
175
|
+
connector: "\\iff",
|
|
176
|
+
label: "Résoudre une équation du second degré dans $\\mathbb{C}$ pour un discriminant négatif",
|
|
177
|
+
isSingleStep: true,
|
|
178
|
+
generator: (nb, opts) => getDistinctQuestions(() => getSolveSecondDegreeInComplexQuestion(opts), nb),
|
|
179
|
+
qcmTimer: 60,
|
|
180
|
+
freeTimer: 60,
|
|
181
|
+
getPropositions,
|
|
182
|
+
isAnswerValid,
|
|
183
|
+
subject: "Mathématiques",
|
|
184
|
+
getInstruction,
|
|
185
|
+
getHint,
|
|
186
|
+
getCorrection,
|
|
187
|
+
getAnswer,
|
|
188
|
+
getQuestionFromIdentifiers,
|
|
189
|
+
hasHintAndCorrection: true,
|
|
190
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Exercise } from "../../../../exercises/exercise.js";
|
|
2
|
+
import { NodeIdentifiers } from "../../../../tree/nodes/nodeConstructor.js";
|
|
3
|
+
type Identifiers = {
|
|
4
|
+
aIds: NodeIdentifiers;
|
|
5
|
+
};
|
|
6
|
+
type Options = {
|
|
7
|
+
allowPositiveA: boolean;
|
|
8
|
+
};
|
|
9
|
+
export declare const solveZSquareEqualsA: Exercise<Identifiers, Options>;
|
|
10
|
+
export {};
|
|
11
|
+
//# sourceMappingURL=solveZSquareEqualsA.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"solveZSquareEqualsA.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/complex/polynomials/solveZSquareEqualsA.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAkBT,MAAM,6BAA6B,CAAC;AAOrC,OAAO,EACL,eAAe,EAEhB,MAAM,qCAAqC,CAAC;AAS7C,KAAK,WAAW,GAAG;IACjB,IAAI,EAAE,eAAe,CAAC;CACvB,CAAC;AA6JF,KAAK,OAAO,GAAG;IACb,cAAc,EAAE,OAAO,CAAC;CACzB,CAAC;AACF,eAAO,MAAM,mBAAmB,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAoB9D,CAAC"}
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
import { addValidProp, shuffleProps, propWhile, tryToAddWrongProp, GeneratorOptionTarget, GeneratorOptionType, } from "../../../../exercises/exercise.js";
|
|
2
|
+
import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions.js";
|
|
3
|
+
import { randint } from "../../../../math/utils/random/randint.js";
|
|
4
|
+
import { EquationSolutionNode } from "../../../../tree/nodes/equations/equationSolutionNode.js";
|
|
5
|
+
import { abs } from "../../../../tree/nodes/functions/absNode.js";
|
|
6
|
+
import { opposite } from "../../../../tree/nodes/functions/oppositeNode.js";
|
|
7
|
+
import { sqrt } from "../../../../tree/nodes/functions/sqrtNode.js";
|
|
8
|
+
import { reifyAlgebraic, } from "../../../../tree/nodes/nodeConstructor.js";
|
|
9
|
+
import { multiply } from "../../../../tree/nodes/operators/multiplyNode.js";
|
|
10
|
+
import { DiscreteSetNode, EmptySet, } from "../../../../tree/nodes/sets/discreteSetNode.js";
|
|
11
|
+
import { discreteSetParser } from "../../../../tree/parsers/discreteSetParser.js";
|
|
12
|
+
import { handleVEAError } from "../../../../utils/errors/handleVEAError.js";
|
|
13
|
+
const getPropositions = (n, { answer, aIds }) => {
|
|
14
|
+
const propositions = [];
|
|
15
|
+
addValidProp(propositions, answer);
|
|
16
|
+
const a = reifyAlgebraic(aIds);
|
|
17
|
+
tryToAddWrongProp(propositions, new EquationSolutionNode(EmptySet).toTex());
|
|
18
|
+
if (a.evaluate() < 0) {
|
|
19
|
+
const sols = [opposite(sqrt(a)), sqrt(a)];
|
|
20
|
+
tryToAddWrongProp(propositions, new EquationSolutionNode(new DiscreteSetNode(sols)).toTex());
|
|
21
|
+
}
|
|
22
|
+
propWhile(propositions, n, () => {
|
|
23
|
+
const a = randint(-10, 10);
|
|
24
|
+
tryToAddWrongProp(propositions, getAnswer({ aIds: a.toTree().toIdentifiers() }));
|
|
25
|
+
});
|
|
26
|
+
return shuffleProps(propositions, n);
|
|
27
|
+
};
|
|
28
|
+
const getSolutions = (identifiers) => {
|
|
29
|
+
const { aIds } = identifiers;
|
|
30
|
+
const a = reifyAlgebraic(aIds);
|
|
31
|
+
const sols = [];
|
|
32
|
+
if (a.evaluate() === 0)
|
|
33
|
+
sols.push((0).toTree());
|
|
34
|
+
if (a.evaluate() > 0)
|
|
35
|
+
sols.push(opposite(sqrt(a).simplify()), sqrt(a).simplify());
|
|
36
|
+
else
|
|
37
|
+
sols.push(multiply(opposite(sqrt(abs(a)).simplify()), "i"), multiply(sqrt(abs(a)).simplify(), "i"));
|
|
38
|
+
return sols;
|
|
39
|
+
};
|
|
40
|
+
const getAnswer = (identifiers) => {
|
|
41
|
+
return new EquationSolutionNode(new DiscreteSetNode(getSolutions(identifiers))).toTex();
|
|
42
|
+
};
|
|
43
|
+
const getInstruction = (identifiers) => {
|
|
44
|
+
const { aIds } = identifiers;
|
|
45
|
+
const a = reifyAlgebraic(aIds);
|
|
46
|
+
return `Résoudre dans $\\mathbb{C}$ l'équation :
|
|
47
|
+
|
|
48
|
+
$$
|
|
49
|
+
z^2 = ${a.toTex()}
|
|
50
|
+
$$
|
|
51
|
+
|
|
52
|
+
Donner les solutions sous la forme $S = \\{...\\}$.`;
|
|
53
|
+
};
|
|
54
|
+
const getHint = () => {
|
|
55
|
+
return `L'équation $z^2 = a$ admet toujours des solutions dans $\\mathbb{C}$ :
|
|
56
|
+
|
|
57
|
+
- Si $a=0$, alors $z=0$.
|
|
58
|
+
- Si $a>0$, alors les solutions sont réelles.
|
|
59
|
+
- Si $a<0$, alors les solutions sont imaginaires purs.`;
|
|
60
|
+
};
|
|
61
|
+
const getCorrection = (identifiers) => {
|
|
62
|
+
const { aIds } = identifiers;
|
|
63
|
+
const a = reifyAlgebraic(aIds);
|
|
64
|
+
if (a.evaluate() === 0) {
|
|
65
|
+
return `Puisque $${a.toTex()} = 0$, l'équation $z^2 = ${a.toTex()}$ admet une seule solution :
|
|
66
|
+
|
|
67
|
+
$$
|
|
68
|
+
z = 0
|
|
69
|
+
$$`;
|
|
70
|
+
}
|
|
71
|
+
if (a.evaluate() > 0) {
|
|
72
|
+
return `Puisque $${a.toTex()} > 0$, l'équation $z^2 = ${a.toTex()}$ admet deux solutions réelles :
|
|
73
|
+
|
|
74
|
+
$$
|
|
75
|
+
${getAnswer(identifiers)}
|
|
76
|
+
$$`;
|
|
77
|
+
}
|
|
78
|
+
return `Puisque $${a.toTex()} < 0$, l'équation $z^2 = ${a.toTex()}$ admet deux solutions imaginaires pures :
|
|
79
|
+
|
|
80
|
+
$$
|
|
81
|
+
z_1 = ${multiply(opposite(sqrt(abs(a))), "i").toTex()}
|
|
82
|
+
$$
|
|
83
|
+
|
|
84
|
+
et
|
|
85
|
+
|
|
86
|
+
$$
|
|
87
|
+
z_2 = ${multiply(sqrt(abs(a)), "i").toTex()}.
|
|
88
|
+
$$
|
|
89
|
+
|
|
90
|
+
D'où :
|
|
91
|
+
|
|
92
|
+
$$
|
|
93
|
+
${getAnswer(identifiers)}
|
|
94
|
+
$$`;
|
|
95
|
+
};
|
|
96
|
+
const getKeys = () => {
|
|
97
|
+
return ["S", "equal", "lbrace", "i", "semicolon", "rbrace", "varnothing"];
|
|
98
|
+
};
|
|
99
|
+
const isAnswerValid = (ans, { answer: _answer, aIds }) => {
|
|
100
|
+
try {
|
|
101
|
+
const setParsed = discreteSetParser(ans);
|
|
102
|
+
if (!setParsed || setParsed.elements.length > 2)
|
|
103
|
+
return false;
|
|
104
|
+
const sols = getSolutions({ aIds });
|
|
105
|
+
return sols.every((sol) => setParsed.elements.some((studentSol) => studentSol.simplify().toTex() === sol.simplify().toTex()));
|
|
106
|
+
}
|
|
107
|
+
catch (err) {
|
|
108
|
+
return handleVEAError(err);
|
|
109
|
+
}
|
|
110
|
+
};
|
|
111
|
+
const getSolveZSquareEqualsAQuestion = (opts) => {
|
|
112
|
+
const allowPositiveA = !!opts?.allowPositiveA;
|
|
113
|
+
const a = allowPositiveA ? randint(-10, 10) : randint(-20, -1);
|
|
114
|
+
const identifiers = {
|
|
115
|
+
aIds: a.toTree().toIdentifiers(),
|
|
116
|
+
};
|
|
117
|
+
return getQuestionFromIdentifiers(identifiers);
|
|
118
|
+
};
|
|
119
|
+
const getQuestionFromIdentifiers = (identifiers, opts) => {
|
|
120
|
+
return {
|
|
121
|
+
answer: getAnswer(identifiers, opts),
|
|
122
|
+
instruction: getInstruction(identifiers, opts),
|
|
123
|
+
keys: getKeys(identifiers),
|
|
124
|
+
answerFormat: "tex",
|
|
125
|
+
identifiers,
|
|
126
|
+
hint: getHint(identifiers, opts),
|
|
127
|
+
correction: getCorrection(identifiers, opts),
|
|
128
|
+
};
|
|
129
|
+
};
|
|
130
|
+
const options = [
|
|
131
|
+
{
|
|
132
|
+
id: "allowPositiveA",
|
|
133
|
+
label: "Utiliser également des valeurs positives pour $a$",
|
|
134
|
+
target: GeneratorOptionTarget.generation,
|
|
135
|
+
type: GeneratorOptionType.checkbox,
|
|
136
|
+
defaultValue: false,
|
|
137
|
+
},
|
|
138
|
+
];
|
|
139
|
+
export const solveZSquareEqualsA = {
|
|
140
|
+
id: "solveZSquareEqualsA",
|
|
141
|
+
connector: "\\iff",
|
|
142
|
+
label: "Résoudre dans $\\mathbb{C}$ l'équation $z^2 = a$",
|
|
143
|
+
isSingleStep: true,
|
|
144
|
+
generator: (nb, opts) => getDistinctQuestions(() => getSolveZSquareEqualsAQuestion(opts), nb, 15),
|
|
145
|
+
qcmTimer: 60,
|
|
146
|
+
freeTimer: 60,
|
|
147
|
+
getPropositions,
|
|
148
|
+
isAnswerValid,
|
|
149
|
+
subject: "Mathématiques",
|
|
150
|
+
getInstruction,
|
|
151
|
+
getHint,
|
|
152
|
+
getCorrection,
|
|
153
|
+
getAnswer,
|
|
154
|
+
getQuestionFromIdentifiers,
|
|
155
|
+
hasHintAndCorrection: true,
|
|
156
|
+
maxAllowedQuestions: 15,
|
|
157
|
+
options,
|
|
158
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"giveNUnitRoot.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/complex/unitRoots/giveNUnitRoot.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAeT,MAAM,6BAA6B,CAAC;AAWrC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AA6GF,eAAO,MAAM,aAAa,EAAE,QAAQ,CAAC,WAAW,CAmB/C,CAAC"}
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
import { addValidProp, shuffleProps, propWhile, tryToAddWrongProp, } from "../../../../exercises/exercise.js";
|
|
2
|
+
import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions.js";
|
|
3
|
+
import { randint } from "../../../../math/utils/random/randint.js";
|
|
4
|
+
import { isExpNode } from "../../../../tree/nodes/functions/expNode.js";
|
|
5
|
+
import { logn } from "../../../../tree/nodes/functions/logNode.js";
|
|
6
|
+
import { PiNode } from "../../../../tree/nodes/numbers/piNode.js";
|
|
7
|
+
import { frac } from "../../../../tree/nodes/operators/fractionNode.js";
|
|
8
|
+
import { multiply } from "../../../../tree/nodes/operators/multiplyNode.js";
|
|
9
|
+
import { parseAlgebraic } from "../../../../tree/parsers/latexParser.js";
|
|
10
|
+
import { handleVEAError } from "../../../../utils/errors/handleVEAError.js";
|
|
11
|
+
const getPropositions = (n, { answer, n: nIdentifier }) => {
|
|
12
|
+
const propositions = [];
|
|
13
|
+
addValidProp(propositions, answer);
|
|
14
|
+
tryToAddWrongProp(propositions, `e^{i\\frac{\\pi}{${n}}}`);
|
|
15
|
+
propWhile(propositions, n, () => {
|
|
16
|
+
const int = randint(3, 10);
|
|
17
|
+
const k = randint(1, int);
|
|
18
|
+
const quot = frac(multiply(2 * k, PiNode), int).simplify();
|
|
19
|
+
const isRoot = frac(nIdentifier * k * 2, int).evaluate() % 2 === 0;
|
|
20
|
+
if (isRoot)
|
|
21
|
+
return;
|
|
22
|
+
tryToAddWrongProp(propositions, `e^{i${quot.toTex()}}`);
|
|
23
|
+
});
|
|
24
|
+
return shuffleProps(propositions, n);
|
|
25
|
+
};
|
|
26
|
+
const getAnswer = (identifiers) => {
|
|
27
|
+
const { n } = identifiers;
|
|
28
|
+
const simp = frac(multiply(2, PiNode), n).simplify();
|
|
29
|
+
return `e^{i${simp.toTex()}}`;
|
|
30
|
+
};
|
|
31
|
+
const getInstruction = (identifiers) => {
|
|
32
|
+
const { n } = identifiers;
|
|
33
|
+
return `Donner une racine $${n}$-ième de l'unité, différente de $-1$ et de $1$.`;
|
|
34
|
+
};
|
|
35
|
+
const getHint = () => {
|
|
36
|
+
return `Une racine $n$-ième de l'unité est un nombre complexe $z$ tel que :
|
|
37
|
+
|
|
38
|
+
$$
|
|
39
|
+
z^n = 1
|
|
40
|
+
$$
|
|
41
|
+
|
|
42
|
+
Pour tout entier $n>0$, il existe exactement $n$ racines $n$-ième de l'unité.`;
|
|
43
|
+
};
|
|
44
|
+
const getCorrection = (identifiers) => {
|
|
45
|
+
const { n } = identifiers;
|
|
46
|
+
const simp = n / 2;
|
|
47
|
+
const isSimp = n % 2 === 0;
|
|
48
|
+
return `Pour tout entier $n>0$, il existe exactement $n$ racines $n$-ième de l'unité : ce sont les nombres de la forme
|
|
49
|
+
|
|
50
|
+
$$
|
|
51
|
+
e^{i\\frac{2k\\pi}{n}}
|
|
52
|
+
$$
|
|
53
|
+
|
|
54
|
+
où $k$ est un entier naturel tel que $0\\leq k\\leq n-1$.
|
|
55
|
+
|
|
56
|
+
Ici, ce sont donc les nombres de la forme
|
|
57
|
+
|
|
58
|
+
$$
|
|
59
|
+
e^{i\\frac{2k\\pi}{${n}}} ${isSimp ? `= e^{i\\frac{k\\pi}{${simp}}}` : ""}
|
|
60
|
+
$$
|
|
61
|
+
|
|
62
|
+
Pour $k=1$, une telle racine est donc :
|
|
63
|
+
|
|
64
|
+
$$
|
|
65
|
+
${getAnswer(identifiers)}
|
|
66
|
+
$$
|
|
67
|
+
`;
|
|
68
|
+
};
|
|
69
|
+
const getKeys = () => {
|
|
70
|
+
return ["epower", "i", "pi"];
|
|
71
|
+
};
|
|
72
|
+
const isAnswerValid = (ans, { answer: _answer, n }) => {
|
|
73
|
+
try {
|
|
74
|
+
const parsed = parseAlgebraic(ans);
|
|
75
|
+
return (isExpNode(parsed) &&
|
|
76
|
+
frac(multiply(frac(logn(parsed), "i"), n), PiNode)
|
|
77
|
+
.simplify()
|
|
78
|
+
.evaluate() %
|
|
79
|
+
2 ===
|
|
80
|
+
0);
|
|
81
|
+
}
|
|
82
|
+
catch (err) {
|
|
83
|
+
return handleVEAError(err);
|
|
84
|
+
}
|
|
85
|
+
};
|
|
86
|
+
const getGiveNUnitRootQuestion = () => {
|
|
87
|
+
const n = randint(3, 20);
|
|
88
|
+
const identifiers = {
|
|
89
|
+
n,
|
|
90
|
+
};
|
|
91
|
+
return getQuestionFromIdentifiers(identifiers);
|
|
92
|
+
};
|
|
93
|
+
const getQuestionFromIdentifiers = (identifiers) => {
|
|
94
|
+
return {
|
|
95
|
+
answer: getAnswer(identifiers),
|
|
96
|
+
instruction: getInstruction(identifiers),
|
|
97
|
+
keys: getKeys(identifiers),
|
|
98
|
+
answerFormat: "tex",
|
|
99
|
+
identifiers,
|
|
100
|
+
hint: getHint(identifiers),
|
|
101
|
+
correction: getCorrection(identifiers),
|
|
102
|
+
};
|
|
103
|
+
};
|
|
104
|
+
export const giveNUnitRoot = {
|
|
105
|
+
id: "giveNUnitRoot",
|
|
106
|
+
connector: "=",
|
|
107
|
+
label: "Donner une racine $n$-ième complexe de l'unité",
|
|
108
|
+
isSingleStep: true,
|
|
109
|
+
generator: (nb, opts) => getDistinctQuestions(() => getGiveNUnitRootQuestion(opts), nb, 15),
|
|
110
|
+
qcmTimer: 60,
|
|
111
|
+
freeTimer: 60,
|
|
112
|
+
getPropositions,
|
|
113
|
+
isAnswerValid,
|
|
114
|
+
subject: "Mathématiques",
|
|
115
|
+
getInstruction,
|
|
116
|
+
getHint,
|
|
117
|
+
getCorrection,
|
|
118
|
+
getAnswer,
|
|
119
|
+
getQuestionFromIdentifiers,
|
|
120
|
+
hasHintAndCorrection: true,
|
|
121
|
+
maxAllowedQuestions: 15,
|
|
122
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Exercise } from "../../../../exercises/exercise.js";
|
|
2
|
+
type Identifiers = {
|
|
3
|
+
n: number;
|
|
4
|
+
a: number;
|
|
5
|
+
};
|
|
6
|
+
export declare const giveOneSolutionToComplexPowNEqualsOne: Exercise<Identifiers>;
|
|
7
|
+
export {};
|
|
8
|
+
//# sourceMappingURL=giveOneSolutionToComplexPowNEqualsOne.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"giveOneSolutionToComplexPowNEqualsOne.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/complex/unitRoots/giveOneSolutionToComplexPowNEqualsOne.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAeT,MAAM,6BAA6B,CAAC;AAerC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CAEX,CAAC;AAgIF,eAAO,MAAM,qCAAqC,EAAE,QAAQ,CAAC,WAAW,CAqBvE,CAAC"}
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
import { addValidProp, shuffleProps, propWhile, tryToAddWrongProp, } from "../../../../exercises/exercise.js";
|
|
2
|
+
import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions.js";
|
|
3
|
+
import { randint } from "../../../../math/utils/random/randint.js";
|
|
4
|
+
import { isExpNode } from "../../../../tree/nodes/functions/expNode.js";
|
|
5
|
+
import { logn } from "../../../../tree/nodes/functions/logNode.js";
|
|
6
|
+
import { PiNode } from "../../../../tree/nodes/numbers/piNode.js";
|
|
7
|
+
import { add } from "../../../../tree/nodes/operators/addNode.js";
|
|
8
|
+
import { frac } from "../../../../tree/nodes/operators/fractionNode.js";
|
|
9
|
+
import { multiply } from "../../../../tree/nodes/operators/multiplyNode.js";
|
|
10
|
+
import { power } from "../../../../tree/nodes/operators/powerNode.js";
|
|
11
|
+
import { substract } from "../../../../tree/nodes/operators/substractNode.js";
|
|
12
|
+
import { parseAlgebraic } from "../../../../tree/parsers/latexParser.js";
|
|
13
|
+
import { handleVEAError } from "../../../../utils/errors/handleVEAError.js";
|
|
14
|
+
import { alignTex } from "../../../../utils/latex/alignTex.js";
|
|
15
|
+
const getPropositions = (n, { answer, a, n: nIdentifier }) => {
|
|
16
|
+
const propositions = [];
|
|
17
|
+
addValidProp(propositions, answer);
|
|
18
|
+
tryToAddWrongProp(propositions, `e^{i${frac(multiply(2, PiNode), n).simplify().toTex()}}`);
|
|
19
|
+
propWhile(propositions, n, () => {
|
|
20
|
+
const int = randint(3, 10);
|
|
21
|
+
const k = randint(1, int);
|
|
22
|
+
const quot = frac(multiply(2 * k, PiNode), int).simplify();
|
|
23
|
+
const isRoot = frac(nIdentifier * k * 2, int).evaluate() % 2 === 0;
|
|
24
|
+
if (isRoot)
|
|
25
|
+
return;
|
|
26
|
+
tryToAddWrongProp(propositions, add(a, `e^{i${quot.toTex()}}`).toTex());
|
|
27
|
+
});
|
|
28
|
+
return shuffleProps(propositions, n);
|
|
29
|
+
};
|
|
30
|
+
const getAnswer = (identifiers) => {
|
|
31
|
+
const { a, n } = identifiers;
|
|
32
|
+
const root = `e^{i${frac(multiply(2, PiNode), n).simplify().toTex()}}`;
|
|
33
|
+
return add(a, root).toTex();
|
|
34
|
+
};
|
|
35
|
+
const getInstruction = (identifiers) => {
|
|
36
|
+
const { a, n } = identifiers;
|
|
37
|
+
return `Donner une solution non-réelle de l'équation suivante :
|
|
38
|
+
|
|
39
|
+
$$
|
|
40
|
+
${power(substract("z", a).simplify(), n).toTex()} = 1
|
|
41
|
+
$$`;
|
|
42
|
+
};
|
|
43
|
+
const getHint = (identifiers) => {
|
|
44
|
+
const { a, n } = identifiers;
|
|
45
|
+
const equa = `${power(substract("z", a).simplify(), n).toTex()} = 1`;
|
|
46
|
+
return `$z$ est une solution de l'équation
|
|
47
|
+
|
|
48
|
+
$$
|
|
49
|
+
${equa}
|
|
50
|
+
$$
|
|
51
|
+
|
|
52
|
+
si et seulement si $${substract("z", a)
|
|
53
|
+
.simplify()
|
|
54
|
+
.toTex()}$ est une racine $${n}$-ième de l'unité.`;
|
|
55
|
+
};
|
|
56
|
+
const getCorrection = (identifiers) => {
|
|
57
|
+
const { a, n } = identifiers;
|
|
58
|
+
const root = `e^{i${frac(multiply(2, PiNode), n).simplify().toTex()}}`;
|
|
59
|
+
const equa = `${power(substract("z", a).simplify().toTex(), n)} = 1`;
|
|
60
|
+
return `$z$ est une solution de l'équation
|
|
61
|
+
|
|
62
|
+
$$
|
|
63
|
+
${equa}
|
|
64
|
+
$$
|
|
65
|
+
|
|
66
|
+
si et seulement si $${substract("z", a)
|
|
67
|
+
.simplify()
|
|
68
|
+
.toTex()}$ est une racine $${n}$-ième de l'unité.
|
|
69
|
+
|
|
70
|
+
Les racines $${n}$-ièmes de l'unité sont les nombres de la forme $e^{i\\frac{2k\\pi}{${n}}}$, où $k$ est un entier naturel tel que $0\\leq k\\leq ${n}-1$.
|
|
71
|
+
|
|
72
|
+
Pour $k=1$, une telle racine est :
|
|
73
|
+
|
|
74
|
+
$$
|
|
75
|
+
${root}
|
|
76
|
+
$$
|
|
77
|
+
|
|
78
|
+
Une solution non-réelle de l'équation est donc :
|
|
79
|
+
|
|
80
|
+
${alignTex([
|
|
81
|
+
[substract("z", a).simplify().toTex(), "=", root],
|
|
82
|
+
["z", "=", add(a, root).toTex()],
|
|
83
|
+
])}
|
|
84
|
+
`;
|
|
85
|
+
};
|
|
86
|
+
const getKeys = () => {
|
|
87
|
+
return ["epower", "i", "pi"];
|
|
88
|
+
};
|
|
89
|
+
const isAnswerValid = (ans, { answer: _answer, a, n }) => {
|
|
90
|
+
try {
|
|
91
|
+
const parsed = parseAlgebraic(ans);
|
|
92
|
+
const rawExp = substract(parsed, a).simplify();
|
|
93
|
+
return (isExpNode(rawExp) &&
|
|
94
|
+
frac(multiply(frac(logn(rawExp), "i"), n), PiNode)
|
|
95
|
+
.simplify()
|
|
96
|
+
.evaluate() %
|
|
97
|
+
2 ===
|
|
98
|
+
0);
|
|
99
|
+
}
|
|
100
|
+
catch (err) {
|
|
101
|
+
return handleVEAError(err);
|
|
102
|
+
}
|
|
103
|
+
};
|
|
104
|
+
const getGiveOneSolutionToComplexPowNEqualsOneQuestion = () => {
|
|
105
|
+
const n = randint(3, 20);
|
|
106
|
+
const a = randint(-10, 10, [0]);
|
|
107
|
+
const identifiers = { a, n };
|
|
108
|
+
return getQuestionFromIdentifiers(identifiers);
|
|
109
|
+
};
|
|
110
|
+
const getQuestionFromIdentifiers = (identifiers) => {
|
|
111
|
+
return {
|
|
112
|
+
answer: getAnswer(identifiers),
|
|
113
|
+
instruction: getInstruction(identifiers),
|
|
114
|
+
keys: getKeys(identifiers),
|
|
115
|
+
answerFormat: "tex",
|
|
116
|
+
identifiers,
|
|
117
|
+
hint: getHint(identifiers),
|
|
118
|
+
correction: getCorrection(identifiers),
|
|
119
|
+
};
|
|
120
|
+
};
|
|
121
|
+
export const giveOneSolutionToComplexPowNEqualsOne = {
|
|
122
|
+
id: "giveOneSolutionToComplexPowNEqualsOne",
|
|
123
|
+
connector: "=",
|
|
124
|
+
label: "Donner une solution de l'équation complexe $(z-a)^n = 1$",
|
|
125
|
+
isSingleStep: true,
|
|
126
|
+
generator: (nb, opts) => getDistinctQuestions(() => getGiveOneSolutionToComplexPowNEqualsOneQuestion(opts), nb),
|
|
127
|
+
qcmTimer: 60,
|
|
128
|
+
freeTimer: 60,
|
|
129
|
+
getPropositions,
|
|
130
|
+
isAnswerValid,
|
|
131
|
+
subject: "Mathématiques",
|
|
132
|
+
getInstruction,
|
|
133
|
+
getHint,
|
|
134
|
+
getCorrection,
|
|
135
|
+
getAnswer,
|
|
136
|
+
getQuestionFromIdentifiers,
|
|
137
|
+
hasHintAndCorrection: true,
|
|
138
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/complex/unitRoots/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,4CAA4C,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Exercise } from "../../../../exercises/exercise.js";
|
|
2
|
+
/************/
|
|
3
|
+
type Identifiers = {
|
|
4
|
+
hours: number;
|
|
5
|
+
minutes: number;
|
|
6
|
+
};
|
|
7
|
+
type Options = {
|
|
8
|
+
amPmType: string;
|
|
9
|
+
};
|
|
10
|
+
export declare const clockReading: Exercise<Identifiers, Options>;
|
|
11
|
+
export {};
|
|
12
|
+
//# sourceMappingURL=clockReading.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"clockReading.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/conversion/clock/clockReading.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAoBT,MAAM,6BAA6B,CAAC;AA4ErC,cAAc;AAEd,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAyWF,KAAK,OAAO,GAAG;IACb,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAsBF,eAAO,MAAM,YAAY,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAoBvD,CAAC"}
|