math-exercises 3.0.214 → 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/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 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/conversion/clock/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAGlC,cAAc,2BAA2B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/conversion/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,yBAAyB,CAAC;AACxC,cAAc,uBAAuB,CAAC;AACtC,cAAc,qBAAqB,CAAC;AACpC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,uBAAuB,CAAC;AACtC,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,oCAAoC,CAAC;AACnD,cAAc,qBAAqB,CAAC;AACpC,cAAc,qBAAqB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/conversion/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,yBAAyB,CAAC;AACxC,cAAc,uBAAuB,CAAC;AACtC,cAAc,qBAAqB,CAAC;AACpC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,uBAAuB,CAAC;AACtC,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,oCAAoC,CAAC;AACnD,cAAc,qBAAqB,CAAC;AACpC,cAAc,qBAAqB,CAAC;AAEpC,cAAc,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Exercise } from "../../../../exercises/exercise.js";
|
|
2
|
+
import { AngleIdentifiers } from "../../../../math/geometry/angle.js";
|
|
3
|
+
type Identifiers = {
|
|
4
|
+
angleIds: AngleIdentifiers;
|
|
5
|
+
};
|
|
6
|
+
type Options = {
|
|
7
|
+
availableAngleNature: string;
|
|
8
|
+
};
|
|
9
|
+
export declare const angleNatureFromFigure: Exercise<Identifiers, Options>;
|
|
10
|
+
export {};
|
|
11
|
+
//# sourceMappingURL=angleNatureFromFigure.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"angleNatureFromFigure.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/angles/angleNatureFromFigure.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAiBT,MAAM,6BAA6B,CAAC;AAIrC,OAAO,EAGL,gBAAgB,EACjB,MAAM,8BAA8B,CAAC;AAuEtC,KAAK,WAAW,GAAG;IACjB,QAAQ,EAAE,gBAAgB,CAAC;CAC5B,CAAC;AAqNF,KAAK,OAAO,GAAG;IACb,oBAAoB,EAAE,MAAM,CAAC;CAC9B,CAAC;AAqBF,eAAO,MAAM,qBAAqB,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAuBhE,CAAC"}
|
|
@@ -0,0 +1,233 @@
|
|
|
1
|
+
import { addValidProp, shuffleProps, tryToAddWrongProp, GeneratorOptionTarget, GeneratorOptionType, } from "../../../../exercises/exercise.js";
|
|
2
|
+
import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions.js";
|
|
3
|
+
import { defaultArrayedOptsWhereNeeded } from "../../../../exercises/utils/options/arrayedOptions.js";
|
|
4
|
+
import { GeogebraConstructor } from "../../../../geogebra/geogebraConstructor.js";
|
|
5
|
+
import { Angle, AngleConstructor, } from "../../../../math/geometry/angle.js";
|
|
6
|
+
import { Point } from "../../../../math/geometry/point.js";
|
|
7
|
+
import { Vector } from "../../../../math/geometry/vector.js";
|
|
8
|
+
import { randint } from "../../../../math/utils/random/randint.js";
|
|
9
|
+
import { round } from "../../../../math/utils/round.js";
|
|
10
|
+
import { PiNode } from "../../../../tree/nodes/numbers/piNode.js";
|
|
11
|
+
import { add } from "../../../../tree/nodes/operators/addNode.js";
|
|
12
|
+
import { multiply } from "../../../../tree/nodes/operators/multiplyNode.js";
|
|
13
|
+
import { substract } from "../../../../tree/nodes/operators/substractNode.js";
|
|
14
|
+
import { random } from "../../../../utils/alea/random.js";
|
|
15
|
+
import { mdTable } from "../../../../utils/markdown/mdTable.js";
|
|
16
|
+
const degreesToRadians = (angleInDegrees, precision) => {
|
|
17
|
+
const oneOver180 = 0.00555555555555555;
|
|
18
|
+
return round(multiply(multiply(angleInDegrees, PiNode), oneOver180).evaluate(), precision);
|
|
19
|
+
};
|
|
20
|
+
const rotateVector = (vec, angle, name) => {
|
|
21
|
+
//x' = cos(t)*x -sin(t)*y
|
|
22
|
+
//y' = sin(t)*x + cos(t)*y
|
|
23
|
+
const cos = Math.cos(angle);
|
|
24
|
+
const sin = Math.sin(angle);
|
|
25
|
+
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());
|
|
26
|
+
};
|
|
27
|
+
const rotatePoint = (target, angle, center, name, precision = 2) => {
|
|
28
|
+
const vSrc = createVector(center, target, "vSrc", precision);
|
|
29
|
+
const vRotated = rotateVector(vSrc, angle, "vRotated");
|
|
30
|
+
return createPoint(add(center.x, vRotated.x).evaluate(), add(center.y, vRotated.y).evaluate(), name, precision);
|
|
31
|
+
};
|
|
32
|
+
const createVector = (from, to, name, precision = 5) => {
|
|
33
|
+
return new Vector(name, round(substract(to.x, from.x).evaluate(), precision).toTree(), round(substract(to.y, from.y).evaluate(), precision).toTree());
|
|
34
|
+
};
|
|
35
|
+
const createPoint = (x, y, name, precision = 5) => {
|
|
36
|
+
return new Point(name, round(x, precision), round(y, precision));
|
|
37
|
+
};
|
|
38
|
+
const getInstruction = (_identifiers) => {
|
|
39
|
+
return `Donner la nature de l'angle codé sur la figure ci-dessous.`;
|
|
40
|
+
};
|
|
41
|
+
const getAnswer = (identifiers) => {
|
|
42
|
+
const { angleIds } = identifiers;
|
|
43
|
+
const angle = AngleConstructor.fromIdentifiers(angleIds);
|
|
44
|
+
const measure = angle.evaluate();
|
|
45
|
+
if (measure < 0) {
|
|
46
|
+
throw new Error("Unsupported measure: " + measure);
|
|
47
|
+
}
|
|
48
|
+
else if (measure === 0) {
|
|
49
|
+
return "nul";
|
|
50
|
+
}
|
|
51
|
+
else if (measure < 90) {
|
|
52
|
+
return "aigu";
|
|
53
|
+
}
|
|
54
|
+
else if (measure === 90) {
|
|
55
|
+
return "droit";
|
|
56
|
+
}
|
|
57
|
+
else if (measure < 180) {
|
|
58
|
+
return "obtus";
|
|
59
|
+
}
|
|
60
|
+
else if (measure === 180) {
|
|
61
|
+
return "plat";
|
|
62
|
+
}
|
|
63
|
+
else if (measure === 360) {
|
|
64
|
+
return "plein";
|
|
65
|
+
}
|
|
66
|
+
else {
|
|
67
|
+
throw new Error("Unsupported measure: " + measure);
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
const getHint = () => {
|
|
71
|
+
return `Si on range les mesures d'angle par ordre croissant, un angle est soit nul, soit aigu, soit droit, soit obtus, soit plat, soit plein.`;
|
|
72
|
+
};
|
|
73
|
+
const getCorrection = (identifiers) => {
|
|
74
|
+
const { angleIds } = identifiers;
|
|
75
|
+
const angle = AngleConstructor.fromIdentifiers(angleIds);
|
|
76
|
+
const measure = angle.evaluate();
|
|
77
|
+
return `Voici un tableau récapitulatif :
|
|
78
|
+
|
|
79
|
+
${mdTable([
|
|
80
|
+
["\\text{Mesure } m", "\\text{Nature}"],
|
|
81
|
+
["m=0°", "\\text{nul}"],
|
|
82
|
+
["0°<m<90°", "\\text{aigu}"],
|
|
83
|
+
["m=90°", "\\text{droit}"],
|
|
84
|
+
["90°<m<180°", "\\text{obtus}"],
|
|
85
|
+
["m=180°", "\\text{plat}"],
|
|
86
|
+
["m=360°", "\\text{plein}"],
|
|
87
|
+
], true)}
|
|
88
|
+
|
|
89
|
+
Ici l'angle fait $${measure.frenchify()}°$ donc c'est un angle ${getAnswer(identifiers)}.`;
|
|
90
|
+
};
|
|
91
|
+
const getCorrectionGGBOptions = (identifiers) => {
|
|
92
|
+
const { angleIds } = identifiers;
|
|
93
|
+
const angle = AngleConstructor.fromIdentifiers(angleIds);
|
|
94
|
+
const ggb = new GeogebraConstructor({
|
|
95
|
+
hideAxes: true,
|
|
96
|
+
isGridSimple: true,
|
|
97
|
+
commands: [
|
|
98
|
+
...angle.points.flatMap((point) => point.toGGBCommand({ isVisible: false })),
|
|
99
|
+
...angle.toCommands({ pointsAreNotBuilt: false, showValue: true }),
|
|
100
|
+
],
|
|
101
|
+
fontSize: 16,
|
|
102
|
+
});
|
|
103
|
+
return ggb.getOptions({
|
|
104
|
+
coords: ggb.getCoordsForPoints([...angle.points]),
|
|
105
|
+
});
|
|
106
|
+
};
|
|
107
|
+
const getGGBOptions = (identifiers) => {
|
|
108
|
+
const { angleIds } = identifiers;
|
|
109
|
+
const angle = AngleConstructor.fromIdentifiers(angleIds);
|
|
110
|
+
const measure = angle.evaluate();
|
|
111
|
+
const [pointA, pointB, pointC] = angle.points;
|
|
112
|
+
const ggb = new GeogebraConstructor({
|
|
113
|
+
hideAxes: true,
|
|
114
|
+
isGridSimple: true,
|
|
115
|
+
commands: [
|
|
116
|
+
...angle.points.flatMap((point) => point.toGGBCommand({ isVisible: false })),
|
|
117
|
+
`ray1 = Ray(${pointB.toMathString()}, ${pointA.toMathString()})`,
|
|
118
|
+
`ray2 = Ray(${pointB.toMathString()}, ${pointC.toMathString()})`,
|
|
119
|
+
//we must display a right angle when measure is equal to 90 degrees
|
|
120
|
+
...(() => {
|
|
121
|
+
if (measure === 90) {
|
|
122
|
+
return [
|
|
123
|
+
`per = PerpendicularLine(${pointB.name}, ray1)`,
|
|
124
|
+
`SetVisibleInView(per, 1, false)`,
|
|
125
|
+
`ang = Angle(ray1, per)`,
|
|
126
|
+
`ShowLabel(ang, false)`,
|
|
127
|
+
];
|
|
128
|
+
}
|
|
129
|
+
else {
|
|
130
|
+
return angle.toCommands({ pointsAreNotBuilt: false });
|
|
131
|
+
}
|
|
132
|
+
})(),
|
|
133
|
+
],
|
|
134
|
+
fontSize: 16,
|
|
135
|
+
});
|
|
136
|
+
return ggb.getOptions({
|
|
137
|
+
coords: ggb.getCoordsForPoints([...angle.points]),
|
|
138
|
+
});
|
|
139
|
+
};
|
|
140
|
+
const getPropositions = (n, { answer }, _optsIn) => {
|
|
141
|
+
const propositions = [];
|
|
142
|
+
addValidProp(propositions, answer, "raw");
|
|
143
|
+
["aigu", "obtus", "droit", "plat", "plein" /*,"nul"*/].forEach((strNatureOfAngle) => {
|
|
144
|
+
tryToAddWrongProp(propositions, strNatureOfAngle, "raw");
|
|
145
|
+
});
|
|
146
|
+
return shuffleProps(propositions, n);
|
|
147
|
+
};
|
|
148
|
+
const getAngleNatureFromFigureQuestion = (optsIn) => {
|
|
149
|
+
const arrayedOpts = defaultArrayedOptsWhereNeeded(optsIn, arrayedOptsDefault);
|
|
150
|
+
const opts = {
|
|
151
|
+
availableAngleNature: random(arrayedOpts.availableAngleNature),
|
|
152
|
+
};
|
|
153
|
+
const measure = (() => {
|
|
154
|
+
switch (opts.availableAngleNature) {
|
|
155
|
+
// case "nul":
|
|
156
|
+
// return 0;
|
|
157
|
+
case "aigu":
|
|
158
|
+
return randint(15, 75);
|
|
159
|
+
case "droit":
|
|
160
|
+
return 90;
|
|
161
|
+
case "obtus":
|
|
162
|
+
return randint(105, 165);
|
|
163
|
+
case "plat":
|
|
164
|
+
return 180;
|
|
165
|
+
case "plein":
|
|
166
|
+
return 360;
|
|
167
|
+
default:
|
|
168
|
+
throw new Error("Unsupported opts.availableAngleNature: " + opts.availableAngleNature);
|
|
169
|
+
}
|
|
170
|
+
})();
|
|
171
|
+
const pointB = new Point("B", 0, 0);
|
|
172
|
+
const pointA = (() => {
|
|
173
|
+
const angleOffset = randint(0, 360);
|
|
174
|
+
const pointARaw = new Point("A", 15, 0);
|
|
175
|
+
return rotatePoint(pointARaw, degreesToRadians(angleOffset, 5), pointB, "A", 5);
|
|
176
|
+
})();
|
|
177
|
+
const pointC = rotatePoint(pointA, degreesToRadians(measure, 5), pointB, "C", 5);
|
|
178
|
+
const angle = new Angle([pointA, pointB, pointC], {
|
|
179
|
+
degreeValueNode: measure.toTree(),
|
|
180
|
+
});
|
|
181
|
+
const identifiers = {
|
|
182
|
+
angleIds: angle.toIdentifiers(),
|
|
183
|
+
};
|
|
184
|
+
return getQuestionFromIdentifiers(identifiers);
|
|
185
|
+
};
|
|
186
|
+
const getQuestionFromIdentifiers = (identifiers) => {
|
|
187
|
+
const question = {
|
|
188
|
+
answer: getAnswer(identifiers),
|
|
189
|
+
instruction: getInstruction(identifiers),
|
|
190
|
+
keys: [],
|
|
191
|
+
answerFormat: "raw",
|
|
192
|
+
identifiers,
|
|
193
|
+
hint: getHint(identifiers),
|
|
194
|
+
correction: getCorrection(identifiers),
|
|
195
|
+
correctionGgbOptions: getCorrectionGGBOptions(identifiers),
|
|
196
|
+
ggbOptions: getGGBOptions(identifiers),
|
|
197
|
+
};
|
|
198
|
+
return question;
|
|
199
|
+
};
|
|
200
|
+
const arrayedOptsDefault = {
|
|
201
|
+
availableAngleNature: ["aigu", "droit", "obtus", "plat"],
|
|
202
|
+
};
|
|
203
|
+
const options = [
|
|
204
|
+
{
|
|
205
|
+
id: "availableAngleNature",
|
|
206
|
+
label: "Mesure minimum",
|
|
207
|
+
target: GeneratorOptionTarget.generation,
|
|
208
|
+
type: GeneratorOptionType.multiselect,
|
|
209
|
+
values: [/*"nul",*/ "aigu", "droit", "obtus", "plat", "plein"],
|
|
210
|
+
defaultValue: arrayedOptsDefault.availableAngleNature,
|
|
211
|
+
},
|
|
212
|
+
];
|
|
213
|
+
export const angleNatureFromFigure = {
|
|
214
|
+
id: "angleNatureFromFigure",
|
|
215
|
+
label: "Déterminer la nature d'un angle à partir d'une figure",
|
|
216
|
+
isSingleStep: true,
|
|
217
|
+
generator: (nb, opts) => getDistinctQuestions(() => getAngleNatureFromFigureQuestion(opts), nb),
|
|
218
|
+
options,
|
|
219
|
+
validateOptions: (opts) => {
|
|
220
|
+
return {
|
|
221
|
+
valid: !!(opts?.availableAngleNature && opts?.availableAngleNature.length > 0),
|
|
222
|
+
message: "Veuillez choisir au moins une nature d'angle.",
|
|
223
|
+
};
|
|
224
|
+
},
|
|
225
|
+
qcmTimer: 60,
|
|
226
|
+
freeTimer: 60,
|
|
227
|
+
getPropositions,
|
|
228
|
+
subject: "Mathématiques",
|
|
229
|
+
getQuestionFromIdentifiers,
|
|
230
|
+
answerType: "QCU",
|
|
231
|
+
hasHintAndCorrection: true,
|
|
232
|
+
hasGeogebra: true,
|
|
233
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Exercise } from "../../../../exercises/exercise.js";
|
|
2
|
+
type Identifiers = {
|
|
3
|
+
measure: number;
|
|
4
|
+
};
|
|
5
|
+
type Options = {
|
|
6
|
+
availableAngleNature: string;
|
|
7
|
+
};
|
|
8
|
+
export declare const angleNatureFromMeasure: Exercise<Identifiers, Options>;
|
|
9
|
+
export {};
|
|
10
|
+
//# sourceMappingURL=angleNatureFromMeasure.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"angleNatureFromMeasure.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/angles/angleNatureFromMeasure.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAgBT,MAAM,6BAA6B,CAAC;AAOrC,KAAK,WAAW,GAAG;IACjB,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AA8HF,KAAK,OAAO,GAAG;IACb,oBAAoB,EAAE,MAAM,CAAC;CAC9B,CAAC;AAqBF,eAAO,MAAM,sBAAsB,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAsBjE,CAAC"}
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
import { addValidProp, shuffleProps, tryToAddWrongProp, GeneratorOptionTarget, GeneratorOptionType, } from "../../../../exercises/exercise.js";
|
|
2
|
+
import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions.js";
|
|
3
|
+
import { defaultArrayedOptsWhereNeeded } from "../../../../exercises/utils/options/arrayedOptions.js";
|
|
4
|
+
import { randint } from "../../../../math/utils/random/randint.js";
|
|
5
|
+
import { random } from "../../../../utils/alea/random.js";
|
|
6
|
+
import { mdTable } from "../../../../utils/markdown/mdTable.js";
|
|
7
|
+
const getInstruction = (identifiers) => {
|
|
8
|
+
const { measure } = identifiers;
|
|
9
|
+
return `Donner la nature d'un angle mesurant $${measure.frenchify()}°$.`;
|
|
10
|
+
};
|
|
11
|
+
const getAnswer = (identifiers) => {
|
|
12
|
+
const { measure } = identifiers;
|
|
13
|
+
if (measure < 0) {
|
|
14
|
+
throw new Error("Unsupported measure: " + measure);
|
|
15
|
+
}
|
|
16
|
+
else if (measure === 0) {
|
|
17
|
+
return "nul";
|
|
18
|
+
}
|
|
19
|
+
else if (measure < 90) {
|
|
20
|
+
return "aigu";
|
|
21
|
+
}
|
|
22
|
+
else if (measure === 90) {
|
|
23
|
+
return "droit";
|
|
24
|
+
}
|
|
25
|
+
else if (measure < 180) {
|
|
26
|
+
return "obtus";
|
|
27
|
+
}
|
|
28
|
+
else if (measure === 180) {
|
|
29
|
+
return "plat";
|
|
30
|
+
}
|
|
31
|
+
else if (measure === 360) {
|
|
32
|
+
return "plein";
|
|
33
|
+
}
|
|
34
|
+
else {
|
|
35
|
+
throw new Error("Unsupported measure: " + measure);
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
const getHint = () => {
|
|
39
|
+
return `Si on range les mesures d'angle par ordre croissant, un angle est soit nul, soit aigu, soit droit, soit obtus, soit plat, soit plein.`;
|
|
40
|
+
};
|
|
41
|
+
const getCorrection = (identifiers) => {
|
|
42
|
+
const { measure } = identifiers;
|
|
43
|
+
return `Voici un tableau récapitulatif :
|
|
44
|
+
|
|
45
|
+
${mdTable([
|
|
46
|
+
["\\text{Mesure } m", "\\text{Nature}"],
|
|
47
|
+
["m=0°", "\\text{nul}"],
|
|
48
|
+
["0°<m<90°", "\\text{aigu}"],
|
|
49
|
+
["m=90°", "\\text{droit}"],
|
|
50
|
+
["90°<m<180°", "\\text{obtus}"],
|
|
51
|
+
["m=180°", "\\text{plat}"],
|
|
52
|
+
["m=360°", "\\text{plein}"],
|
|
53
|
+
], true)}
|
|
54
|
+
|
|
55
|
+
Ici l'angle fait $${measure.frenchify()}°$ donc c'est un angle ${getAnswer(identifiers)}.`;
|
|
56
|
+
};
|
|
57
|
+
const getPropositions = (n, { answer }, _optsIn) => {
|
|
58
|
+
const propositions = [];
|
|
59
|
+
addValidProp(propositions, answer, "raw");
|
|
60
|
+
["aigu", "obtus", "droit", "plat", "plein", "nul"].forEach((strNatureOfAngle) => {
|
|
61
|
+
tryToAddWrongProp(propositions, strNatureOfAngle, "raw");
|
|
62
|
+
});
|
|
63
|
+
return shuffleProps(propositions, n);
|
|
64
|
+
};
|
|
65
|
+
const getAngleNatureFromMeasureQuestion = (optsIn) => {
|
|
66
|
+
const arrayedOpts = defaultArrayedOptsWhereNeeded(optsIn, arrayedOptsDefault);
|
|
67
|
+
const opts = {
|
|
68
|
+
availableAngleNature: random(arrayedOpts.availableAngleNature),
|
|
69
|
+
};
|
|
70
|
+
const measure = (() => {
|
|
71
|
+
switch (opts.availableAngleNature) {
|
|
72
|
+
case "nul":
|
|
73
|
+
return 0;
|
|
74
|
+
case "aigu":
|
|
75
|
+
return randint(1, 90);
|
|
76
|
+
case "droit":
|
|
77
|
+
return 90;
|
|
78
|
+
case "obtus":
|
|
79
|
+
return randint(90, 180);
|
|
80
|
+
case "plat":
|
|
81
|
+
return 180;
|
|
82
|
+
case "plein":
|
|
83
|
+
return 360;
|
|
84
|
+
default:
|
|
85
|
+
throw new Error("Unsupported opts.availableAngleNature: " + opts.availableAngleNature);
|
|
86
|
+
}
|
|
87
|
+
})();
|
|
88
|
+
const identifiers = {
|
|
89
|
+
measure,
|
|
90
|
+
};
|
|
91
|
+
return getQuestionFromIdentifiers(identifiers);
|
|
92
|
+
};
|
|
93
|
+
const getQuestionFromIdentifiers = (identifiers) => {
|
|
94
|
+
const question = {
|
|
95
|
+
answer: getAnswer(identifiers),
|
|
96
|
+
instruction: getInstruction(identifiers),
|
|
97
|
+
keys: [],
|
|
98
|
+
answerFormat: "raw",
|
|
99
|
+
identifiers,
|
|
100
|
+
hint: getHint(identifiers),
|
|
101
|
+
correction: getCorrection(identifiers),
|
|
102
|
+
};
|
|
103
|
+
return question;
|
|
104
|
+
};
|
|
105
|
+
const arrayedOptsDefault = {
|
|
106
|
+
availableAngleNature: ["aigu", "droit", "obtus", "plat"],
|
|
107
|
+
};
|
|
108
|
+
const options = [
|
|
109
|
+
{
|
|
110
|
+
id: "availableAngleNature",
|
|
111
|
+
label: "Mesure minimum",
|
|
112
|
+
target: GeneratorOptionTarget.generation,
|
|
113
|
+
type: GeneratorOptionType.multiselect,
|
|
114
|
+
values: ["nul", "aigu", "droit", "obtus", "plat", "plein"],
|
|
115
|
+
defaultValue: arrayedOptsDefault.availableAngleNature,
|
|
116
|
+
},
|
|
117
|
+
];
|
|
118
|
+
export const angleNatureFromMeasure = {
|
|
119
|
+
id: "angleNatureFromMeasure",
|
|
120
|
+
label: "Déterminer la nature d'un angle à partir de sa mesure",
|
|
121
|
+
isSingleStep: true,
|
|
122
|
+
generator: (nb, opts) => getDistinctQuestions(() => getAngleNatureFromMeasureQuestion(opts), nb),
|
|
123
|
+
options,
|
|
124
|
+
validateOptions: (opts) => {
|
|
125
|
+
return {
|
|
126
|
+
valid: !!(opts?.availableAngleNature && opts?.availableAngleNature.length > 0),
|
|
127
|
+
message: "Veuillez choisir au moins une nature d'angle.",
|
|
128
|
+
};
|
|
129
|
+
},
|
|
130
|
+
qcmTimer: 60,
|
|
131
|
+
freeTimer: 60,
|
|
132
|
+
getPropositions,
|
|
133
|
+
subject: "Mathématiques",
|
|
134
|
+
getQuestionFromIdentifiers,
|
|
135
|
+
answerType: "QCU",
|
|
136
|
+
hasHintAndCorrection: true,
|
|
137
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/angles/index.ts"],"names":[],"mappings":"AAAA,cAAc,yBAAyB,CAAC;AACxC,cAAc,+BAA+B,CAAC;AAE9C,cAAc,4BAA4B,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/angles/index.ts"],"names":[],"mappings":"AAAA,cAAc,yBAAyB,CAAC;AACxC,cAAc,+BAA+B,CAAC;AAE9C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,4BAA4B,CAAC"}
|
|
@@ -2,3 +2,5 @@ export * from "./recognizeAngleType.js";
|
|
|
2
2
|
export * from "./parallelogramFourthAngle.js";
|
|
3
3
|
//export * from "./isParallelUsingAngles.js";
|
|
4
4
|
export * from "./anglesUsingIsParallel.js";
|
|
5
|
+
export * from "./angleNatureFromMeasure.js";
|
|
6
|
+
export * from "./angleNatureFromFigure.js";
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Exercise } from "../../../../exercises/exercise.js";
|
|
2
|
+
type Identifiers = {
|
|
3
|
+
radius: number;
|
|
4
|
+
isGivenDiameter: boolean;
|
|
5
|
+
randPositionRadius: number;
|
|
6
|
+
};
|
|
7
|
+
export declare const buildCircleFromRadius: Exercise<Identifiers>;
|
|
8
|
+
export {};
|
|
9
|
+
//# sourceMappingURL=buildCircleFromRadius.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"buildCircleFromRadius.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/circles/buildCircleFromRadius.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAWT,MAAM,6BAA6B,CAAC;AAerC,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,eAAe,EAAE,OAAO,CAAC;IACzB,kBAAkB,EAAE,MAAM,CAAC;CAC5B,CAAC;AAyMF,eAAO,MAAM,qBAAqB,EAAE,QAAQ,CAAC,WAAW,CAevD,CAAC"}
|
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
import { toolBarConstructor } from "../../../../exercises/utils/geogebra/toolBarConstructor.js";
|
|
2
|
+
import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions.js";
|
|
3
|
+
import { blueMain, greenMain, orange } from "../../../../geogebra/colors.js";
|
|
4
|
+
import { GeogebraConstructor } from "../../../../geogebra/geogebraConstructor.js";
|
|
5
|
+
import { GeogebraParser } from "../../../../geogebra/parsers/geogebraParser.js";
|
|
6
|
+
import { Point, PointConstructor } from "../../../../math/geometry/point.js";
|
|
7
|
+
import { Segment } from "../../../../math/geometry/segment.js";
|
|
8
|
+
import { Vector } from "../../../../math/geometry/vector.js";
|
|
9
|
+
import { randint } from "../../../../math/utils/random/randint.js";
|
|
10
|
+
import { abs } from "../../../../tree/nodes/functions/absNode.js";
|
|
11
|
+
import { substract } from "../../../../tree/nodes/operators/substractNode.js";
|
|
12
|
+
import { coinFlip } from "../../../../utils/alea/coinFlip.js";
|
|
13
|
+
import { random } from "../../../../utils/alea/random.js";
|
|
14
|
+
const getInstruction = (identifiers) => {
|
|
15
|
+
const { radius, isGivenDiameter } = identifiers;
|
|
16
|
+
if (isGivenDiameter) {
|
|
17
|
+
const diameter = 2 * radius;
|
|
18
|
+
return `Avec les outils disponibles, construire un cercle de diamètre $${diameter}$.`;
|
|
19
|
+
}
|
|
20
|
+
else {
|
|
21
|
+
return `Avec les outils disponibles, construire un cercle de rayon $${radius}$.`;
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
const getAnswerPoints = (identifiers) => {
|
|
25
|
+
const { radius, randPositionRadius } = identifiers;
|
|
26
|
+
const pointCenter = new Point("A", (0).toTree(), (0).toTree());
|
|
27
|
+
const vectorOffset = (() => {
|
|
28
|
+
switch (randPositionRadius) {
|
|
29
|
+
case 0:
|
|
30
|
+
case 5:
|
|
31
|
+
return new Vector("vOffset", radius.toTree(), (0).toTree());
|
|
32
|
+
case 1:
|
|
33
|
+
case 4:
|
|
34
|
+
return new Vector("vOffset", (-radius).toTree(), (0).toTree());
|
|
35
|
+
case 2:
|
|
36
|
+
case 7:
|
|
37
|
+
return new Vector("vOffset", (0).toTree(), radius.toTree());
|
|
38
|
+
case 3:
|
|
39
|
+
case 6:
|
|
40
|
+
return new Vector("vOffset", (0).toTree(), (-radius).toTree());
|
|
41
|
+
default:
|
|
42
|
+
throw new Error("Unsupported randPositionRadius: " + randPositionRadius);
|
|
43
|
+
}
|
|
44
|
+
})();
|
|
45
|
+
const pointOnCircle = vectorOffset.getEndPoint(pointCenter, "B");
|
|
46
|
+
return [pointCenter, pointOnCircle];
|
|
47
|
+
};
|
|
48
|
+
const getGGBAnswer = (identifiers) => {
|
|
49
|
+
const [pointCenter, pointOnCircle] = getAnswerPoints(identifiers);
|
|
50
|
+
const ggbAnswer = [
|
|
51
|
+
...pointCenter.toGGBCommand({ showLabel: false }),
|
|
52
|
+
...pointOnCircle.toGGBCommand({ showLabel: false }),
|
|
53
|
+
`C_1 = Circle(${pointCenter.name},${pointOnCircle.name})`,
|
|
54
|
+
`SetColor(C_1, "${greenMain}")`,
|
|
55
|
+
];
|
|
56
|
+
return ggbAnswer;
|
|
57
|
+
};
|
|
58
|
+
const getHint = () => {
|
|
59
|
+
return `La longueur d'un diamètre est le double de celle d'un rayon. L'énoncé ne précise pas de centre donc on peut tracer un cercle où l'on veut.`;
|
|
60
|
+
};
|
|
61
|
+
const getCorrection = (identifiers) => {
|
|
62
|
+
const { radius } = identifiers;
|
|
63
|
+
return `On sélectionne l'outil Cercle dans la barre d'outils Geogebra et on trace un cercle de rayon $${radius}$.`;
|
|
64
|
+
};
|
|
65
|
+
const getCorrectionGGBOptions = (identifiers) => {
|
|
66
|
+
const [pointCenter, pointOnCircle1] = getAnswerPoints(identifiers);
|
|
67
|
+
const pointOnCircle2 = (() => {
|
|
68
|
+
const [_, pointOnCircle2] = getAnswerPoints({
|
|
69
|
+
...identifiers,
|
|
70
|
+
randPositionRadius: identifiers.randPositionRadius + 4,
|
|
71
|
+
});
|
|
72
|
+
pointOnCircle2.name = "D";
|
|
73
|
+
return pointOnCircle2;
|
|
74
|
+
})();
|
|
75
|
+
const segmentR = new Segment(pointCenter, pointOnCircle1);
|
|
76
|
+
const segmentD = new Segment(pointOnCircle1, pointOnCircle2);
|
|
77
|
+
const ggb = new GeogebraConstructor({
|
|
78
|
+
commands: [
|
|
79
|
+
...getGGBAnswer(identifiers),
|
|
80
|
+
...pointOnCircle2.toGGBCommand({ showLabel: false }),
|
|
81
|
+
//segmentR
|
|
82
|
+
...segmentR.toGGBCommands(false, {
|
|
83
|
+
showLength: true,
|
|
84
|
+
thickness: 5,
|
|
85
|
+
color: `"${orange}"`,
|
|
86
|
+
}),
|
|
87
|
+
//segmentD
|
|
88
|
+
...segmentD.toGGBCommands(false, {
|
|
89
|
+
showLength: true,
|
|
90
|
+
thickness: 2,
|
|
91
|
+
color: `"${blueMain}"`,
|
|
92
|
+
}),
|
|
93
|
+
],
|
|
94
|
+
hideAxes: true,
|
|
95
|
+
isGridSimple: true,
|
|
96
|
+
fontSize: 16,
|
|
97
|
+
});
|
|
98
|
+
return ggb.getOptions({
|
|
99
|
+
coords: ggb.getCoordsForPoints([
|
|
100
|
+
pointCenter,
|
|
101
|
+
pointOnCircle1,
|
|
102
|
+
pointOnCircle2,
|
|
103
|
+
]),
|
|
104
|
+
});
|
|
105
|
+
};
|
|
106
|
+
const getStudentGGBOptions = (_identifiers) => {
|
|
107
|
+
const studentGGB = new GeogebraConstructor({
|
|
108
|
+
commands: [],
|
|
109
|
+
hideGrid: false,
|
|
110
|
+
hideAxes: true,
|
|
111
|
+
customToolBar: toolBarConstructor({
|
|
112
|
+
circleTwoPoints: true,
|
|
113
|
+
}),
|
|
114
|
+
});
|
|
115
|
+
const xMin = -5;
|
|
116
|
+
const xMax = 5;
|
|
117
|
+
const yMin = -5;
|
|
118
|
+
const yMax = 5;
|
|
119
|
+
return studentGGB.getOptions({
|
|
120
|
+
coords: [xMin, xMax, yMin, yMax],
|
|
121
|
+
});
|
|
122
|
+
};
|
|
123
|
+
const isGGBAnswerValid = (ans, { ggbAnswer, ...identifiers }) => {
|
|
124
|
+
const { radius } = identifiers;
|
|
125
|
+
const commands = ans;
|
|
126
|
+
const ggbParser = new GeogebraParser(commands);
|
|
127
|
+
const objectDict = ggbParser.objectDict();
|
|
128
|
+
const arrStrCircle = Object.entries(objectDict)
|
|
129
|
+
.filter(([_, strObj]) => strObj.startsWith("Circle"))
|
|
130
|
+
.map(([_, strObj]) => strObj);
|
|
131
|
+
if (arrStrCircle.length !== 1) {
|
|
132
|
+
return false;
|
|
133
|
+
}
|
|
134
|
+
const [strCircle] = arrStrCircle;
|
|
135
|
+
const [namePoint1, namePoint2] = GeogebraParser.pointNamesForCircleObj(strCircle);
|
|
136
|
+
const [coordsPoint1, coordsPoint2] = [namePoint1, namePoint2].map((name) => ggbParser.pointCoords(name));
|
|
137
|
+
const [point1, point2] = [coordsPoint1, coordsPoint2].map((coords, i) => PointConstructor.fromCoords(coords, `P${i}`));
|
|
138
|
+
const isRadiusValid = abs(substract(point1.distanceTo(point2), radius)).evaluate() < 0.01;
|
|
139
|
+
return isRadiusValid;
|
|
140
|
+
};
|
|
141
|
+
const getBuildCircleFromRadiusQuestion = () => {
|
|
142
|
+
const isGivenDiameter = coinFlip();
|
|
143
|
+
const radius = (() => {
|
|
144
|
+
if (isGivenDiameter) {
|
|
145
|
+
return random([2, 4, 6, 8, 10, 12, 14]);
|
|
146
|
+
}
|
|
147
|
+
else {
|
|
148
|
+
return randint(2, 9);
|
|
149
|
+
}
|
|
150
|
+
})();
|
|
151
|
+
const randPositionRadius = randint(0, 4);
|
|
152
|
+
const identifiers = {
|
|
153
|
+
radius,
|
|
154
|
+
isGivenDiameter,
|
|
155
|
+
randPositionRadius,
|
|
156
|
+
};
|
|
157
|
+
return getQuestionFromIdentifiers(identifiers);
|
|
158
|
+
};
|
|
159
|
+
const getQuestionFromIdentifiers = (identifiers) => {
|
|
160
|
+
const question = {
|
|
161
|
+
ggbAnswer: getGGBAnswer(identifiers),
|
|
162
|
+
instruction: getInstruction(identifiers),
|
|
163
|
+
keys: [],
|
|
164
|
+
answerFormat: "tex",
|
|
165
|
+
identifiers,
|
|
166
|
+
studentGgbOptions: getStudentGGBOptions(identifiers),
|
|
167
|
+
hint: getHint(identifiers),
|
|
168
|
+
correction: getCorrection(identifiers),
|
|
169
|
+
correctionGgbOptions: getCorrectionGGBOptions(identifiers),
|
|
170
|
+
};
|
|
171
|
+
return question;
|
|
172
|
+
};
|
|
173
|
+
export const buildCircleFromRadius = {
|
|
174
|
+
id: "buildCircleFromRadius",
|
|
175
|
+
connector: "=",
|
|
176
|
+
label: "Tracer un cercle de rayon ou de diamètre donné",
|
|
177
|
+
isSingleStep: true,
|
|
178
|
+
generator: (nb) => getDistinctQuestions(getBuildCircleFromRadiusQuestion, nb),
|
|
179
|
+
ggbTimer: 60,
|
|
180
|
+
isGGBAnswerValid,
|
|
181
|
+
subject: "Mathématiques",
|
|
182
|
+
answerType: "GGB",
|
|
183
|
+
getQuestionFromIdentifiers,
|
|
184
|
+
getHint,
|
|
185
|
+
getCorrection,
|
|
186
|
+
hasHintAndCorrection: true,
|
|
187
|
+
};
|
|
@@ -4,4 +4,5 @@ export * from "./circleCenterAndRadiusFromEquation.js";
|
|
|
4
4
|
export * from "./circleCanonicalEquationFromDevEquation.js";
|
|
5
5
|
export * from "./circleEquationFromDiameter.js";
|
|
6
6
|
export * from "./circleRadiusOrCenterFromDevEquation.js";
|
|
7
|
+
export * from "./buildCircleFromRadius.js";
|
|
7
8
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/circles/index.ts"],"names":[],"mappings":"AAAA,cAAc,2CAA2C,CAAC;AAC1D,cAAc,uCAAuC,CAAC;AACtD,cAAc,wCAAwC,CAAC;AACvD,cAAc,6CAA6C,CAAC;AAC5D,cAAc,iCAAiC,CAAC;AAChD,cAAc,0CAA0C,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/circles/index.ts"],"names":[],"mappings":"AAAA,cAAc,2CAA2C,CAAC;AAC1D,cAAc,uCAAuC,CAAC;AACtD,cAAc,wCAAwC,CAAC;AACvD,cAAc,6CAA6C,CAAC;AAC5D,cAAc,iCAAiC,CAAC;AAChD,cAAc,0CAA0C,CAAC;AACzD,cAAc,4BAA4B,CAAC"}
|