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,485 @@
|
|
|
1
|
+
import { addValidProp, shuffleProps, tryToAddWrongProp, GeneratorOptionTarget, GeneratorOptionType, } from "../../../../exercises/exercise.js";
|
|
2
|
+
import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions.js";
|
|
3
|
+
import { blueDark, 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 { nodeBySubstitutingVar } from "../../../../math/utils/functions/functionComposition.js";
|
|
8
|
+
import { createTypeAngleSectorNWSESecondary } from "../../../../math/utils/geometry/angleNWSE.js";
|
|
9
|
+
import { randfloat } from "../../../../math/utils/random/randfloat.js";
|
|
10
|
+
import { randint } from "../../../../math/utils/random/randint.js";
|
|
11
|
+
import { round } from "../../../../math/utils/round.js";
|
|
12
|
+
import { cos } from "../../../../tree/nodes/functions/cosNode.js";
|
|
13
|
+
import { sin } from "../../../../tree/nodes/functions/sinNode.js";
|
|
14
|
+
import { isSqrtNode, sqrt } from "../../../../tree/nodes/functions/sqrtNode.js";
|
|
15
|
+
import { NodeConstructor, } from "../../../../tree/nodes/nodeConstructor.js";
|
|
16
|
+
import { PiNode } from "../../../../tree/nodes/numbers/piNode.js";
|
|
17
|
+
import { add } from "../../../../tree/nodes/operators/addNode.js";
|
|
18
|
+
import { frac, isFractionNode, } from "../../../../tree/nodes/operators/fractionNode.js";
|
|
19
|
+
import { multiply } from "../../../../tree/nodes/operators/multiplyNode.js";
|
|
20
|
+
import { square } from "../../../../tree/nodes/operators/powerNode.js";
|
|
21
|
+
import { substract } from "../../../../tree/nodes/operators/substractNode.js";
|
|
22
|
+
import { VariableNode } from "../../../../tree/nodes/variables/variableNode.js";
|
|
23
|
+
import { parseAlgebraic } from "../../../../tree/parsers/latexParser.js";
|
|
24
|
+
import { NodeComparator } from "../../../../tree/utilities/nodeComparator.js";
|
|
25
|
+
import { coinFlip } from "../../../../utils/alea/coinFlip.js";
|
|
26
|
+
import { probaFlip } from "../../../../utils/alea/probaFlip.js";
|
|
27
|
+
import { random } from "../../../../utils/alea/random.js";
|
|
28
|
+
import { handleVEAError } from "../../../../utils/errors/handleVEAError.js";
|
|
29
|
+
//TODO: frac does not simplify "i"
|
|
30
|
+
// const nodeI = new ComplexNode((0).toTree(), (1).toTree());
|
|
31
|
+
const nodeI = new VariableNode("i");
|
|
32
|
+
const _degreesToRadians = (angleInDegrees, precision) => {
|
|
33
|
+
const oneOver180 = 0.00555555555555555;
|
|
34
|
+
return round(multiply(multiply(angleInDegrees, PiNode), oneOver180).evaluate(), precision);
|
|
35
|
+
};
|
|
36
|
+
const rotateVector = (vec, angle, name) => {
|
|
37
|
+
//x' = cos(t)*x -sin(t)*y
|
|
38
|
+
//y' = sin(t)*x + cos(t)*y
|
|
39
|
+
const cos = Math.cos(angle);
|
|
40
|
+
const sin = Math.sin(angle);
|
|
41
|
+
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());
|
|
42
|
+
};
|
|
43
|
+
const rotatePoint = (target, angle, center, name, precision = 2) => {
|
|
44
|
+
const vSrc = createVector(center, target, "vSrc", precision);
|
|
45
|
+
const vRotated = rotateVector(vSrc, angle, "vRotated");
|
|
46
|
+
return createPoint(add(center.x, vRotated.x).evaluate(), add(center.y, vRotated.y).evaluate(), name, precision);
|
|
47
|
+
};
|
|
48
|
+
const createVector = (from, to, name, precision = 5) => {
|
|
49
|
+
return new Vector(name, round(substract(to.x, from.x).evaluate(), precision).toTree(), round(substract(to.y, from.y).evaluate(), precision).toTree());
|
|
50
|
+
};
|
|
51
|
+
const createPoint = (x, y, name, precision = 5) => {
|
|
52
|
+
return new Point(name, round(x, precision), round(y, precision));
|
|
53
|
+
};
|
|
54
|
+
const getHydrated = (identifiers) => {
|
|
55
|
+
const { nodeIdsModule, nodeIdsArgument, isAngleInDegrees } = identifiers;
|
|
56
|
+
const [nodeModule, nodeArgument] = [nodeIdsModule, nodeIdsArgument].map((nodeIds) => NodeConstructor.fromIdentifiers(nodeIds));
|
|
57
|
+
const nodeArgumentSimplified = nodeArgument.simplify({
|
|
58
|
+
towardsDistribute: false,
|
|
59
|
+
});
|
|
60
|
+
const nodeAngleInDegrees = isAngleInDegrees
|
|
61
|
+
? multiply(frac(180, PiNode), nodeArgument).simplify({
|
|
62
|
+
towardsDistribute: false,
|
|
63
|
+
})
|
|
64
|
+
: undefined;
|
|
65
|
+
const nodeAffixTrig = (() => {
|
|
66
|
+
const nodeArgumentUsed = isAngleInDegrees
|
|
67
|
+
? nodeArgument
|
|
68
|
+
: nodeArgumentSimplified;
|
|
69
|
+
return multiply(nodeModule, add(cos(nodeArgumentUsed), multiply(nodeI, sin(nodeArgumentUsed))));
|
|
70
|
+
})();
|
|
71
|
+
return {
|
|
72
|
+
nodeModule,
|
|
73
|
+
nodeArgument,
|
|
74
|
+
nodeArgumentSimplified,
|
|
75
|
+
nodeAngleInDegrees,
|
|
76
|
+
nodeAffixTrig,
|
|
77
|
+
};
|
|
78
|
+
};
|
|
79
|
+
const getInstruction = (_identifiers) => {
|
|
80
|
+
return `Donner l'affixe du point $M$, sous forme trigonométrique.`;
|
|
81
|
+
};
|
|
82
|
+
const getAnswerNode = (identifiers) => {
|
|
83
|
+
const { nodeAffixTrig } = getHydrated(identifiers);
|
|
84
|
+
return nodeAffixTrig;
|
|
85
|
+
};
|
|
86
|
+
const getAnswer = (identifiers) => {
|
|
87
|
+
return getAnswerNode(identifiers).toTex();
|
|
88
|
+
};
|
|
89
|
+
const getHint = (identifiers) => {
|
|
90
|
+
const { isAngleInDegrees } = identifiers;
|
|
91
|
+
return `Soit $z$ l'affixe du point $M$.
|
|
92
|
+
L'écriture sous forme trigonométrique de $z$ est :
|
|
93
|
+
|
|
94
|
+
$$
|
|
95
|
+
m (\\cos(\\alpha) + i \\sin(\\alpha))
|
|
96
|
+
$$
|
|
97
|
+
|
|
98
|
+
avec $m$ le module de $z$ et $\\alpha$ un argument de $z$.
|
|
99
|
+
|
|
100
|
+
Le module de $z$ est la distance du point $M$ à l'origine $O$.
|
|
101
|
+
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.
|
|
102
|
+
|
|
103
|
+
${(() => {
|
|
104
|
+
if (isAngleInDegrees) {
|
|
105
|
+
return "Attention à bien convertir l'angle donné en degrés en un angle en radians.";
|
|
106
|
+
}
|
|
107
|
+
else {
|
|
108
|
+
return "";
|
|
109
|
+
}
|
|
110
|
+
})()}
|
|
111
|
+
|
|
112
|
+
`;
|
|
113
|
+
};
|
|
114
|
+
const getCorrection = (identifiers) => {
|
|
115
|
+
const { isAngleInDegrees } = identifiers;
|
|
116
|
+
const { nodeModule, nodeArgument, nodeArgumentSimplified, nodeAffixTrig } = getHydrated(identifiers);
|
|
117
|
+
return `Soit $z$ l'affixe du point $M$.
|
|
118
|
+
|
|
119
|
+
On lit :
|
|
120
|
+
|
|
121
|
+
$$
|
|
122
|
+
\\lvert z \\rvert = ${nodeModule.toTex()}
|
|
123
|
+
$$
|
|
124
|
+
|
|
125
|
+
${(() => {
|
|
126
|
+
if (isAngleInDegrees) {
|
|
127
|
+
return `On convertit l'angle donné en degrés en un angle en radians :
|
|
128
|
+
|
|
129
|
+
$$
|
|
130
|
+
\\arg(z) = ${nodeArgument.toTex()}
|
|
131
|
+
$$
|
|
132
|
+
|
|
133
|
+
`;
|
|
134
|
+
}
|
|
135
|
+
else {
|
|
136
|
+
return `
|
|
137
|
+
|
|
138
|
+
$$
|
|
139
|
+
\\arg(z) = ${nodeArgumentSimplified.toTex()}
|
|
140
|
+
$$
|
|
141
|
+
|
|
142
|
+
`;
|
|
143
|
+
}
|
|
144
|
+
})()}
|
|
145
|
+
|
|
146
|
+
|
|
147
|
+
L'affixe du point $M$ est donc $${nodeAffixTrig.toTex()}$.`;
|
|
148
|
+
};
|
|
149
|
+
const getGGBOptions = (identifiers, _optsIn) => {
|
|
150
|
+
const { isAngleInDegrees } = identifiers;
|
|
151
|
+
const { nodeArgumentSimplified, nodeModule, nodeAngleInDegrees } = getHydrated(identifiers);
|
|
152
|
+
const pointO = new Point("O", 0, 0);
|
|
153
|
+
const pointA = new Point("A", 1, 0);
|
|
154
|
+
const precision = 5;
|
|
155
|
+
const strLineColor = `"${colorWithOpacity("#000000", 26)}"`;
|
|
156
|
+
const pointAM = new Point("AM", nodeModule, 0);
|
|
157
|
+
const pointM = rotatePoint(pointAM, nodeArgumentSimplified.evaluate(), pointO, "M", precision);
|
|
158
|
+
const ggb = new GeogebraConstructor({
|
|
159
|
+
isGridSimple: true,
|
|
160
|
+
xAxis: {
|
|
161
|
+
hideNumbers: true,
|
|
162
|
+
},
|
|
163
|
+
yAxis: {
|
|
164
|
+
hideNumbers: true,
|
|
165
|
+
},
|
|
166
|
+
commands: [
|
|
167
|
+
//pointO
|
|
168
|
+
...[
|
|
169
|
+
`O = ${pointO.toMathString()}`,
|
|
170
|
+
`SetFixed(O, true, false)`,
|
|
171
|
+
`ShowLabel(O, true)`,
|
|
172
|
+
],
|
|
173
|
+
//pointM
|
|
174
|
+
...[
|
|
175
|
+
`M = ${pointM.toMathString()}`,
|
|
176
|
+
`SetFixed(M, true, false)`,
|
|
177
|
+
`ShowLabel(M, true)`,
|
|
178
|
+
],
|
|
179
|
+
//radius
|
|
180
|
+
...(() => {
|
|
181
|
+
const valueNodeArgumentSimplified = nodeArgumentSimplified.evaluate();
|
|
182
|
+
function createStrCaptionSpacing(valueAngle) {
|
|
183
|
+
const typeAngleSector = createTypeAngleSectorNWSESecondary(valueAngle);
|
|
184
|
+
switch (typeAngleSector) {
|
|
185
|
+
case "WSW":
|
|
186
|
+
return "\\\\ \\\\ \\ \\ \\ \\ ";
|
|
187
|
+
case "SSW":
|
|
188
|
+
return "\\ \\ \\ \\ ";
|
|
189
|
+
case "SSE":
|
|
190
|
+
return "\\\\ \\\\ \\\\ ";
|
|
191
|
+
case "ESE":
|
|
192
|
+
case "ENE":
|
|
193
|
+
return "\\\\ \\\\ ";
|
|
194
|
+
case "NNE":
|
|
195
|
+
case "NNW":
|
|
196
|
+
case "WNW":
|
|
197
|
+
return "\\ ";
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
const strCaptionSpacing = createStrCaptionSpacing(valueNodeArgumentSimplified);
|
|
201
|
+
return [
|
|
202
|
+
`segRadius = Segment(${pointO.toMathString()}, ${pointM.toMathString()})`,
|
|
203
|
+
`SetColor(segRadius, ${strLineColor})`,
|
|
204
|
+
`SetLineThickness(segRadius, 5)`,
|
|
205
|
+
`SetLineStyle(segRadius, 2)`,
|
|
206
|
+
`SetCaption(segRadius, "$${strCaptionSpacing} \\footnotesize{${nodeModule.toTex()}}$")`,
|
|
207
|
+
`ShowLabel(segRadius, true)`,
|
|
208
|
+
];
|
|
209
|
+
})(),
|
|
210
|
+
//argument
|
|
211
|
+
...(() => {
|
|
212
|
+
const valueNodeArgumentSimplified = nodeArgumentSimplified.evaluate();
|
|
213
|
+
function createStrCaptionSpacing(valueAngle) {
|
|
214
|
+
const typeAngleSector = createTypeAngleSectorNWSESecondary(valueAngle);
|
|
215
|
+
switch (typeAngleSector) {
|
|
216
|
+
case "SSE":
|
|
217
|
+
return "\\\\ \\ \\ \\ \\ ";
|
|
218
|
+
case "ESE": {
|
|
219
|
+
if (createTypeAngleSectorNWSESecondary(valueAngle - 0.4) === "SSE") {
|
|
220
|
+
return "\\\\ \\ \\ \\ \\ ";
|
|
221
|
+
}
|
|
222
|
+
else {
|
|
223
|
+
return "\\\\ \\\\ \\\\ \\\\ ";
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
default:
|
|
227
|
+
return "\\\\ \\\\ \\\\ \\ \\ \\ \\ ";
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
const strCaptionSpacing = createStrCaptionSpacing(valueNodeArgumentSimplified);
|
|
231
|
+
const isClockwise = valueNodeArgumentSimplified > 0;
|
|
232
|
+
return [
|
|
233
|
+
`rayOA = Ray(${pointO.toMathString()}, ${pointA.toMathString()})`,
|
|
234
|
+
`rayOM = Ray(${pointO.toMathString()}, ${pointM.toMathString()})`,
|
|
235
|
+
`SetVisibleInView(rayOA, 1, false)`,
|
|
236
|
+
`SetVisibleInView(rayOM, 1, false)`,
|
|
237
|
+
`angArg = ${isClockwise ? "Angle(rayOA, rayOM)" : "Angle(rayOM, rayOA)"}`,
|
|
238
|
+
`SetDecoration(angArg, ${isClockwise ? 6 : 7})`,
|
|
239
|
+
`SetColor(angArg, "${blueDark}")`,
|
|
240
|
+
`SetCaption(angArg, "$${strCaptionSpacing}\\footnotesize{${(() => {
|
|
241
|
+
if (isAngleInDegrees) {
|
|
242
|
+
return `${nodeAngleInDegrees.toTex()}°`;
|
|
243
|
+
}
|
|
244
|
+
else {
|
|
245
|
+
return `${nodeArgumentSimplified.toTex()}`;
|
|
246
|
+
}
|
|
247
|
+
})()}}$")`,
|
|
248
|
+
`ShowLabel(angArg, true)`,
|
|
249
|
+
];
|
|
250
|
+
})(),
|
|
251
|
+
],
|
|
252
|
+
fontSize: 16,
|
|
253
|
+
});
|
|
254
|
+
return ggb.getOptions({
|
|
255
|
+
coords: ggb.getCoordsForPoints([pointO, pointM]),
|
|
256
|
+
});
|
|
257
|
+
};
|
|
258
|
+
const getPropositions = (n, { answer, ...identifiers }, _optsIn) => {
|
|
259
|
+
const propositions = [];
|
|
260
|
+
addValidProp(propositions, answer);
|
|
261
|
+
const { isAngleInDegrees } = identifiers;
|
|
262
|
+
const { nodeModule: nodeModulePure, nodeAngleInDegrees, nodeArgumentSimplified, } = getHydrated(identifiers);
|
|
263
|
+
function createNodeAffixTrig(nodeModule, nodeArgument) {
|
|
264
|
+
const nodeAffixTrig = multiply(nodeModule, add(cos(nodeArgument), multiply(nodeI, sin(nodeArgument))));
|
|
265
|
+
return nodeAffixTrig;
|
|
266
|
+
}
|
|
267
|
+
//student: reprocesses read module: module becomes sqrt(...)
|
|
268
|
+
{
|
|
269
|
+
if (!isSqrtNode(nodeModulePure) && !isFractionNode(nodeModulePure)) {
|
|
270
|
+
const nodeModuleWrong = sqrt(nodeModulePure);
|
|
271
|
+
const nodeAffixTrigWrong = createNodeAffixTrig(nodeModuleWrong, nodeArgumentSimplified);
|
|
272
|
+
tryToAddWrongProp(propositions, nodeAffixTrigWrong.toTex());
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
const isTerrorWrtModule = probaFlip(0.39);
|
|
276
|
+
const nodeModule = (() => {
|
|
277
|
+
if (isTerrorWrtModule) {
|
|
278
|
+
if (isSqrtNode(nodeModulePure)) {
|
|
279
|
+
return square(nodeModulePure).simplify({
|
|
280
|
+
calculatePowers: true,
|
|
281
|
+
});
|
|
282
|
+
}
|
|
283
|
+
else if (isFractionNode(nodeModulePure)) {
|
|
284
|
+
return nodeModulePure;
|
|
285
|
+
}
|
|
286
|
+
else {
|
|
287
|
+
return sqrt(nodeModulePure);
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
else {
|
|
291
|
+
return nodeModulePure;
|
|
292
|
+
}
|
|
293
|
+
})();
|
|
294
|
+
//student: module <-> argument
|
|
295
|
+
{
|
|
296
|
+
const nodeAffixTrigWrong = createNodeAffixTrig(nodeArgumentSimplified, nodeModule);
|
|
297
|
+
tryToAddWrongProp(propositions, nodeAffixTrigWrong.toTex());
|
|
298
|
+
}
|
|
299
|
+
if (isAngleInDegrees) {
|
|
300
|
+
const nodeAngleInDeg = nodeAngleInDegrees;
|
|
301
|
+
//student: forgets to convert to radians
|
|
302
|
+
{
|
|
303
|
+
const nodeAffixWrong = multiply(nodeModule, add(cos(nodeAngleInDeg), multiply(nodeI, sin(nodeAngleInDeg))));
|
|
304
|
+
tryToAddWrongProp(propositions, nodeAffixWrong.toTex());
|
|
305
|
+
}
|
|
306
|
+
//student: converts badly to radians
|
|
307
|
+
{
|
|
308
|
+
const nodeArgumentWrong = multiply(nodeAngleInDeg, frac(180, PiNode));
|
|
309
|
+
const nodeAffixWrong = multiply(nodeModule, add(cos(nodeArgumentWrong), multiply(nodeI, sin(nodeArgumentWrong))));
|
|
310
|
+
tryToAddWrongProp(propositions, nodeAffixWrong.toTex());
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
//student: |z|(cos + i sin) -> |z|cos + i sin
|
|
314
|
+
{
|
|
315
|
+
const nodeAffixWrong = add(multiply(nodeModule, cos(nodeArgumentSimplified)), sin(nodeArgumentSimplified));
|
|
316
|
+
tryToAddWrongProp(propositions, nodeAffixWrong.toTex());
|
|
317
|
+
}
|
|
318
|
+
//student: module -> 1
|
|
319
|
+
{
|
|
320
|
+
const nodeAffixTrigWrong = add(cos(nodeArgumentSimplified), multiply(nodeI, sin(nodeArgumentSimplified)));
|
|
321
|
+
tryToAddWrongProp(propositions, nodeAffixTrigWrong.toTex());
|
|
322
|
+
}
|
|
323
|
+
return shuffleProps(propositions, n);
|
|
324
|
+
};
|
|
325
|
+
const getKeys = () => {
|
|
326
|
+
return ["cos", "sin", "pi"];
|
|
327
|
+
};
|
|
328
|
+
const isAnswerValid = (ans, { answer, ...identifiers }) => {
|
|
329
|
+
try {
|
|
330
|
+
const nodeAns = parseAlgebraic(ans);
|
|
331
|
+
const nodeI = new VariableNode("i");
|
|
332
|
+
//todo: parse complex numbers
|
|
333
|
+
//todo: use regexps on algebraicNodes
|
|
334
|
+
const [nodeXAns, nodeYAns] = (() => {
|
|
335
|
+
const nodeXAns = nodeBySubstitutingVar(nodeAns, (0).toTree(), nodeI).simplify();
|
|
336
|
+
//pour chopper le terme en i...
|
|
337
|
+
const nodeYAns = nodeBySubstitutingVar(substract(nodeAns, nodeXAns), (1).toTree(), nodeI).simplify();
|
|
338
|
+
return [nodeXAns, nodeYAns];
|
|
339
|
+
})();
|
|
340
|
+
const { nodeModule, nodeArgument } = getHydrated(identifiers);
|
|
341
|
+
const nodeX = multiply(nodeModule, cos(nodeArgument));
|
|
342
|
+
const nodeY = multiply(nodeModule, sin(nodeArgument));
|
|
343
|
+
return (NodeComparator.isEqualViaSub(nodeXAns, nodeX) &&
|
|
344
|
+
NodeComparator.isEqualViaSub(nodeYAns, nodeY));
|
|
345
|
+
}
|
|
346
|
+
catch (err) {
|
|
347
|
+
return handleVEAError(err);
|
|
348
|
+
}
|
|
349
|
+
};
|
|
350
|
+
// const createRandomIdentifiers = (opts: Options) => {};
|
|
351
|
+
const getComplexGeomAffixTrigFromPointQuestion = (optsIn) => {
|
|
352
|
+
const opts = optsIn ?? optsDefault;
|
|
353
|
+
const isAngleInDegrees = opts.isAngleInDegrees;
|
|
354
|
+
const [_nodeAngleBase, nodeArgumentM] = (() => {
|
|
355
|
+
if (isAngleInDegrees) {
|
|
356
|
+
const nodeAngleBase = frac(PiNode, 180);
|
|
357
|
+
const vAbsAngleInDegrees = coinFlip()
|
|
358
|
+
? randint(10, 82)
|
|
359
|
+
: randint(108, 172);
|
|
360
|
+
const vFactor = (coinFlip() ? +1 : -1) * vAbsAngleInDegrees;
|
|
361
|
+
const nodeAngleM = multiply(vFactor, nodeAngleBase);
|
|
362
|
+
return [nodeAngleBase, nodeAngleM];
|
|
363
|
+
}
|
|
364
|
+
else {
|
|
365
|
+
const rand = randint(0, 5);
|
|
366
|
+
switch (rand) {
|
|
367
|
+
case 0: {
|
|
368
|
+
const nodeAngleBase = frac(PiNode, 18);
|
|
369
|
+
const vFactor = (coinFlip() ? +1 : -1) * randint(1, 18, [9]);
|
|
370
|
+
const nodeAngleM = multiply(vFactor, nodeAngleBase).simplify({
|
|
371
|
+
towardsDistribute: false,
|
|
372
|
+
});
|
|
373
|
+
return [nodeAngleBase, nodeAngleM];
|
|
374
|
+
}
|
|
375
|
+
case 1: {
|
|
376
|
+
const nodeAngleBase = frac(PiNode, 9);
|
|
377
|
+
const vFactor = (coinFlip() ? +1 : -1) * randint(1, 9);
|
|
378
|
+
const nodeAngleM = multiply(vFactor, nodeAngleBase).simplify({
|
|
379
|
+
towardsDistribute: false,
|
|
380
|
+
});
|
|
381
|
+
return [nodeAngleBase, nodeAngleM];
|
|
382
|
+
}
|
|
383
|
+
case 2: {
|
|
384
|
+
const nodeAngleBase = frac(PiNode, 6);
|
|
385
|
+
const vFactor = (coinFlip() ? +1 : -1) * randint(1, 6, [3]);
|
|
386
|
+
const nodeAngleM = multiply(vFactor, nodeAngleBase).simplify({
|
|
387
|
+
towardsDistribute: false,
|
|
388
|
+
});
|
|
389
|
+
return [nodeAngleBase, nodeAngleM];
|
|
390
|
+
}
|
|
391
|
+
case 3: {
|
|
392
|
+
const nodeAngleBase = frac(multiply(2, PiNode), 9);
|
|
393
|
+
const vFactor = (coinFlip() ? +1 : -1) * randint(1, 5);
|
|
394
|
+
const nodeAngleM = multiply(vFactor, nodeAngleBase).simplify({
|
|
395
|
+
towardsDistribute: false,
|
|
396
|
+
});
|
|
397
|
+
return [nodeAngleBase, nodeAngleM];
|
|
398
|
+
}
|
|
399
|
+
case 4: {
|
|
400
|
+
const nodeAngleBase = frac(PiNode, 3);
|
|
401
|
+
const vFactor = (coinFlip() ? +1 : -1) * randint(1, 3);
|
|
402
|
+
const nodeAngleM = multiply(vFactor, nodeAngleBase).simplify({
|
|
403
|
+
towardsDistribute: false,
|
|
404
|
+
});
|
|
405
|
+
return [nodeAngleBase, nodeAngleM];
|
|
406
|
+
}
|
|
407
|
+
default:
|
|
408
|
+
throw new Error("Unsupported rand: " + rand);
|
|
409
|
+
}
|
|
410
|
+
}
|
|
411
|
+
})();
|
|
412
|
+
const nodeModuleM = (() => {
|
|
413
|
+
const rand = randint(0, 3);
|
|
414
|
+
switch (rand) {
|
|
415
|
+
case 0:
|
|
416
|
+
//integer
|
|
417
|
+
return randint(2, 5).toTree();
|
|
418
|
+
case 1:
|
|
419
|
+
//float
|
|
420
|
+
return randfloat(2, 4, 1).toTree();
|
|
421
|
+
case 2: {
|
|
422
|
+
//sqrt
|
|
423
|
+
const valueInt = random([2, 3, 5, 6, 7, 8, 10, 11, 12, 13, 14]);
|
|
424
|
+
return sqrt(valueInt);
|
|
425
|
+
}
|
|
426
|
+
case 3: {
|
|
427
|
+
//frac
|
|
428
|
+
return random([frac(1, 2), frac(2, 3), frac(3, 2)]);
|
|
429
|
+
}
|
|
430
|
+
case 4: {
|
|
431
|
+
//frac(sqrt)
|
|
432
|
+
return random([frac(sqrt(2), 2), frac(sqrt(3), 2), frac(sqrt(5), 2)]);
|
|
433
|
+
}
|
|
434
|
+
default:
|
|
435
|
+
throw new Error("Unsupported rand: " + rand);
|
|
436
|
+
}
|
|
437
|
+
})();
|
|
438
|
+
const identifiers = {
|
|
439
|
+
nodeIdsModule: nodeModuleM.toIdentifiers(),
|
|
440
|
+
nodeIdsArgument: nodeArgumentM.toIdentifiers(),
|
|
441
|
+
isAngleInDegrees,
|
|
442
|
+
};
|
|
443
|
+
return getQuestionFromIdentifiers(identifiers, opts);
|
|
444
|
+
};
|
|
445
|
+
const getQuestionFromIdentifiers = (identifiers, opts) => {
|
|
446
|
+
const question = {
|
|
447
|
+
answer: getAnswer(identifiers),
|
|
448
|
+
instruction: getInstruction(identifiers),
|
|
449
|
+
keys: getKeys(identifiers, opts),
|
|
450
|
+
answerFormat: "tex",
|
|
451
|
+
identifiers,
|
|
452
|
+
hint: getHint(identifiers),
|
|
453
|
+
correction: getCorrection(identifiers),
|
|
454
|
+
// correctionGgbOptions: getCorrectionGGBOptions(identifiers),
|
|
455
|
+
ggbOptions: getGGBOptions(identifiers, opts),
|
|
456
|
+
};
|
|
457
|
+
return question;
|
|
458
|
+
};
|
|
459
|
+
const optsDefault = {
|
|
460
|
+
isAngleInDegrees: false,
|
|
461
|
+
};
|
|
462
|
+
const options = [
|
|
463
|
+
{
|
|
464
|
+
id: "isAngleInDegrees",
|
|
465
|
+
label: "Angle en degrés ?",
|
|
466
|
+
target: GeneratorOptionTarget.generation,
|
|
467
|
+
type: GeneratorOptionType.checkbox,
|
|
468
|
+
defaultValue: optsDefault.isAngleInDegrees,
|
|
469
|
+
},
|
|
470
|
+
];
|
|
471
|
+
export const complexGeomAffixTrigFromPoint = {
|
|
472
|
+
id: "complexGeomAffixTrigFromPoint",
|
|
473
|
+
label: "Déterminer l'affixe d'un point sous forme trigonométrique",
|
|
474
|
+
isSingleStep: true,
|
|
475
|
+
generator: (nb, opts) => getDistinctQuestions(() => getComplexGeomAffixTrigFromPointQuestion(opts), nb),
|
|
476
|
+
options,
|
|
477
|
+
qcmTimer: 60,
|
|
478
|
+
freeTimer: 60,
|
|
479
|
+
isAnswerValid,
|
|
480
|
+
getPropositions,
|
|
481
|
+
subject: "Mathématiques",
|
|
482
|
+
getQuestionFromIdentifiers,
|
|
483
|
+
hasHintAndCorrection: true,
|
|
484
|
+
hasGeogebra: true,
|
|
485
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Exercise } from "../../../../exercises/exercise.js";
|
|
2
|
+
import { PointIdentifiers } from "../../../../math/geometry/point.js";
|
|
3
|
+
import { NodeIdentifiers } from "../../../../tree/nodes/nodeConstructor.js";
|
|
4
|
+
type Identifiers = {
|
|
5
|
+
pointIdsA: PointIdentifiers;
|
|
6
|
+
nodeIdsModule: NodeIdentifiers;
|
|
7
|
+
nodeIdsArgument: NodeIdentifiers;
|
|
8
|
+
isCosAsked: boolean;
|
|
9
|
+
};
|
|
10
|
+
export declare const complexGeomApproxOfCosArgOrSinArgFromPointAndAffixTrig: Exercise<Identifiers>;
|
|
11
|
+
export {};
|
|
12
|
+
//# sourceMappingURL=complexGeomApproxOfCosArgOrSinArgFromPointAndAffixTrig.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"complexGeomApproxOfCosArgOrSinArgFromPointAndAffixTrig.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/complex/geometric/complexGeomApproxOfCosArgOrSinArgFromPointAndAffixTrig.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAeT,MAAM,6BAA6B,CAAC;AAGrC,OAAO,EAGL,gBAAgB,EACjB,MAAM,8BAA8B,CAAC;AAOtC,OAAO,EAEL,eAAe,EAChB,MAAM,qCAAqC,CAAC;AAiC7C,KAAK,WAAW,GAAG;IACjB,SAAS,EAAE,gBAAgB,CAAC;IAC5B,aAAa,EAAE,eAAe,CAAC;IAC/B,eAAe,EAAE,eAAe,CAAC;IACjC,UAAU,EAAE,OAAO,CAAC;CACrB,CAAC;AAyQF,eAAO,MAAM,sDAAsD,EAAE,QAAQ,CAAC,WAAW,CAsBtF,CAAC"}
|