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,459 @@
|
|
|
1
|
+
import { addValidProp, shuffleProps, tryToAddWrongProp, propWhile, } from "../../../../exercises/exercise.js";
|
|
2
|
+
import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions.js";
|
|
3
|
+
import { blueExtraDark, colorWithOpacity } from "../../../../geogebra/colors.js";
|
|
4
|
+
import { GeogebraConstructor } from "../../../../geogebra/geogebraConstructor.js";
|
|
5
|
+
import { Point } from "../../../../math/geometry/point.js";
|
|
6
|
+
import { Vector } from "../../../../math/geometry/vector.js";
|
|
7
|
+
import { randint } from "../../../../math/utils/random/randint.js";
|
|
8
|
+
import { round } from "../../../../math/utils/round.js";
|
|
9
|
+
import { exp, isExpNode } from "../../../../tree/nodes/functions/expNode.js";
|
|
10
|
+
import { isOppositeNode } from "../../../../tree/nodes/functions/oppositeNode.js";
|
|
11
|
+
import { NodeConstructor, } from "../../../../tree/nodes/nodeConstructor.js";
|
|
12
|
+
import { isNumberNode } from "../../../../tree/nodes/numbers/numberNode.js";
|
|
13
|
+
import { PiNode } from "../../../../tree/nodes/numbers/piNode.js";
|
|
14
|
+
import { add } from "../../../../tree/nodes/operators/addNode.js";
|
|
15
|
+
import { frac, isFractionNode, } from "../../../../tree/nodes/operators/fractionNode.js";
|
|
16
|
+
import { isMultiplyNode, multiply, } from "../../../../tree/nodes/operators/multiplyNode.js";
|
|
17
|
+
import { substract } from "../../../../tree/nodes/operators/substractNode.js";
|
|
18
|
+
import { VariableNode } from "../../../../tree/nodes/variables/variableNode.js";
|
|
19
|
+
import { parseAlgebraic } from "../../../../tree/parsers/latexParser.js";
|
|
20
|
+
import { NodeComparator } from "../../../../tree/utilities/nodeComparator.js";
|
|
21
|
+
import { coinFlip } from "../../../../utils/alea/coinFlip.js";
|
|
22
|
+
import { probaFlip } from "../../../../utils/alea/probaFlip.js";
|
|
23
|
+
import { random } from "../../../../utils/alea/random.js";
|
|
24
|
+
import { zip } from "../../../../utils/arrays/arrayZip.js";
|
|
25
|
+
import { handleVEAError } from "../../../../utils/errors/handleVEAError.js";
|
|
26
|
+
//TODO: frac does not simplify "i"
|
|
27
|
+
// const nodeI = new ComplexNode((0).toTree(), (1).toTree());
|
|
28
|
+
const nodeI = new VariableNode("i");
|
|
29
|
+
const _degreesToRadians = (angleInDegrees, precision) => {
|
|
30
|
+
const oneOver180 = 0.00555555555555555;
|
|
31
|
+
return round(multiply(multiply(angleInDegrees, PiNode), oneOver180).evaluate(), precision);
|
|
32
|
+
};
|
|
33
|
+
const rotateVector = (vec, angle, name) => {
|
|
34
|
+
//x' = cos(t)*x -sin(t)*y
|
|
35
|
+
//y' = sin(t)*x + cos(t)*y
|
|
36
|
+
const cos = Math.cos(angle);
|
|
37
|
+
const sin = Math.sin(angle);
|
|
38
|
+
return new Vector(name, substract(multiply(cos, vec.x), multiply(sin, vec.y)).evaluate().toTree(), add(multiply(sin, vec.x), multiply(cos, vec.y)).evaluate().toTree());
|
|
39
|
+
};
|
|
40
|
+
const rotatePoint = (target, angle, center, name, precision = 2) => {
|
|
41
|
+
const vSrc = createVector(center, target, "vSrc", precision);
|
|
42
|
+
const vRotated = rotateVector(vSrc, angle, "vRotated");
|
|
43
|
+
return createPoint(add(center.x, vRotated.x).evaluate(), add(center.y, vRotated.y).evaluate(), name, precision);
|
|
44
|
+
};
|
|
45
|
+
const createVector = (from, to, name, precision = 5) => {
|
|
46
|
+
return new Vector(name, round(substract(to.x, from.x).evaluate(), precision).toTree(), round(substract(to.y, from.y).evaluate(), precision).toTree());
|
|
47
|
+
};
|
|
48
|
+
const createPoint = (x, y, name, precision = 5) => {
|
|
49
|
+
return new Point(name, round(x, precision), round(y, precision));
|
|
50
|
+
};
|
|
51
|
+
const getHydrated = (identifiers) => {
|
|
52
|
+
const { nodeIdsModule, vFactor, nbSides } = identifiers;
|
|
53
|
+
const [nodeModule] = [nodeIdsModule].map((nodeIds) => NodeConstructor.fromIdentifiers(nodeIds));
|
|
54
|
+
const nodeAngleBase = frac(multiply(2, PiNode), nbSides);
|
|
55
|
+
const nodeArgument = multiply(vFactor, nodeAngleBase);
|
|
56
|
+
const nodeAffix = multiply(nodeModule, exp(multiply(nodeI, nodeArgument)));
|
|
57
|
+
const nodeAffixSimplified = multiply(nodeModule, exp(multiply(nodeI, nodeArgument.simplify({ towardsDistribute: true }))));
|
|
58
|
+
return {
|
|
59
|
+
nodeAngleBase,
|
|
60
|
+
nodeModule,
|
|
61
|
+
nodeArgument,
|
|
62
|
+
vFactor,
|
|
63
|
+
nodeAffix,
|
|
64
|
+
nodeAffixSimplified,
|
|
65
|
+
};
|
|
66
|
+
};
|
|
67
|
+
const getInstruction = (identifiers) => {
|
|
68
|
+
const { nbSides } = identifiers;
|
|
69
|
+
return `Un polygone régulier à $${nbSides}$ côtés centré en l'origine est représenté ci-dessous.
|
|
70
|
+
Donner l'affixe du point $M$, sous forme exponentielle.'`;
|
|
71
|
+
};
|
|
72
|
+
const getAnswerNode = (identifiers) => {
|
|
73
|
+
const { nodeAffixSimplified } = getHydrated(identifiers);
|
|
74
|
+
return nodeAffixSimplified;
|
|
75
|
+
};
|
|
76
|
+
const getAnswer = (identifiers) => {
|
|
77
|
+
return getAnswerNode(identifiers).toTex();
|
|
78
|
+
};
|
|
79
|
+
const getHint = (identifiers) => {
|
|
80
|
+
const { nbSides } = identifiers;
|
|
81
|
+
const { nodeModule } = getHydrated(identifiers);
|
|
82
|
+
return `Soit $z$ l'affixe du point $M$.
|
|
83
|
+
L'écriture sous forme exponentielle de $z$ est :
|
|
84
|
+
|
|
85
|
+
$$
|
|
86
|
+
m \\ e^{i \\alpha}
|
|
87
|
+
$$
|
|
88
|
+
|
|
89
|
+
avec $m$ le module de $z$ et $\\alpha$ un argument de $z$.
|
|
90
|
+
|
|
91
|
+
Le module de $z$ est la distance du point $M$ à l'origine $O$.
|
|
92
|
+
L'argument principal de $z$ est l'angle orienté $(\\overrightarrow{OM}, \\overrightarrow{u})$, avec $\\overrightarrow{u}$ le vecteur unitaire de l'axe des réels.
|
|
93
|
+
|
|
94
|
+
Tu peux remarquer que le polygone est inscrit dans un cercle de rayon $${nodeModule.toTex()}$.
|
|
95
|
+
Tu peux aussi remarquer que l'angle plein ($2 \\pi$) est divisé en $${nbSides}$.`;
|
|
96
|
+
};
|
|
97
|
+
const getCorrection = (identifiers) => {
|
|
98
|
+
const { nbSides } = identifiers;
|
|
99
|
+
const { nodeModule, nodeArgument, nodeAffixSimplified } = getHydrated(identifiers);
|
|
100
|
+
const nodeArgumentSimplified = nodeArgument.simplify({
|
|
101
|
+
towardsDistribute: false,
|
|
102
|
+
});
|
|
103
|
+
const [texArgument, texArgumentSimplified] = [
|
|
104
|
+
nodeArgument,
|
|
105
|
+
nodeArgumentSimplified,
|
|
106
|
+
].map((node) => node.toTex());
|
|
107
|
+
return `Le point $M$ appartient au polygone régulier à $${nbSides}$ côtés inscrit dans le cercle centré sur l'origine et de rayon $${nodeModule.toTex()}$.
|
|
108
|
+
Son module est donc $${nodeModule.toTex()}$.
|
|
109
|
+
On remarque que l'angle plein ($2 \\pi$) est divisé en $${nbSides}$.
|
|
110
|
+
On peut calculer l'argument principal de l'affixe de $M$ :
|
|
111
|
+
|
|
112
|
+
$$
|
|
113
|
+
${texArgument} = ${texArgumentSimplified}
|
|
114
|
+
$$
|
|
115
|
+
|
|
116
|
+
L'affixe du point $M$ est donc $${nodeAffixSimplified.toTex()}$.`;
|
|
117
|
+
};
|
|
118
|
+
const getCorrectionGGBOptions = (identifiers) => {
|
|
119
|
+
const { vFactor } = identifiers;
|
|
120
|
+
const { nodeAngleBase, nodeArgument, nodeModule } = getHydrated(identifiers);
|
|
121
|
+
const nbRays = frac(multiply(2, PiNode), nodeAngleBase)
|
|
122
|
+
.simplify({ towardsDistribute: false })
|
|
123
|
+
.evaluate();
|
|
124
|
+
const arrNodeAngle = [...Array(nbRays).keys()].map((i) => multiply(i, nodeAngleBase));
|
|
125
|
+
const pointO = new Point("O", 0, 0);
|
|
126
|
+
const pointA = new Point("A", nodeModule, 0);
|
|
127
|
+
const precision = 5;
|
|
128
|
+
const arrPointForAngle = arrNodeAngle.map((nodeAngle, i) => rotatePoint(pointA, nodeAngle.evaluate(), pointO, `PA${i}`, precision));
|
|
129
|
+
const strLineColor = `"${colorWithOpacity("#000000", 26)}"`;
|
|
130
|
+
const pointAM = new Point("AM", nodeModule, 0);
|
|
131
|
+
const pointM = rotatePoint(pointAM, nodeArgument.evaluate(), pointO, "M", precision);
|
|
132
|
+
const pointRadius = (() => {
|
|
133
|
+
const vFactorRadius = vFactor === 1 ? 2 : 1;
|
|
134
|
+
const nodeArgumentRadius = multiply(vFactorRadius, nodeAngleBase);
|
|
135
|
+
return rotatePoint(pointAM, nodeArgumentRadius.evaluate(), pointO, "PR", precision);
|
|
136
|
+
})();
|
|
137
|
+
const ggb = new GeogebraConstructor({
|
|
138
|
+
isGridSimple: true,
|
|
139
|
+
commands: [
|
|
140
|
+
//circle
|
|
141
|
+
...[
|
|
142
|
+
`cir = Circle((0,0), ${pointM.toMathString()})`,
|
|
143
|
+
`SetLineThickness(cir, 1)`,
|
|
144
|
+
],
|
|
145
|
+
//angle
|
|
146
|
+
...[
|
|
147
|
+
`ray0 = Ray(${pointO.toMathString()}, ${arrPointForAngle[0].toMathString()})`,
|
|
148
|
+
`SetVisibleInView(ray0, 1, false)`,
|
|
149
|
+
`rayM = Ray(${pointO.toMathString()}, ${arrPointForAngle[1].toMathString()})`,
|
|
150
|
+
`SetVisibleInView(rayM, 1, false)`,
|
|
151
|
+
`segAng = Segment(${pointO.toMathString()}, ${arrPointForAngle[1].toMathString()})`,
|
|
152
|
+
`SetColor(segAng, ${strLineColor})`,
|
|
153
|
+
`SetLineThickness(segAng, 1)`,
|
|
154
|
+
`ang = Angle(ray0, rayM)`,
|
|
155
|
+
`SetCaption(ang, "$\\\\ \\\\ \\ \\ \\footnotesize{${nodeAngleBase.toTex()}}$")`,
|
|
156
|
+
`ShowLabel(ang, true)`,
|
|
157
|
+
],
|
|
158
|
+
//segments (rays)
|
|
159
|
+
...arrPointForAngle
|
|
160
|
+
.slice(2)
|
|
161
|
+
.flatMap((point, i) => [
|
|
162
|
+
`segRay${i} = Segment(${pointO.toMathString()}, ${point.toMathString()})`,
|
|
163
|
+
`SetColor(segRay${i}, ${strLineColor})`,
|
|
164
|
+
`SetLineThickness(segRay${i}, 1)`,
|
|
165
|
+
`SetLineStyle(segRay${i}, 1)`,
|
|
166
|
+
]),
|
|
167
|
+
//segments
|
|
168
|
+
...zip(arrPointForAngle, [
|
|
169
|
+
...arrPointForAngle.slice(1),
|
|
170
|
+
arrPointForAngle[0],
|
|
171
|
+
]).flatMap(([pointStart, pointEnd], i) => [
|
|
172
|
+
`segPol${i} = Segment(${pointStart.toMathString()}, ${pointEnd.toMathString()})`,
|
|
173
|
+
`SetColor(segPol${i}, "${blueExtraDark}")`,
|
|
174
|
+
`SetLineThickness(segPol${i}, 3)`,
|
|
175
|
+
]),
|
|
176
|
+
//radius
|
|
177
|
+
...[
|
|
178
|
+
// `PR = ${pointRadius.toMathString()}`,
|
|
179
|
+
// `SetFixed(PR, true, false)`,
|
|
180
|
+
// `SetVisibleInView(PR, 1, false)`,
|
|
181
|
+
`segRadius = Segment(${pointO.toMathString()}, ${pointRadius.toMathString()})`,
|
|
182
|
+
`SetColor(segRadius, ${strLineColor})`,
|
|
183
|
+
`SetLineThickness(segRadius, 2)`,
|
|
184
|
+
`SetLineStyle(segRadius, 1)`,
|
|
185
|
+
`SetCaption(segRadius, "$\\footnotesize{${nodeModule.toTex()}}$")`,
|
|
186
|
+
`ShowLabel(segRadius, true)`,
|
|
187
|
+
],
|
|
188
|
+
//pointM
|
|
189
|
+
...[
|
|
190
|
+
`M = ${pointM.toMathString()}`,
|
|
191
|
+
`SetFixed(M, true, false)`,
|
|
192
|
+
`ShowLabel(M, true)`,
|
|
193
|
+
],
|
|
194
|
+
//pointO
|
|
195
|
+
...[
|
|
196
|
+
`O = ${pointO.toMathString()}`,
|
|
197
|
+
`SetFixed(O, true, false)`,
|
|
198
|
+
`ShowLabel(O, true)`,
|
|
199
|
+
],
|
|
200
|
+
],
|
|
201
|
+
fontSize: 16,
|
|
202
|
+
xAxis: {
|
|
203
|
+
hideNumbers: true,
|
|
204
|
+
},
|
|
205
|
+
yAxis: {
|
|
206
|
+
hideNumbers: true,
|
|
207
|
+
},
|
|
208
|
+
});
|
|
209
|
+
const radius = nodeModule.evaluate();
|
|
210
|
+
const lForFrame = radius + 0.1;
|
|
211
|
+
return ggb.getOptions({
|
|
212
|
+
coords: [-lForFrame, lForFrame, -lForFrame, lForFrame],
|
|
213
|
+
});
|
|
214
|
+
};
|
|
215
|
+
const getGGBOptions = (identifiers) => {
|
|
216
|
+
const { nodeAngleBase, nodeArgument, nodeModule, vFactor } = getHydrated(identifiers);
|
|
217
|
+
const nbRays = frac(multiply(2, PiNode), nodeAngleBase)
|
|
218
|
+
.simplify({ towardsDistribute: false })
|
|
219
|
+
.evaluate();
|
|
220
|
+
const arrNodeAngle = [...Array(nbRays).keys()].map((i) => multiply(i, nodeAngleBase));
|
|
221
|
+
const pointO = new Point("O", 0, 0);
|
|
222
|
+
const pointA = new Point("A", nodeModule, 0);
|
|
223
|
+
const precision = 5;
|
|
224
|
+
const arrPointForAngle = arrNodeAngle.map((nodeAngle, i) => rotatePoint(pointA, nodeAngle.evaluate(), pointO, `PA${i}`, precision));
|
|
225
|
+
const strLineColor = `"${colorWithOpacity("#000000", 26)}"`;
|
|
226
|
+
const pointAM = new Point("AM", nodeModule, 0);
|
|
227
|
+
const pointM = rotatePoint(pointAM, nodeArgument.evaluate(), pointO, "M", precision);
|
|
228
|
+
const pointRadius = (() => {
|
|
229
|
+
const vFactorRadius = vFactor === 1 ? 2 : 1;
|
|
230
|
+
const nodeArgumentRadius = multiply(vFactorRadius, nodeAngleBase);
|
|
231
|
+
return rotatePoint(pointAM, nodeArgumentRadius.evaluate(), pointO, "PR", precision);
|
|
232
|
+
})();
|
|
233
|
+
const ggb = new GeogebraConstructor({
|
|
234
|
+
isGridSimple: true,
|
|
235
|
+
commands: [
|
|
236
|
+
//segments
|
|
237
|
+
...zip(arrPointForAngle, [
|
|
238
|
+
...arrPointForAngle.slice(1),
|
|
239
|
+
arrPointForAngle[0],
|
|
240
|
+
]).flatMap(([pointStart, pointEnd], i) => [
|
|
241
|
+
`segPol${i} = Segment(${pointStart.toMathString()}, ${pointEnd.toMathString()})`,
|
|
242
|
+
`SetColor(segPol${i}, "${blueExtraDark}")`,
|
|
243
|
+
`SetLineThickness(segPol${i}, 3)`,
|
|
244
|
+
]),
|
|
245
|
+
//radius
|
|
246
|
+
...[
|
|
247
|
+
`segRadius = Segment(${pointO.toMathString()}, ${pointRadius.toMathString()})`,
|
|
248
|
+
`SetColor(segRadius, ${strLineColor})`,
|
|
249
|
+
`SetLineThickness(segRadius, 2)`,
|
|
250
|
+
`SetLineStyle(segRadius, 1)`,
|
|
251
|
+
`SetCaption(segRadius, "$${nodeModule.toTex()}$")`,
|
|
252
|
+
`ShowLabel(segRadius, true)`,
|
|
253
|
+
],
|
|
254
|
+
//pointM
|
|
255
|
+
...[
|
|
256
|
+
`M = ${pointM.toMathString()}`,
|
|
257
|
+
`SetFixed(M, true, false)`,
|
|
258
|
+
`ShowLabel(M, true)`,
|
|
259
|
+
],
|
|
260
|
+
],
|
|
261
|
+
fontSize: 16,
|
|
262
|
+
xAxis: {
|
|
263
|
+
hideNumbers: true,
|
|
264
|
+
},
|
|
265
|
+
yAxis: {
|
|
266
|
+
hideNumbers: true,
|
|
267
|
+
},
|
|
268
|
+
});
|
|
269
|
+
const radius = nodeModule.evaluate();
|
|
270
|
+
const lForFrame = radius + 0.1;
|
|
271
|
+
return ggb.getOptions({
|
|
272
|
+
coords: [-lForFrame, lForFrame, -lForFrame, lForFrame],
|
|
273
|
+
});
|
|
274
|
+
};
|
|
275
|
+
const getPropositions = (n, { answer, ...identifiers }) => {
|
|
276
|
+
const propositions = [];
|
|
277
|
+
addValidProp(propositions, answer);
|
|
278
|
+
const { nbSides } = identifiers;
|
|
279
|
+
const { nodeModule: nodeModulePure, nodeArgument, nodeAngleBase, vFactor, } = getHydrated(identifiers);
|
|
280
|
+
function createNodeAffixSimplified(nodeModule, nodeArgument) {
|
|
281
|
+
const nodeAffixSimplified = multiply(nodeModule, exp(multiply(nodeI, nodeArgument.simplify({ towardsDistribute: true }))));
|
|
282
|
+
return nodeAffixSimplified;
|
|
283
|
+
}
|
|
284
|
+
const isTerrorWrtModule = probaFlip(0.39);
|
|
285
|
+
const nodeModule = (() => {
|
|
286
|
+
if (isTerrorWrtModule) {
|
|
287
|
+
return (1).toTree();
|
|
288
|
+
}
|
|
289
|
+
else {
|
|
290
|
+
return nodeModulePure;
|
|
291
|
+
}
|
|
292
|
+
})();
|
|
293
|
+
//student: reads wrong angle: offset
|
|
294
|
+
if (Math.abs(vFactor) > 2) {
|
|
295
|
+
const nodeArgumentWrong = add(nodeArgument, multiply(coinFlip() ? +1 : -1, nodeAngleBase)).simplify({ towardsDistribute: false });
|
|
296
|
+
const nodeAffixSimplified = createNodeAffixSimplified(nodeModule, nodeArgumentWrong);
|
|
297
|
+
tryToAddWrongProp(propositions, nodeAffixSimplified.toTex());
|
|
298
|
+
}
|
|
299
|
+
//student: pi instead of 2 pi
|
|
300
|
+
{
|
|
301
|
+
const nodeArgumentWrong = frac(nodeArgument, 2).simplify({
|
|
302
|
+
towardsDistribute: false,
|
|
303
|
+
});
|
|
304
|
+
const nodeAffixSimplified = createNodeAffixSimplified(nodeModule, nodeArgumentWrong);
|
|
305
|
+
tryToAddWrongProp(propositions, nodeAffixSimplified.toTex());
|
|
306
|
+
}
|
|
307
|
+
//student: mistake wrt base angle
|
|
308
|
+
{
|
|
309
|
+
const nbSidesWrong = nbSides + (coinFlip() ? +1 : -1);
|
|
310
|
+
const identifiersWrong = {
|
|
311
|
+
...identifiers,
|
|
312
|
+
nbSides: nbSidesWrong,
|
|
313
|
+
};
|
|
314
|
+
tryToAddWrongProp(propositions, getAnswer(identifiersWrong));
|
|
315
|
+
}
|
|
316
|
+
//filler
|
|
317
|
+
propWhile(propositions, n, () => {
|
|
318
|
+
//student: pi instead of 2 pi
|
|
319
|
+
const vFactorWrong = (coinFlip() ? +1 : -1) * randint(1, Math.ceil(nbSides / 2));
|
|
320
|
+
const nodeAngleBaseWrong = frac(PiNode, nbSides);
|
|
321
|
+
const nodeArgumentWrong = multiply(vFactorWrong, nodeAngleBaseWrong);
|
|
322
|
+
const nodeAffixSimplified = createNodeAffixSimplified(nodeModule, nodeArgumentWrong);
|
|
323
|
+
tryToAddWrongProp(propositions, nodeAffixSimplified.toTex());
|
|
324
|
+
});
|
|
325
|
+
return shuffleProps(propositions, n);
|
|
326
|
+
};
|
|
327
|
+
const getKeys = () => {
|
|
328
|
+
return ["epower", "i", "pi"];
|
|
329
|
+
};
|
|
330
|
+
const isAnswerValid = (ans, { answer, ...identifiers }) => {
|
|
331
|
+
try {
|
|
332
|
+
const nodeAns = parseAlgebraic(ans);
|
|
333
|
+
const [nodeModuleAns, nodeArgumentAns] = (() => {
|
|
334
|
+
if (isMultiplyNode(nodeAns)) {
|
|
335
|
+
if (isExpNode(nodeAns.leftChild)) {
|
|
336
|
+
if (isNumberNode(nodeAns.rightChild) ||
|
|
337
|
+
isOppositeNode(nodeAns.rightChild) ||
|
|
338
|
+
isFractionNode(nodeAns.rightChild)) {
|
|
339
|
+
const nodeModule = nodeAns.rightChild;
|
|
340
|
+
const nodeExp = nodeAns.leftChild;
|
|
341
|
+
const nodeArgument = frac(nodeExp.child, nodeI).simplify({
|
|
342
|
+
towardsDistribute: false,
|
|
343
|
+
});
|
|
344
|
+
return [nodeModule, nodeArgument];
|
|
345
|
+
}
|
|
346
|
+
else {
|
|
347
|
+
return [undefined, nodeAns.leftChild];
|
|
348
|
+
}
|
|
349
|
+
}
|
|
350
|
+
else if (isExpNode(nodeAns.rightChild)) {
|
|
351
|
+
if (isNumberNode(nodeAns.leftChild) ||
|
|
352
|
+
isOppositeNode(nodeAns.leftChild) ||
|
|
353
|
+
isFractionNode(nodeAns.leftChild)) {
|
|
354
|
+
const nodeModule = nodeAns.leftChild;
|
|
355
|
+
const nodeExp = nodeAns.rightChild;
|
|
356
|
+
const nodeArgument = frac(nodeExp.child, nodeI).simplify({
|
|
357
|
+
towardsDistribute: false,
|
|
358
|
+
});
|
|
359
|
+
return [nodeModule, nodeArgument];
|
|
360
|
+
}
|
|
361
|
+
else {
|
|
362
|
+
return [undefined, nodeAns.leftChild];
|
|
363
|
+
}
|
|
364
|
+
}
|
|
365
|
+
else {
|
|
366
|
+
return [undefined, nodeAns.leftChild];
|
|
367
|
+
}
|
|
368
|
+
}
|
|
369
|
+
else if (isExpNode(nodeAns)) {
|
|
370
|
+
const nodeExp = nodeAns;
|
|
371
|
+
const nodeArgument = frac(nodeExp.child, nodeI).simplify({
|
|
372
|
+
towardsDistribute: false,
|
|
373
|
+
});
|
|
374
|
+
const nodeModule = (1).toTree();
|
|
375
|
+
return [nodeModule, nodeArgument];
|
|
376
|
+
}
|
|
377
|
+
else {
|
|
378
|
+
return [undefined, undefined];
|
|
379
|
+
}
|
|
380
|
+
})();
|
|
381
|
+
if (nodeModuleAns === undefined || nodeArgumentAns === undefined) {
|
|
382
|
+
return false;
|
|
383
|
+
}
|
|
384
|
+
const { nodeModule: nodeModuleAnswer, nodeArgument: nodeArgumentAnswer } = getHydrated(identifiers);
|
|
385
|
+
const isModuleValid = (nodeModule) => {
|
|
386
|
+
return (NodeComparator.isEqualViaSub(nodeModule, nodeModuleAnswer) ||
|
|
387
|
+
NodeComparator.isEqualViaFrac(nodeModule, nodeModuleAnswer));
|
|
388
|
+
};
|
|
389
|
+
const isArgumentValid = (nodeArgument) => {
|
|
390
|
+
const nodeSub = substract(nodeArgument, nodeArgumentAnswer).simplify({
|
|
391
|
+
towardsDistribute: false,
|
|
392
|
+
});
|
|
393
|
+
const nodeFrac = frac(nodeSub, PiNode).simplify({
|
|
394
|
+
towardsDistribute: false,
|
|
395
|
+
});
|
|
396
|
+
const vFrac = nodeFrac.evaluate();
|
|
397
|
+
return vFrac % 2 === 0;
|
|
398
|
+
};
|
|
399
|
+
const isValid = (nodeModule, nodeArgument) => {
|
|
400
|
+
return isModuleValid(nodeModule) && isArgumentValid(nodeArgument);
|
|
401
|
+
};
|
|
402
|
+
return isValid(nodeModuleAns, nodeArgumentAns);
|
|
403
|
+
//uncomment if you want to allow: m.exp(ia) === (-m).exp(i(a+Pi))
|
|
404
|
+
// ||isValid(
|
|
405
|
+
// multiply(-1, nodeModuleAns).simplify(),
|
|
406
|
+
// add(PiNode, nodeArgumentAns),
|
|
407
|
+
// )
|
|
408
|
+
}
|
|
409
|
+
catch (err) {
|
|
410
|
+
return handleVEAError(err);
|
|
411
|
+
}
|
|
412
|
+
};
|
|
413
|
+
// const createRandomIdentifiers = (opts: Options) => {};
|
|
414
|
+
const getComplexGeomAffixExpFromCenteredRegularPolygonQuestion = () => {
|
|
415
|
+
//pas de 0, 1/4, 1/2, 3/2
|
|
416
|
+
const nbSides = random([5, 7, 9, 11]);
|
|
417
|
+
const vFactor = (coinFlip() ? +1 : -1) * randint(1, Math.ceil(nbSides / 2));
|
|
418
|
+
const nodeModuleM = (() => {
|
|
419
|
+
const vDenModuleM = randint(1, 5);
|
|
420
|
+
const vNumModuleM = randint(1, vDenModuleM + 1);
|
|
421
|
+
return frac(vNumModuleM, vDenModuleM).simplify({
|
|
422
|
+
towardsDistribute: false,
|
|
423
|
+
});
|
|
424
|
+
})();
|
|
425
|
+
const identifiers = {
|
|
426
|
+
nbSides,
|
|
427
|
+
vFactor,
|
|
428
|
+
nodeIdsModule: nodeModuleM.toIdentifiers(),
|
|
429
|
+
};
|
|
430
|
+
return getQuestionFromIdentifiers(identifiers);
|
|
431
|
+
};
|
|
432
|
+
const getQuestionFromIdentifiers = (identifiers, opts) => {
|
|
433
|
+
const question = {
|
|
434
|
+
answer: getAnswer(identifiers),
|
|
435
|
+
instruction: getInstruction(identifiers),
|
|
436
|
+
keys: getKeys(identifiers, opts),
|
|
437
|
+
answerFormat: "tex",
|
|
438
|
+
identifiers,
|
|
439
|
+
hint: getHint(identifiers),
|
|
440
|
+
correction: getCorrection(identifiers),
|
|
441
|
+
correctionGgbOptions: getCorrectionGGBOptions(identifiers),
|
|
442
|
+
ggbOptions: getGGBOptions(identifiers, opts),
|
|
443
|
+
};
|
|
444
|
+
return question;
|
|
445
|
+
};
|
|
446
|
+
export const complexGeomAffixExpFromCenteredRegularPolygon = {
|
|
447
|
+
id: "complexGeomAffixExpFromCenteredRegularPolygon",
|
|
448
|
+
label: "Déterminer l'affixe d'un point sur un polygone régulier centré en l'origine sous forme exponentielle",
|
|
449
|
+
isSingleStep: true,
|
|
450
|
+
generator: (nb, opts) => getDistinctQuestions(() => getComplexGeomAffixExpFromCenteredRegularPolygonQuestion(opts), nb),
|
|
451
|
+
qcmTimer: 60,
|
|
452
|
+
freeTimer: 60,
|
|
453
|
+
isAnswerValid,
|
|
454
|
+
getPropositions,
|
|
455
|
+
subject: "Mathématiques",
|
|
456
|
+
getQuestionFromIdentifiers,
|
|
457
|
+
hasHintAndCorrection: true,
|
|
458
|
+
hasGeogebra: true,
|
|
459
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Exercise } from "../../../../exercises/exercise.js";
|
|
2
|
+
import { NodeIdentifiers } from "../../../../tree/nodes/nodeConstructor.js";
|
|
3
|
+
type Identifiers = {
|
|
4
|
+
nodeIdsModule: NodeIdentifiers;
|
|
5
|
+
nodeIdsArgument: NodeIdentifiers;
|
|
6
|
+
nodeIdsAngleBase: NodeIdentifiers;
|
|
7
|
+
};
|
|
8
|
+
type Options = {
|
|
9
|
+
texAngleBase: string;
|
|
10
|
+
isShouldDisplayAngleBase: boolean;
|
|
11
|
+
};
|
|
12
|
+
export declare const complexGeomAffixExpFromPoint: Exercise<Identifiers, Options>;
|
|
13
|
+
export {};
|
|
14
|
+
//# sourceMappingURL=complexGeomAffixExpFromPoint.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"complexGeomAffixExpFromPoint.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/complex/geometric/complexGeomAffixExpFromPoint.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAmBT,MAAM,6BAA6B,CAAC;AAcrC,OAAO,EAEL,eAAe,EAChB,MAAM,qCAAqC,CAAC;AAiF7C,KAAK,WAAW,GAAG;IACjB,aAAa,EAAE,eAAe,CAAC;IAC/B,eAAe,EAAE,eAAe,CAAC;IACjC,gBAAgB,EAAE,eAAe,CAAC;CACnC,CAAC;AAulBF,KAAK,OAAO,GAAG;IACb,YAAY,EAAE,MAAM,CAAC;IACrB,wBAAwB,EAAE,OAAO,CAAC;CACnC,CAAC;AA0CF,eAAO,MAAM,4BAA4B,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAkBvE,CAAC"}
|