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,11 @@
|
|
|
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
|
+
nodeIdsModule: NodeIdentifiers;
|
|
6
|
+
nodeIdsArgument: NodeIdentifiers;
|
|
7
|
+
pointIds: PointIdentifiers[];
|
|
8
|
+
};
|
|
9
|
+
export declare const complexGeomFindPointFromAffixExp: Exercise<Identifiers>;
|
|
10
|
+
export {};
|
|
11
|
+
//# sourceMappingURL=complexGeomFindPointFromAffixExp.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"complexGeomFindPointFromAffixExp.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/complex/geometric/complexGeomFindPointFromAffixExp.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAaT,MAAM,6BAA6B,CAAC;AAIrC,OAAO,EAGL,gBAAgB,EACjB,MAAM,8BAA8B,CAAC;AAQtC,OAAO,EAEL,eAAe,EAChB,MAAM,qCAAqC,CAAC;AA4E7C,KAAK,WAAW,GAAG;IACjB,aAAa,EAAE,eAAe,CAAC;IAC/B,eAAe,EAAE,eAAe,CAAC;IACjC,QAAQ,EAAE,gBAAgB,EAAE,CAAC;CAC9B,CAAC;AAkPF,eAAO,MAAM,gCAAgC,EAAE,QAAQ,CAAC,WAAW,CAkBlE,CAAC"}
|
|
@@ -0,0 +1,223 @@
|
|
|
1
|
+
import { addValidProp, tryToAddWrongProp, } from "../../../../exercises/exercise.js";
|
|
2
|
+
import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions.js";
|
|
3
|
+
import { colorWithOpacity } from "../../../../geogebra/colors.js";
|
|
4
|
+
import { GeogebraConstructor } from "../../../../geogebra/geogebraConstructor.js";
|
|
5
|
+
import { Point, PointConstructor, } from "../../../../math/geometry/point.js";
|
|
6
|
+
import { Vector } from "../../../../math/geometry/vector.js";
|
|
7
|
+
import { randfloat } from "../../../../math/utils/random/randfloat.js";
|
|
8
|
+
import { round } from "../../../../math/utils/round.js";
|
|
9
|
+
import { cos } from "../../../../tree/nodes/functions/cosNode.js";
|
|
10
|
+
import { exp } from "../../../../tree/nodes/functions/expNode.js";
|
|
11
|
+
import { sin } from "../../../../tree/nodes/functions/sinNode.js";
|
|
12
|
+
import { NodeConstructor, } from "../../../../tree/nodes/nodeConstructor.js";
|
|
13
|
+
import { PiNode } from "../../../../tree/nodes/numbers/piNode.js";
|
|
14
|
+
import { add } from "../../../../tree/nodes/operators/addNode.js";
|
|
15
|
+
import { frac } from "../../../../tree/nodes/operators/fractionNode.js";
|
|
16
|
+
import { isMultiplyNode, multiply, } from "../../../../tree/nodes/operators/multiplyNode.js";
|
|
17
|
+
import { substract } from "../../../../tree/nodes/operators/substractNode.js";
|
|
18
|
+
import { VariableNode } from "../../../../tree/nodes/variables/variableNode.js";
|
|
19
|
+
import { coinFlip } from "../../../../utils/alea/coinFlip.js";
|
|
20
|
+
import { shuffle } from "../../../../utils/alea/shuffle.js";
|
|
21
|
+
//TODO: frac does not simplify "i"
|
|
22
|
+
// const nodeI = new ComplexNode((0).toTree(), (1).toTree());
|
|
23
|
+
const nodeI = new VariableNode("i");
|
|
24
|
+
const _degreesToRadians = (angleInDegrees, precision) => {
|
|
25
|
+
const oneOver180 = 0.00555555555555555;
|
|
26
|
+
return round(multiply(multiply(angleInDegrees, PiNode), oneOver180).evaluate(), precision);
|
|
27
|
+
};
|
|
28
|
+
const rotateVector = (vec, angle, name) => {
|
|
29
|
+
//x' = cos(t)*x -sin(t)*y
|
|
30
|
+
//y' = sin(t)*x + cos(t)*y
|
|
31
|
+
const cos = Math.cos(angle);
|
|
32
|
+
const sin = Math.sin(angle);
|
|
33
|
+
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());
|
|
34
|
+
};
|
|
35
|
+
const rotatePoint = (target, angle, center, name, precision = 2) => {
|
|
36
|
+
const vSrc = createVector(center, target, "vSrc", precision);
|
|
37
|
+
const vRotated = rotateVector(vSrc, angle, "vRotated");
|
|
38
|
+
return createPoint(add(center.x, vRotated.x).evaluate(), add(center.y, vRotated.y).evaluate(), name, precision);
|
|
39
|
+
};
|
|
40
|
+
const createVector = (from, to, name, precision = 5) => {
|
|
41
|
+
return new Vector(name, round(substract(to.x, from.x).evaluate(), precision).toTree(), round(substract(to.y, from.y).evaluate(), precision).toTree());
|
|
42
|
+
};
|
|
43
|
+
const createPoint = (x, y, name, precision = 5) => {
|
|
44
|
+
return new Point(name, round(x, precision), round(y, precision));
|
|
45
|
+
};
|
|
46
|
+
const getHydrated = (identifiers) => {
|
|
47
|
+
const { nodeIdsModule, nodeIdsArgument, pointIds } = identifiers;
|
|
48
|
+
const [nodeModule, nodeArgument] = [nodeIdsModule, nodeIdsArgument].map((nodeIds) => NodeConstructor.fromIdentifiers(nodeIds));
|
|
49
|
+
const arrPoint = pointIds.map((pointIds) => PointConstructor.fromIdentifiers(pointIds));
|
|
50
|
+
const nodeAffixSimplified = multiply(nodeModule, exp(multiply(nodeI, nodeArgument.simplify({ towardsDistribute: true }))));
|
|
51
|
+
return {
|
|
52
|
+
nodeModule,
|
|
53
|
+
nodeArgument,
|
|
54
|
+
arrPoint,
|
|
55
|
+
nodeAffixSimplified,
|
|
56
|
+
};
|
|
57
|
+
};
|
|
58
|
+
const getInstruction = (identifiers) => {
|
|
59
|
+
const { nodeAffixSimplified } = getHydrated(identifiers);
|
|
60
|
+
return `Quel point est le point image du nombre $${nodeAffixSimplified.toTex()}$ ?`;
|
|
61
|
+
};
|
|
62
|
+
const getAnswer = (identifiers) => {
|
|
63
|
+
const { arrPoint } = getHydrated(identifiers);
|
|
64
|
+
const [pointAnswer, _] = arrPoint;
|
|
65
|
+
return pointAnswer.name;
|
|
66
|
+
};
|
|
67
|
+
const getHint = () => {
|
|
68
|
+
return `Le nombre $\\pi$ vaut environ $${(3.14).frenchify()}$.
|
|
69
|
+
Le demi-plan supérieur contient les points images de nombres dont l'argument principal est compris entre $0$ et $\\pi$.
|
|
70
|
+
Le demi-plan inférieur contient les points images de nombres dont l'argument principal est compris entre $-\\pi$ et $0$.
|
|
71
|
+
|
|
72
|
+
Détermine une valeur approchée de l'argument du nombre donné pour trouver le point demandé.`;
|
|
73
|
+
};
|
|
74
|
+
const getCorrection = (identifiers) => {
|
|
75
|
+
const { nodeModule, nodeArgument, nodeAffixSimplified, arrPoint } = getHydrated(identifiers);
|
|
76
|
+
const [pointAnswer, _] = arrPoint;
|
|
77
|
+
const nodeModuleWithPi = isMultiplyNode(nodeModule) ? nodeModule : undefined;
|
|
78
|
+
const nodeArgumentWithoutPi = isMultiplyNode(nodeArgument)
|
|
79
|
+
? undefined
|
|
80
|
+
: nodeArgument;
|
|
81
|
+
return `${nodeModuleWithPi !== undefined
|
|
82
|
+
? `On peut réécrire sous forme approchée le module donné :
|
|
83
|
+
|
|
84
|
+
$$
|
|
85
|
+
${nodeModuleWithPi.toTex()} \\approx ${round(nodeModuleWithPi.evaluate(), 2).frenchify()}
|
|
86
|
+
$$
|
|
87
|
+
|
|
88
|
+
`
|
|
89
|
+
: ``}
|
|
90
|
+
${nodeArgumentWithoutPi !== undefined
|
|
91
|
+
? `On peut réécrire sous forme approchée l'argument donné :
|
|
92
|
+
|
|
93
|
+
$$
|
|
94
|
+
${nodeArgumentWithoutPi.toTex()} \\approx ${round(frac(nodeArgumentWithoutPi, PiNode).evaluate(), 2).frenchify()} \\pi
|
|
95
|
+
$$
|
|
96
|
+
|
|
97
|
+
`
|
|
98
|
+
: `On cherche un point à la distance $${nodeModule.toTex()}$ de l'origine.`}
|
|
99
|
+
|
|
100
|
+
On peut ainsi détérminer plus aisément que le point image de $${nodeAffixSimplified.toTex()}$ est le point $${pointAnswer.name}$.
|
|
101
|
+
|
|
102
|
+
`;
|
|
103
|
+
};
|
|
104
|
+
const getGGBOptions = (identifiers) => {
|
|
105
|
+
const { arrPoint } = getHydrated(identifiers);
|
|
106
|
+
const nodeAngleBase = frac(PiNode, 6);
|
|
107
|
+
const nbRays = frac(multiply(2, PiNode), nodeAngleBase)
|
|
108
|
+
.simplify({ towardsDistribute: false })
|
|
109
|
+
.evaluate();
|
|
110
|
+
const arrNodeAngle = [...Array(nbRays).keys()].map((i) => multiply(i, nodeAngleBase));
|
|
111
|
+
const pointO = new Point("O", 0, 0);
|
|
112
|
+
const pointA = new Point("A", 1, 0);
|
|
113
|
+
const precision = 5;
|
|
114
|
+
const arrPointForAngle = arrNodeAngle.map((nodeAngle, i) => rotatePoint(pointA, nodeAngle.evaluate(), pointO, `PA${i}`, precision));
|
|
115
|
+
const strLineColor = `"${colorWithOpacity("#000000", 26)}"`;
|
|
116
|
+
const ggb = new GeogebraConstructor({
|
|
117
|
+
isGridSimple: true,
|
|
118
|
+
commands: [
|
|
119
|
+
//circles
|
|
120
|
+
...[...Array(4).keys()]
|
|
121
|
+
.map((i) => i + 1)
|
|
122
|
+
.flatMap((v, i) => [
|
|
123
|
+
`c${i} = Circle((0,0), ${v})`,
|
|
124
|
+
// `SetColor(c${i}, ${strLineColor})`,
|
|
125
|
+
`SetLineThickness(c${i}, 1)`,
|
|
126
|
+
]),
|
|
127
|
+
//rays
|
|
128
|
+
...arrPointForAngle.flatMap((point, i) => [
|
|
129
|
+
`ray${i} = Ray(${pointO.toMathString()}, ${point.toMathString()})`,
|
|
130
|
+
`SetColor(ray${i}, ${strLineColor})`,
|
|
131
|
+
`SetLineThickness(ray${i}, 1)`,
|
|
132
|
+
]),
|
|
133
|
+
//points
|
|
134
|
+
...arrPoint.flatMap((point) => point.toGGBCommand({
|
|
135
|
+
isFixed: true,
|
|
136
|
+
isSelectionnable: true,
|
|
137
|
+
showLabel: true,
|
|
138
|
+
// style: 1,
|
|
139
|
+
})),
|
|
140
|
+
],
|
|
141
|
+
fontSize: 16,
|
|
142
|
+
});
|
|
143
|
+
return ggb.getOptions({
|
|
144
|
+
coords: [-4.1, 4.1, -4.1, 4.1],
|
|
145
|
+
});
|
|
146
|
+
};
|
|
147
|
+
const getPropositions = (_n, { answer, ...identifiers }) => {
|
|
148
|
+
const propositions = [];
|
|
149
|
+
const { arrPoint } = getHydrated(identifiers);
|
|
150
|
+
const [pointAnswer, _] = arrPoint;
|
|
151
|
+
arrPoint
|
|
152
|
+
.toSorted((point1, point2) => point1.name.localeCompare(point2.name))
|
|
153
|
+
.forEach((point) => {
|
|
154
|
+
if (point.name === pointAnswer.name) {
|
|
155
|
+
addValidProp(propositions, point.name);
|
|
156
|
+
}
|
|
157
|
+
else {
|
|
158
|
+
tryToAddWrongProp(propositions, point.name);
|
|
159
|
+
}
|
|
160
|
+
});
|
|
161
|
+
return propositions;
|
|
162
|
+
};
|
|
163
|
+
const getComplexGeomFindPointFromAffixExpQuestion = () => {
|
|
164
|
+
function createRandomAffixObj(name) {
|
|
165
|
+
const nodeModule = coinFlip()
|
|
166
|
+
? randfloat(1, 4, 1).toTree()
|
|
167
|
+
: multiply(randfloat(0.5, 1.2, 1), PiNode);
|
|
168
|
+
const nodeArgument = coinFlip()
|
|
169
|
+
? randfloat(-5, 5, 1, [0]).toTree()
|
|
170
|
+
: multiply(randfloat(-1.5, 1.5, 1, [0]), PiNode);
|
|
171
|
+
const point = new Point(name, multiply(nodeModule, cos(nodeArgument)), multiply(nodeModule, sin(nodeArgument)));
|
|
172
|
+
const affixObj = { nodeModule, nodeArgument, point };
|
|
173
|
+
return affixObj;
|
|
174
|
+
}
|
|
175
|
+
const arrAffixObj = (() => {
|
|
176
|
+
let arrLetter = ["A", "B", "C", "D"];
|
|
177
|
+
const arrAffixObj = [];
|
|
178
|
+
while (arrAffixObj.length < 4) {
|
|
179
|
+
const [name, ...arrLetterRest] = arrLetter;
|
|
180
|
+
const affixObjCandidate = createRandomAffixObj(name);
|
|
181
|
+
const isFarEnough = arrAffixObj.every(({ point: pointExisting }) => affixObjCandidate.point.distanceTo(pointExisting) > 0.5);
|
|
182
|
+
if (isFarEnough) {
|
|
183
|
+
arrAffixObj.push(affixObjCandidate);
|
|
184
|
+
arrLetter = arrLetterRest;
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
const arrAffixObjShuffled = shuffle(arrAffixObj);
|
|
188
|
+
return arrAffixObjShuffled;
|
|
189
|
+
})();
|
|
190
|
+
const [affixObjAsked, _] = arrAffixObj;
|
|
191
|
+
const identifiers = {
|
|
192
|
+
nodeIdsModule: affixObjAsked.nodeModule.toIdentifiers(),
|
|
193
|
+
nodeIdsArgument: affixObjAsked.nodeArgument.toIdentifiers(),
|
|
194
|
+
pointIds: arrAffixObj.map(({ point }) => point.toIdentifiers()),
|
|
195
|
+
};
|
|
196
|
+
return getQuestionFromIdentifiers(identifiers);
|
|
197
|
+
};
|
|
198
|
+
const getQuestionFromIdentifiers = (identifiers, opts) => {
|
|
199
|
+
const question = {
|
|
200
|
+
answer: getAnswer(identifiers),
|
|
201
|
+
instruction: getInstruction(identifiers),
|
|
202
|
+
answerFormat: "tex",
|
|
203
|
+
identifiers,
|
|
204
|
+
hint: getHint(identifiers),
|
|
205
|
+
correction: getCorrection(identifiers),
|
|
206
|
+
ggbOptions: getGGBOptions(identifiers, opts),
|
|
207
|
+
};
|
|
208
|
+
return question;
|
|
209
|
+
};
|
|
210
|
+
export const complexGeomFindPointFromAffixExp = {
|
|
211
|
+
id: "complexGeomFindPointFromAffixExp",
|
|
212
|
+
label: "Déterminer le point image d'un nombre complexe donné sous forme exponentielle",
|
|
213
|
+
isSingleStep: true,
|
|
214
|
+
generator: (nb, opts) => getDistinctQuestions(() => getComplexGeomFindPointFromAffixExpQuestion(opts), nb),
|
|
215
|
+
qcmTimer: 60,
|
|
216
|
+
freeTimer: 60,
|
|
217
|
+
getPropositions,
|
|
218
|
+
subject: "Mathématiques",
|
|
219
|
+
getQuestionFromIdentifiers,
|
|
220
|
+
hasHintAndCorrection: true,
|
|
221
|
+
hasGeogebra: true,
|
|
222
|
+
answerType: "QCU",
|
|
223
|
+
};
|
package/lib/exercises/math/complex/geometric/complexGeomFindPointFromPowerOfUnitRootFromFigure.d.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Exercise } from "../../../../exercises/exercise.js";
|
|
2
|
+
import { PointIdentifiers } from "../../../../math/geometry/point.js";
|
|
3
|
+
type Identifiers = {
|
|
4
|
+
nbSides: number;
|
|
5
|
+
pointIds: PointIdentifiers[];
|
|
6
|
+
indexTarget: number;
|
|
7
|
+
exponent: number;
|
|
8
|
+
};
|
|
9
|
+
export declare const complexGeomFindPointFromPowerOfUnitRootFromFigure: Exercise<Identifiers>;
|
|
10
|
+
export {};
|
|
11
|
+
//# sourceMappingURL=complexGeomFindPointFromPowerOfUnitRootFromFigure.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"complexGeomFindPointFromPowerOfUnitRootFromFigure.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/complex/geometric/complexGeomFindPointFromPowerOfUnitRootFromFigure.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAiBT,MAAM,6BAA6B,CAAC;AAIrC,OAAO,EAGL,gBAAgB,EACjB,MAAM,8BAA8B,CAAC;AAoGtC,KAAK,WAAW,GAAG;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,gBAAgB,EAAE,CAAC;IAC7B,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAyYF,eAAO,MAAM,iDAAiD,EAAE,QAAQ,CAAC,WAAW,CAoBjF,CAAC"}
|
package/lib/exercises/math/complex/geometric/complexGeomFindPointFromPowerOfUnitRootFromFigure.js
ADDED
|
@@ -0,0 +1,348 @@
|
|
|
1
|
+
import { addValidProp, shuffleProps, tryToAddWrongProp, propWhile, } from "../../../../exercises/exercise.js";
|
|
2
|
+
import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions.js";
|
|
3
|
+
import { colorWithOpacity } from "../../../../geogebra/colors.js";
|
|
4
|
+
import { GeogebraConstructor } from "../../../../geogebra/geogebraConstructor.js";
|
|
5
|
+
import { Point, PointConstructor, } from "../../../../math/geometry/point.js";
|
|
6
|
+
import { Vector } from "../../../../math/geometry/vector.js";
|
|
7
|
+
import { lcm } from "../../../../math/utils/arithmetic/lcm.js";
|
|
8
|
+
import { randint } from "../../../../math/utils/random/randint.js";
|
|
9
|
+
import { round } from "../../../../math/utils/round.js";
|
|
10
|
+
import { cos } from "../../../../tree/nodes/functions/cosNode.js";
|
|
11
|
+
import { exp } from "../../../../tree/nodes/functions/expNode.js";
|
|
12
|
+
import { sin } from "../../../../tree/nodes/functions/sinNode.js";
|
|
13
|
+
import { PiNode } from "../../../../tree/nodes/numbers/piNode.js";
|
|
14
|
+
import { add } from "../../../../tree/nodes/operators/addNode.js";
|
|
15
|
+
import { frac } from "../../../../tree/nodes/operators/fractionNode.js";
|
|
16
|
+
import { multiply } from "../../../../tree/nodes/operators/multiplyNode.js";
|
|
17
|
+
import { power } from "../../../../tree/nodes/operators/powerNode.js";
|
|
18
|
+
import { substract } from "../../../../tree/nodes/operators/substractNode.js";
|
|
19
|
+
import { VariableNode } from "../../../../tree/nodes/variables/variableNode.js";
|
|
20
|
+
import { coinFlip } from "../../../../utils/alea/coinFlip.js";
|
|
21
|
+
import { probaFlip } from "../../../../utils/alea/probaFlip.js";
|
|
22
|
+
import { probaLawFlip } from "../../../../utils/alea/probaLawFlip.js";
|
|
23
|
+
import { random } from "../../../../utils/alea/random.js";
|
|
24
|
+
import { zip } from "../../../../utils/arrays/arrayZip.js";
|
|
25
|
+
import { handleVEAError } from "../../../../utils/errors/handleVEAError.js";
|
|
26
|
+
const pointO = new Point("O", 0, 0);
|
|
27
|
+
//TODO: frac does not simplify "i"
|
|
28
|
+
// const nodeI = new ComplexNode((0).toTree(), (1).toTree());
|
|
29
|
+
const nodeI = new VariableNode("i");
|
|
30
|
+
const _degreesToRadians = (angleInDegrees, precision) => {
|
|
31
|
+
const oneOver180 = 0.00555555555555555;
|
|
32
|
+
return round(multiply(multiply(angleInDegrees, PiNode), oneOver180).evaluate(), precision);
|
|
33
|
+
};
|
|
34
|
+
const rotateVector = (vec, angle, name) => {
|
|
35
|
+
//x' = cos(t)*x -sin(t)*y
|
|
36
|
+
//y' = sin(t)*x + cos(t)*y
|
|
37
|
+
const cos = Math.cos(angle);
|
|
38
|
+
const sin = Math.sin(angle);
|
|
39
|
+
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());
|
|
40
|
+
};
|
|
41
|
+
const rotatePoint = (target, angle, center, name, precision = 2) => {
|
|
42
|
+
const vSrc = createVector(center, target, "vSrc", precision);
|
|
43
|
+
const vRotated = rotateVector(vSrc, angle, "vRotated");
|
|
44
|
+
return createPoint(add(center.x, vRotated.x).evaluate(), add(center.y, vRotated.y).evaluate(), name, precision);
|
|
45
|
+
};
|
|
46
|
+
const createVector = (from, to, name, precision = 5) => {
|
|
47
|
+
return new Vector(name, round(substract(to.x, from.x).evaluate(), precision).toTree(), round(substract(to.y, from.y).evaluate(), precision).toTree());
|
|
48
|
+
};
|
|
49
|
+
const createPoint = (x, y, name, precision = 5) => {
|
|
50
|
+
return new Point(name, round(x, precision), round(y, precision));
|
|
51
|
+
};
|
|
52
|
+
const createPointForModuleAndArgument = (nodeModule, nodeArgument, name) => new Point(name, multiply(nodeModule, cos(nodeArgument)), multiply(nodeModule, sin(nodeArgument)));
|
|
53
|
+
const getHydrated = (identifiers) => {
|
|
54
|
+
const { nbSides, pointIds, indexTarget, exponent } = identifiers;
|
|
55
|
+
const nodeAngleBase = frac(multiply(2, PiNode), nbSides);
|
|
56
|
+
const arrDictPointAndAffix = pointIds.map((pointIds, i) => {
|
|
57
|
+
const point = PointConstructor.fromIdentifiers(pointIds);
|
|
58
|
+
const nodeArgument = multiply(i, nodeAngleBase).simplify({
|
|
59
|
+
towardsDistribute: false,
|
|
60
|
+
});
|
|
61
|
+
const nodeAffix = exp(multiply(nodeI, nodeArgument));
|
|
62
|
+
return {
|
|
63
|
+
point,
|
|
64
|
+
nodeArgument,
|
|
65
|
+
nodeAffix,
|
|
66
|
+
};
|
|
67
|
+
});
|
|
68
|
+
const strNamePolygon = arrDictPointAndAffix.reduce((acc, { point }) => acc + point.name, "");
|
|
69
|
+
const nodeAffixTarget = arrDictPointAndAffix[indexTarget].nodeAffix;
|
|
70
|
+
const nodeAffixInstruction = power(nodeAffixTarget, exponent);
|
|
71
|
+
const nodeArgumentTarget = arrDictPointAndAffix[indexTarget].nodeArgument;
|
|
72
|
+
const nodeAffixAnswer = exp(multiply(nodeI, multiply(exponent, nodeArgumentTarget)));
|
|
73
|
+
const indexAnswer = (indexTarget * exponent) % nbSides;
|
|
74
|
+
return {
|
|
75
|
+
strNamePolygon,
|
|
76
|
+
nodeAngleBase,
|
|
77
|
+
arrDictPointAndAffix,
|
|
78
|
+
nodeArgumentTarget,
|
|
79
|
+
nodeAffixTarget,
|
|
80
|
+
nodeAffixInstruction,
|
|
81
|
+
indexAnswer,
|
|
82
|
+
nodeAffixAnswer,
|
|
83
|
+
};
|
|
84
|
+
};
|
|
85
|
+
const getInstruction = (identifiers) => {
|
|
86
|
+
const { nbSides } = identifiers;
|
|
87
|
+
const { nodeAffixInstruction, strNamePolygon } = getHydrated(identifiers);
|
|
88
|
+
return `Les points du polygone $${strNamePolygon}$ sont les points images des racines $${nbSides}$èmes de l'unité.
|
|
89
|
+
Quel est le point d'affixe $${nodeAffixInstruction.toTex()}$ ?`;
|
|
90
|
+
};
|
|
91
|
+
const getAnswer = (identifiers) => {
|
|
92
|
+
const { arrDictPointAndAffix, indexAnswer } = getHydrated(identifiers);
|
|
93
|
+
const { point } = arrDictPointAndAffix[indexAnswer];
|
|
94
|
+
return point.name;
|
|
95
|
+
};
|
|
96
|
+
const getHint = (identifiers) => {
|
|
97
|
+
const { exponent } = identifiers;
|
|
98
|
+
const { nodeAffixTarget } = getHydrated(identifiers);
|
|
99
|
+
return `Soit $\\alpha$ un nombre réel et $n$ un nombre entier.
|
|
100
|
+
Le calcul des puissances d'une exponentielle complexe est simple :
|
|
101
|
+
|
|
102
|
+
$$
|
|
103
|
+
(e^{i \\alpha})^n = e^{i (n \\alpha)}
|
|
104
|
+
$$
|
|
105
|
+
|
|
106
|
+
L'argument de $(e^{i \\alpha})^n$ est $n$ fois $\\alpha$.
|
|
107
|
+
Tu peux donc répérer la rotation qu'il faut effectuer pour partir du point $A$ et arriver au point d'affixe $${nodeAffixTarget.toTex()}$
|
|
108
|
+
et la faire $${exponent}$ fois en partant du point $A$.`;
|
|
109
|
+
};
|
|
110
|
+
const getCorrection = (identifiers) => {
|
|
111
|
+
const { exponent, indexTarget, nbSides } = identifiers;
|
|
112
|
+
const { nodeAffixInstruction, nodeAffixTarget, nodeArgumentTarget, nodeAffixAnswer, arrDictPointAndAffix, indexAnswer, } = getHydrated(identifiers);
|
|
113
|
+
const { point: pointTarget } = arrDictPointAndAffix[indexTarget];
|
|
114
|
+
const { point: pointAnswer } = arrDictPointAndAffix[indexAnswer];
|
|
115
|
+
return `Le calcul des puissances d'une exponentielle complexe est simple :
|
|
116
|
+
|
|
117
|
+
$$
|
|
118
|
+
${nodeAffixInstruction.toTex()} = ${nodeAffixAnswer.toTex()}
|
|
119
|
+
$$
|
|
120
|
+
|
|
121
|
+
Le point d'affixe $${nodeAffixTarget.toTex()}$ est le point $${pointTarget.name}$.
|
|
122
|
+
On effectue une rotation d'angle $${nodeArgumentTarget.toTex()}$ pour partir du point $A$ arriver au point $${pointTarget.name}$.
|
|
123
|
+
|
|
124
|
+
On effectue $${exponent}$ fois cette rotation en partant du point $A$.
|
|
125
|
+
On tombe sur le point $${pointAnswer.toTex()}$.
|
|
126
|
+
|
|
127
|
+
En effet :
|
|
128
|
+
|
|
129
|
+
$$
|
|
130
|
+
{${indexTarget} \\times ${exponent}} \\equiv ${indexAnswer} \\pmod{${nbSides}}
|
|
131
|
+
$$
|
|
132
|
+
|
|
133
|
+
`;
|
|
134
|
+
};
|
|
135
|
+
const getCorrectionGGBOptions = (identifiers) => {
|
|
136
|
+
const { nbSides, exponent, indexTarget } = identifiers;
|
|
137
|
+
const { arrDictPointAndAffix, nodeArgumentTarget } = getHydrated(identifiers);
|
|
138
|
+
const arrPoint = arrDictPointAndAffix.map(({ point }) => point);
|
|
139
|
+
const [arrArrPointForArcs, arrArrPointForArrows] = (() => {
|
|
140
|
+
const arrIndexes = [...Array(exponent + 1).keys()].map((i) => (i * indexTarget) % nbSides);
|
|
141
|
+
const arrPointForIndexes = arrIndexes.map((index) => arrDictPointAndAffix[index].point);
|
|
142
|
+
const arrArrArrPointForArcs = zip(arrPointForIndexes.slice(0, -1), arrPointForIndexes.slice(1)).map(([pointRawStart, pointRawEnd], i) => {
|
|
143
|
+
const factor = 0.5 + (i * 0.5) / exponent;
|
|
144
|
+
const [pointArcStart, pointArcEnd] = [pointRawStart, pointRawEnd].map((pointRaw) => new Point("NoName", multiply(factor, pointRaw.x), multiply(factor, pointRaw.y)));
|
|
145
|
+
const pointArrowStart = rotatePoint(pointArcStart, multiply(0.97, nodeArgumentTarget).evaluate(), pointO, "NoName", 5);
|
|
146
|
+
const arrPointForArcs = [pointArcStart, pointArcEnd];
|
|
147
|
+
const arrPointForArrows = [pointArrowStart, pointArcEnd];
|
|
148
|
+
return [arrPointForArcs, arrPointForArrows];
|
|
149
|
+
});
|
|
150
|
+
const arrArrPointForArcs = arrArrArrPointForArcs.map(([arrPointForArcs, _]) => arrPointForArcs);
|
|
151
|
+
const arrArrPointForArrows = arrArrArrPointForArcs.map(([_, arrPointForArrows]) => arrPointForArrows);
|
|
152
|
+
return [arrArrPointForArcs, arrArrPointForArrows];
|
|
153
|
+
})();
|
|
154
|
+
const strLineColor = `"${colorWithOpacity("#000000", 26)}"`;
|
|
155
|
+
const arrStrCaption = "①②③④⑤⑥⑦⑧⑨".split("");
|
|
156
|
+
const ggb = new GeogebraConstructor({
|
|
157
|
+
isGridSimple: true,
|
|
158
|
+
commands: [
|
|
159
|
+
//points
|
|
160
|
+
...[pointO, ...arrPoint].flatMap((point) => point.toGGBCommand({
|
|
161
|
+
isFixed: true,
|
|
162
|
+
isSelectionnable: true,
|
|
163
|
+
showLabel: true,
|
|
164
|
+
})),
|
|
165
|
+
//segments (rays)
|
|
166
|
+
...arrPoint.flatMap((point, i) => [
|
|
167
|
+
`segRay${i} = Segment(${pointO.toMathString()}, ${point.toMathString()})`,
|
|
168
|
+
`SetColor(segRay${i}, ${strLineColor})`,
|
|
169
|
+
`SetLineThickness(segRay${i}, 1)`,
|
|
170
|
+
`SetLineStyle(segRay${i}, 1)`,
|
|
171
|
+
]),
|
|
172
|
+
//arcs
|
|
173
|
+
...arrArrPointForArcs.flatMap(([pointArcStart, pointArcEnd], i) => [
|
|
174
|
+
`arc${i} = CircleArc(${pointO.toMathString()}, ${pointArcStart.toMathString()}, ${pointArcEnd.toMathString()})`,
|
|
175
|
+
// `SetColor(arc${i}, ${strLineColor})`,
|
|
176
|
+
`SetLineThickness(arc${i}, 3)`,
|
|
177
|
+
`SetLineStyle(arc${i}, 0)`,
|
|
178
|
+
// `SetDecoration(arc${i}, 2)`,
|
|
179
|
+
`SetCaption(arc${i}, "${arrStrCaption[i]}")`,
|
|
180
|
+
`ShowLabel(arc${i}, true)`,
|
|
181
|
+
]),
|
|
182
|
+
//arrows
|
|
183
|
+
...arrArrPointForArrows.flatMap(([pointArrowStart, pointArrowEnd], i) => [
|
|
184
|
+
`vecArrow${i} = Vector(${pointArrowStart.toMathString()}, ${pointArrowEnd.toMathString()})`,
|
|
185
|
+
// `SetLineThickness(vecArrow${i}, 1)`,
|
|
186
|
+
]),
|
|
187
|
+
],
|
|
188
|
+
fontSize: 16,
|
|
189
|
+
xAxis: {
|
|
190
|
+
hideNumbers: true,
|
|
191
|
+
},
|
|
192
|
+
yAxis: {
|
|
193
|
+
hideNumbers: true,
|
|
194
|
+
},
|
|
195
|
+
});
|
|
196
|
+
const radius = 1;
|
|
197
|
+
const lForFrame = radius + 0.1;
|
|
198
|
+
return ggb.getOptions({
|
|
199
|
+
coords: [-lForFrame, lForFrame, -lForFrame, lForFrame],
|
|
200
|
+
});
|
|
201
|
+
};
|
|
202
|
+
const getGGBOptions = (identifiers) => {
|
|
203
|
+
const { arrDictPointAndAffix } = getHydrated(identifiers);
|
|
204
|
+
const arrPoint = arrDictPointAndAffix.map(({ point }) => point);
|
|
205
|
+
const pointO = new Point("O", 0, 0);
|
|
206
|
+
const strLineColor = `"${colorWithOpacity("#000000", 26)}"`;
|
|
207
|
+
const ggb = new GeogebraConstructor({
|
|
208
|
+
isGridSimple: true,
|
|
209
|
+
commands: [
|
|
210
|
+
//points
|
|
211
|
+
...[pointO, ...arrPoint].flatMap((point) => point.toGGBCommand({
|
|
212
|
+
isFixed: true,
|
|
213
|
+
isSelectionnable: true,
|
|
214
|
+
showLabel: true,
|
|
215
|
+
})),
|
|
216
|
+
//segments (rays)
|
|
217
|
+
...arrPoint.flatMap((point, i) => [
|
|
218
|
+
`segRay${i} = Segment(${pointO.toMathString()}, ${point.toMathString()})`,
|
|
219
|
+
`SetColor(segRay${i}, ${strLineColor})`,
|
|
220
|
+
`SetLineThickness(segRay${i}, 1)`,
|
|
221
|
+
`SetLineStyle(segRay${i}, 1)`,
|
|
222
|
+
]),
|
|
223
|
+
],
|
|
224
|
+
fontSize: 16,
|
|
225
|
+
xAxis: {
|
|
226
|
+
hideNumbers: true,
|
|
227
|
+
},
|
|
228
|
+
yAxis: {
|
|
229
|
+
hideNumbers: true,
|
|
230
|
+
},
|
|
231
|
+
});
|
|
232
|
+
const radius = 1;
|
|
233
|
+
const lForFrame = radius + 0.1;
|
|
234
|
+
return ggb.getOptions({
|
|
235
|
+
coords: [-lForFrame, lForFrame, -lForFrame, lForFrame],
|
|
236
|
+
});
|
|
237
|
+
};
|
|
238
|
+
const getPropositions = (n, { answer, ...identifiers }) => {
|
|
239
|
+
const propositions = [];
|
|
240
|
+
addValidProp(propositions, answer);
|
|
241
|
+
const { nbSides, indexTarget, exponent } = identifiers;
|
|
242
|
+
const { indexAnswer, arrDictPointAndAffix } = getHydrated(identifiers);
|
|
243
|
+
//student: almost there: offset
|
|
244
|
+
if (probaFlip(0.3)) {
|
|
245
|
+
const vAbsOffset = probaLawFlip([
|
|
246
|
+
[1, 0.5],
|
|
247
|
+
[2, 0.3],
|
|
248
|
+
[3, 0.2],
|
|
249
|
+
]);
|
|
250
|
+
const indexWrong = (() => {
|
|
251
|
+
const indexRaw = (indexAnswer + (coinFlip() ? +1 : -1) * vAbsOffset) % nbSides;
|
|
252
|
+
if (indexRaw >= 0) {
|
|
253
|
+
return indexRaw;
|
|
254
|
+
}
|
|
255
|
+
else {
|
|
256
|
+
return nbSides + indexRaw;
|
|
257
|
+
}
|
|
258
|
+
})();
|
|
259
|
+
const { point: pointWrong } = arrDictPointAndAffix[indexWrong];
|
|
260
|
+
tryToAddWrongProp(propositions, pointWrong.name);
|
|
261
|
+
}
|
|
262
|
+
//student: a \\times exponent -> a + exponent
|
|
263
|
+
{
|
|
264
|
+
const indexWrong = (indexTarget + exponent) % nbSides;
|
|
265
|
+
const { point: pointWrong } = arrDictPointAndAffix[indexWrong];
|
|
266
|
+
tryToAddWrongProp(propositions, pointWrong.name);
|
|
267
|
+
}
|
|
268
|
+
//student: (exp(i argumentTarget))^n -> (exp(i baseAngle))^n
|
|
269
|
+
{
|
|
270
|
+
const indexWrong = (1 * exponent) % nbSides;
|
|
271
|
+
const { point: pointWrong } = arrDictPointAndAffix[indexWrong];
|
|
272
|
+
tryToAddWrongProp(propositions, pointWrong.name);
|
|
273
|
+
}
|
|
274
|
+
//filler
|
|
275
|
+
propWhile(propositions, n, () => {
|
|
276
|
+
if (nbSides < n) {
|
|
277
|
+
tryToAddWrongProp(propositions, "O");
|
|
278
|
+
}
|
|
279
|
+
const { point: pointWrong } = random(arrDictPointAndAffix);
|
|
280
|
+
tryToAddWrongProp(propositions, pointWrong.name);
|
|
281
|
+
});
|
|
282
|
+
return shuffleProps(propositions, n).toSorted((proposition1, proposition2) => proposition1.statement.localeCompare(proposition2.statement));
|
|
283
|
+
};
|
|
284
|
+
const getKeys = (identifiers) => {
|
|
285
|
+
const { arrDictPointAndAffix } = getHydrated(identifiers);
|
|
286
|
+
return arrDictPointAndAffix.map(({ point }) => point.name);
|
|
287
|
+
};
|
|
288
|
+
const isAnswerValid = (ans, { answer }) => {
|
|
289
|
+
try {
|
|
290
|
+
return ans === answer;
|
|
291
|
+
}
|
|
292
|
+
catch (err) {
|
|
293
|
+
return handleVEAError(err);
|
|
294
|
+
}
|
|
295
|
+
};
|
|
296
|
+
// const createRandomIdentifiers = (opts: Options) => {};
|
|
297
|
+
const getComplexGeomFindPointFromPowerOfUnitRootFromFigureQuestion = () => {
|
|
298
|
+
const nbSides = randint(3, 9);
|
|
299
|
+
const nodeAngleBase = frac(multiply(2, PiNode), nbSides);
|
|
300
|
+
const arrLetter = "ABCDEFGHIJKL".split("");
|
|
301
|
+
const arrPoint = [...Array(nbSides).keys()].map((i) => {
|
|
302
|
+
const letter = arrLetter[i];
|
|
303
|
+
const nodeModule = (1).toTree();
|
|
304
|
+
const nodeArgument = multiply(i, nodeAngleBase);
|
|
305
|
+
const point = createPointForModuleAndArgument(nodeModule, nodeArgument, letter);
|
|
306
|
+
const pointEvaluated = new Point(point.name, point.x.evaluate(), point.y.evaluate());
|
|
307
|
+
return pointEvaluated;
|
|
308
|
+
});
|
|
309
|
+
const indexTarget = randint(1, nbSides);
|
|
310
|
+
const exponent = probaFlip(0.2)
|
|
311
|
+
? lcm(indexTarget, nbSides) / indexTarget
|
|
312
|
+
: randint(2, 4);
|
|
313
|
+
const identifiers = {
|
|
314
|
+
nbSides,
|
|
315
|
+
pointIds: arrPoint.map((point) => point.toIdentifiers()),
|
|
316
|
+
indexTarget,
|
|
317
|
+
exponent,
|
|
318
|
+
};
|
|
319
|
+
return getQuestionFromIdentifiers(identifiers);
|
|
320
|
+
};
|
|
321
|
+
const getQuestionFromIdentifiers = (identifiers, opts) => {
|
|
322
|
+
const question = {
|
|
323
|
+
answer: getAnswer(identifiers),
|
|
324
|
+
instruction: getInstruction(identifiers),
|
|
325
|
+
keys: getKeys(identifiers, opts),
|
|
326
|
+
answerFormat: "tex",
|
|
327
|
+
identifiers,
|
|
328
|
+
hint: getHint(identifiers),
|
|
329
|
+
correction: getCorrection(identifiers),
|
|
330
|
+
correctionGgbOptions: getCorrectionGGBOptions(identifiers),
|
|
331
|
+
ggbOptions: getGGBOptions(identifiers, opts),
|
|
332
|
+
};
|
|
333
|
+
return question;
|
|
334
|
+
};
|
|
335
|
+
export const complexGeomFindPointFromPowerOfUnitRootFromFigure = {
|
|
336
|
+
id: "complexGeomFindPointFromPowerOfUnitRootFromFigure",
|
|
337
|
+
label: "Déterminer le point dont l'affixe est une puissance d'une racine nième de l'unité",
|
|
338
|
+
isSingleStep: true,
|
|
339
|
+
generator: (nb, opts) => getDistinctQuestions(() => getComplexGeomFindPointFromPowerOfUnitRootFromFigureQuestion(opts), nb),
|
|
340
|
+
qcmTimer: 60,
|
|
341
|
+
freeTimer: 60,
|
|
342
|
+
isAnswerValid,
|
|
343
|
+
getPropositions,
|
|
344
|
+
subject: "Mathématiques",
|
|
345
|
+
getQuestionFromIdentifiers,
|
|
346
|
+
hasHintAndCorrection: true,
|
|
347
|
+
hasGeogebra: true,
|
|
348
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"complexGeomPlaceAffixPoint.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/complex/geometric/complexGeomPlaceAffixPoint.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAST,MAAM,6BAA6B,CAAC;AAQrC,KAAK,WAAW,GAAG;IACjB,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;CACZ,CAAC;AA4EF,eAAO,MAAM,0BAA0B,EAAE,QAAQ,CAAC,WAAW,CAiB5D,CAAC"}
|