math-exercises 3.0.213 → 3.0.215
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/exercises/math/arithmetic/findLeftInHugeNumberDivision.d.ts +9 -0
- package/lib/exercises/math/arithmetic/findLeftInHugeNumberDivision.d.ts.map +1 -0
- package/lib/exercises/math/arithmetic/findLeftInHugeNumberDivision.js +194 -0
- package/lib/exercises/math/arithmetic/findMissingNumberToMakeNumberDivisibleBy9.d.ts +8 -0
- package/lib/exercises/math/arithmetic/findMissingNumberToMakeNumberDivisibleBy9.d.ts.map +1 -0
- package/lib/exercises/math/arithmetic/findMissingNumberToMakeNumberDivisibleBy9.js +121 -0
- package/lib/exercises/math/arithmetic/hasDiophantianEquationSolution.js +4 -4
- package/lib/exercises/math/arithmetic/index.d.ts +7 -0
- package/lib/exercises/math/arithmetic/index.d.ts.map +1 -1
- package/lib/exercises/math/arithmetic/index.js +7 -0
- package/lib/exercises/math/arithmetic/isBigNumberPrime.d.ts +7 -0
- package/lib/exercises/math/arithmetic/isBigNumberPrime.d.ts.map +1 -0
- package/lib/exercises/math/arithmetic/isBigNumberPrime.js +107 -0
- package/lib/exercises/math/arithmetic/numberOfEndingZerosOfBigProduct.d.ts +8 -0
- package/lib/exercises/math/arithmetic/numberOfEndingZerosOfBigProduct.d.ts.map +1 -0
- package/lib/exercises/math/arithmetic/numberOfEndingZerosOfBigProduct.js +139 -0
- package/lib/exercises/math/arithmetic/pgcdFromEuclid.d.ts +8 -0
- package/lib/exercises/math/arithmetic/pgcdFromEuclid.d.ts.map +1 -0
- package/lib/exercises/math/arithmetic/pgcdFromEuclid.js +123 -0
- package/lib/exercises/math/arithmetic/solveDiophantianEquationByUsingPrimality.d.ts +7 -0
- package/lib/exercises/math/arithmetic/solveDiophantianEquationByUsingPrimality.d.ts.map +1 -0
- package/lib/exercises/math/arithmetic/solveDiophantianEquationByUsingPrimality.js +117 -0
- package/lib/exercises/math/arithmetic/whichDayInXDays.d.ts +8 -0
- package/lib/exercises/math/arithmetic/whichDayInXDays.d.ts.map +1 -0
- package/lib/exercises/math/arithmetic/whichDayInXDays.js +81 -0
- package/lib/exercises/math/calcul/fractions/fractionsSumFillInTheBlank.d.ts +15 -0
- package/lib/exercises/math/calcul/fractions/fractionsSumFillInTheBlank.d.ts.map +1 -0
- package/lib/exercises/math/calcul/fractions/fractionsSumFillInTheBlank.js +256 -0
- package/lib/exercises/math/calcul/fractions/index.d.ts +1 -0
- package/lib/exercises/math/calcul/fractions/index.d.ts.map +1 -1
- package/lib/exercises/math/calcul/fractions/index.js +1 -0
- package/lib/exercises/math/calcul/index.d.ts +1 -0
- package/lib/exercises/math/calcul/index.d.ts.map +1 -1
- package/lib/exercises/math/calcul/index.js +1 -0
- package/lib/exercises/math/calcul/mentalCaluls/index.d.ts +3 -0
- package/lib/exercises/math/calcul/mentalCaluls/index.d.ts.map +1 -1
- package/lib/exercises/math/calcul/mentalCaluls/index.js +3 -0
- package/lib/exercises/math/calcul/mentalCaluls/mentalMultiplication101AndFriends.d.ts +10 -0
- package/lib/exercises/math/calcul/mentalCaluls/mentalMultiplication101AndFriends.d.ts.map +1 -0
- package/lib/exercises/math/calcul/mentalCaluls/mentalMultiplication101AndFriends.js +264 -0
- package/lib/exercises/math/calcul/mentalCaluls/mentalMultiplication11AndFriends.d.ts +10 -0
- package/lib/exercises/math/calcul/mentalCaluls/mentalMultiplication11AndFriends.d.ts.map +1 -0
- package/lib/exercises/math/calcul/mentalCaluls/mentalMultiplication11AndFriends.js +264 -0
- package/lib/exercises/math/calcul/mentalCaluls/mentalMultiplicationTable.d.ts +11 -0
- package/lib/exercises/math/calcul/mentalCaluls/mentalMultiplicationTable.d.ts.map +1 -0
- package/lib/exercises/math/calcul/mentalCaluls/mentalMultiplicationTable.js +141 -0
- package/lib/exercises/math/calcul/ratio/index.d.ts +1 -0
- package/lib/exercises/math/calcul/ratio/index.d.ts.map +1 -1
- package/lib/exercises/math/calcul/ratio/index.js +1 -0
- package/lib/exercises/math/calcul/ratio/partsUsingRatio.d.ts +13 -0
- package/lib/exercises/math/calcul/ratio/partsUsingRatio.d.ts.map +1 -0
- package/lib/exercises/math/calcul/ratio/partsUsingRatio.js +237 -0
- package/lib/exercises/math/calcul/relatives/index.d.ts +2 -0
- package/lib/exercises/math/calcul/relatives/index.d.ts.map +1 -0
- package/lib/exercises/math/calcul/relatives/index.js +1 -0
- package/lib/exercises/math/calcul/relatives/relativesAddAndSub.d.ts +17 -0
- package/lib/exercises/math/calcul/relatives/relativesAddAndSub.d.ts.map +1 -0
- package/lib/exercises/math/calcul/relatives/relativesAddAndSub.js +448 -0
- package/lib/exercises/math/calculLitteral/factorisation/factoByXK.d.ts +10 -0
- package/lib/exercises/math/calculLitteral/factorisation/factoByXK.d.ts.map +1 -0
- package/lib/exercises/math/calculLitteral/factorisation/factoByXK.js +190 -0
- package/lib/exercises/math/calculLitteral/factorisation/index.d.ts +1 -0
- package/lib/exercises/math/calculLitteral/factorisation/index.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/factorisation/index.js +1 -0
- package/lib/exercises/math/complex/algebraic/addComplex.d.ts +10 -0
- package/lib/exercises/math/complex/algebraic/addComplex.d.ts.map +1 -0
- package/lib/exercises/math/complex/algebraic/addComplex.js +125 -0
- package/lib/exercises/math/complex/algebraic/conjugateComplex.d.ts +8 -0
- package/lib/exercises/math/complex/algebraic/conjugateComplex.d.ts.map +1 -0
- package/lib/exercises/math/complex/algebraic/conjugateComplex.js +105 -0
- package/lib/exercises/math/complex/algebraic/conjugateDivideComplex.d.ts +8 -0
- package/lib/exercises/math/complex/algebraic/conjugateDivideComplex.d.ts.map +1 -0
- package/lib/exercises/math/complex/algebraic/conjugateDivideComplex.js +137 -0
- package/lib/exercises/math/complex/algebraic/conjugateMultiplyComplex.d.ts +8 -0
- package/lib/exercises/math/complex/algebraic/conjugateMultiplyComplex.d.ts.map +1 -0
- package/lib/exercises/math/complex/algebraic/conjugateMultiplyComplex.js +116 -0
- package/lib/exercises/math/complex/algebraic/divideComplex.d.ts +8 -0
- package/lib/exercises/math/complex/algebraic/divideComplex.d.ts.map +1 -0
- package/lib/exercises/math/complex/algebraic/divideComplex.js +128 -0
- package/lib/exercises/math/complex/algebraic/index.d.ts +11 -0
- package/lib/exercises/math/complex/algebraic/index.d.ts.map +1 -0
- package/lib/exercises/math/complex/algebraic/index.js +10 -0
- package/lib/exercises/math/complex/algebraic/inverseComplex.d.ts +8 -0
- package/lib/exercises/math/complex/algebraic/inverseComplex.d.ts.map +1 -0
- package/lib/exercises/math/complex/algebraic/inverseComplex.js +95 -0
- package/lib/exercises/math/complex/algebraic/linearCombinaisonComplex.d.ts +10 -0
- package/lib/exercises/math/complex/algebraic/linearCombinaisonComplex.d.ts.map +1 -0
- package/lib/exercises/math/complex/algebraic/linearCombinaisonComplex.js +105 -0
- package/lib/exercises/math/complex/algebraic/moduloFromAlgebraicComplex.d.ts +8 -0
- package/lib/exercises/math/complex/algebraic/moduloFromAlgebraicComplex.d.ts.map +1 -0
- package/lib/exercises/math/complex/algebraic/moduloFromAlgebraicComplex.js +93 -0
- package/lib/exercises/math/complex/algebraic/mutiplyComplex.d.ts +8 -0
- package/lib/exercises/math/complex/algebraic/mutiplyComplex.d.ts.map +1 -0
- package/lib/exercises/math/complex/algebraic/mutiplyComplex.js +106 -0
- package/lib/exercises/math/complex/algebraic/reAndIm.d.ts +9 -0
- package/lib/exercises/math/complex/algebraic/reAndIm.d.ts.map +1 -0
- package/lib/exercises/math/complex/algebraic/reAndIm.js +92 -0
- package/lib/exercises/math/complex/geometric/complexAlgebraicFromModuloAndArg.d.ts +9 -0
- package/lib/exercises/math/complex/geometric/complexAlgebraicFromModuloAndArg.d.ts.map +1 -0
- package/lib/exercises/math/complex/geometric/complexAlgebraicFromModuloAndArg.js +151 -0
- package/lib/exercises/math/complex/geometric/complexDistance.d.ts +11 -0
- package/lib/exercises/math/complex/geometric/complexDistance.d.ts.map +1 -0
- package/lib/exercises/math/complex/geometric/complexDistance.js +125 -0
- package/lib/exercises/math/complex/geometric/complexGeomAffixAlgFromPoint.d.ts +9 -0
- package/lib/exercises/math/complex/geometric/complexGeomAffixAlgFromPoint.d.ts.map +1 -0
- package/lib/exercises/math/complex/geometric/complexGeomAffixAlgFromPoint.js +326 -0
- package/lib/exercises/math/complex/geometric/complexGeomAffixExpFromCenteredRegularPolygon.d.ts +10 -0
- package/lib/exercises/math/complex/geometric/complexGeomAffixExpFromCenteredRegularPolygon.d.ts.map +1 -0
- package/lib/exercises/math/complex/geometric/complexGeomAffixExpFromCenteredRegularPolygon.js +459 -0
- package/lib/exercises/math/complex/geometric/complexGeomAffixExpFromPoint.d.ts +14 -0
- package/lib/exercises/math/complex/geometric/complexGeomAffixExpFromPoint.d.ts.map +1 -0
- package/lib/exercises/math/complex/geometric/complexGeomAffixExpFromPoint.js +539 -0
- package/lib/exercises/math/complex/geometric/complexGeomAffixTrigFromPoint.d.ts +13 -0
- package/lib/exercises/math/complex/geometric/complexGeomAffixTrigFromPoint.d.ts.map +1 -0
- package/lib/exercises/math/complex/geometric/complexGeomAffixTrigFromPoint.js +485 -0
- package/lib/exercises/math/complex/geometric/complexGeomApproxOfCosArgOrSinArgFromPointAndAffixTrig.d.ts +12 -0
- package/lib/exercises/math/complex/geometric/complexGeomApproxOfCosArgOrSinArgFromPointAndAffixTrig.d.ts.map +1 -0
- package/lib/exercises/math/complex/geometric/complexGeomApproxOfCosArgOrSinArgFromPointAndAffixTrig.js +224 -0
- package/lib/exercises/math/complex/geometric/complexGeomArgumentOfFracCBABFromFigure.d.ts +11 -0
- package/lib/exercises/math/complex/geometric/complexGeomArgumentOfFracCBABFromFigure.d.ts.map +1 -0
- package/lib/exercises/math/complex/geometric/complexGeomArgumentOfFracCBABFromFigure.js +448 -0
- package/lib/exercises/math/complex/geometric/complexGeomFindPointFromAffixExp.d.ts +11 -0
- package/lib/exercises/math/complex/geometric/complexGeomFindPointFromAffixExp.d.ts.map +1 -0
- package/lib/exercises/math/complex/geometric/complexGeomFindPointFromAffixExp.js +223 -0
- package/lib/exercises/math/complex/geometric/complexGeomFindPointFromPowerOfUnitRootFromFigure.d.ts +11 -0
- package/lib/exercises/math/complex/geometric/complexGeomFindPointFromPowerOfUnitRootFromFigure.d.ts.map +1 -0
- package/lib/exercises/math/complex/geometric/complexGeomFindPointFromPowerOfUnitRootFromFigure.js +348 -0
- package/lib/exercises/math/complex/geometric/complexGeomPlaceAffixPoint.d.ts +8 -0
- package/lib/exercises/math/complex/geometric/complexGeomPlaceAffixPoint.d.ts.map +1 -0
- package/lib/exercises/math/complex/geometric/complexGeomPlaceAffixPoint.js +86 -0
- package/lib/exercises/math/complex/geometric/complexGeomPlacePointFromZAPlusZ.d.ts +11 -0
- package/lib/exercises/math/complex/geometric/complexGeomPlacePointFromZAPlusZ.d.ts.map +1 -0
- package/lib/exercises/math/complex/geometric/complexGeomPlacePointFromZAPlusZ.js +311 -0
- package/lib/exercises/math/complex/geometric/complexGeomPlacePointFromZATimesZ.d.ts +11 -0
- package/lib/exercises/math/complex/geometric/complexGeomPlacePointFromZATimesZ.d.ts.map +1 -0
- package/lib/exercises/math/complex/geometric/complexGeomPlacePointFromZATimesZ.js +345 -0
- package/lib/exercises/math/complex/geometric/complexGeomPlacePointFromZATransformed.d.ts +16 -0
- package/lib/exercises/math/complex/geometric/complexGeomPlacePointFromZATransformed.d.ts.map +1 -0
- package/lib/exercises/math/complex/geometric/complexGeomPlacePointFromZATransformed.js +729 -0
- package/lib/exercises/math/complex/geometric/complexGeomPlacePointWithAffixInU.d.ts +11 -0
- package/lib/exercises/math/complex/geometric/complexGeomPlacePointWithAffixInU.d.ts.map +1 -0
- package/lib/exercises/math/complex/geometric/complexGeomPlacePointWithAffixInU.js +253 -0
- package/lib/exercises/math/complex/geometric/index.d.ts +12 -0
- package/lib/exercises/math/complex/geometric/index.d.ts.map +1 -0
- package/lib/exercises/math/complex/geometric/index.js +19 -0
- package/lib/exercises/math/complex/index.d.ts +4 -10
- package/lib/exercises/math/complex/index.d.ts.map +1 -1
- package/lib/exercises/math/complex/index.js +4 -11
- package/lib/exercises/math/complex/polynomials/factorizePolynomialInC.d.ts +10 -0
- package/lib/exercises/math/complex/polynomials/factorizePolynomialInC.d.ts.map +1 -0
- package/lib/exercises/math/complex/polynomials/factorizePolynomialInC.js +176 -0
- package/lib/exercises/math/complex/polynomials/index.d.ts +4 -0
- package/lib/exercises/math/complex/polynomials/index.d.ts.map +1 -0
- package/lib/exercises/math/complex/polynomials/index.js +3 -0
- package/lib/exercises/math/complex/polynomials/solveSecondDegreeInComplex.d.ts +10 -0
- package/lib/exercises/math/complex/polynomials/solveSecondDegreeInComplex.d.ts.map +1 -0
- package/lib/exercises/math/complex/polynomials/solveSecondDegreeInComplex.js +190 -0
- package/lib/exercises/math/complex/polynomials/solveZSquareEqualsA.d.ts +11 -0
- package/lib/exercises/math/complex/polynomials/solveZSquareEqualsA.d.ts.map +1 -0
- package/lib/exercises/math/complex/polynomials/solveZSquareEqualsA.js +158 -0
- package/lib/exercises/math/complex/unitRoots/giveNUnitRoot.d.ts +7 -0
- package/lib/exercises/math/complex/unitRoots/giveNUnitRoot.d.ts.map +1 -0
- package/lib/exercises/math/complex/unitRoots/giveNUnitRoot.js +122 -0
- package/lib/exercises/math/complex/unitRoots/giveOneSolutionToComplexPowNEqualsOne.d.ts +8 -0
- package/lib/exercises/math/complex/unitRoots/giveOneSolutionToComplexPowNEqualsOne.d.ts.map +1 -0
- package/lib/exercises/math/complex/unitRoots/giveOneSolutionToComplexPowNEqualsOne.js +138 -0
- package/lib/exercises/math/complex/unitRoots/index.d.ts +3 -0
- package/lib/exercises/math/complex/unitRoots/index.d.ts.map +1 -0
- package/lib/exercises/math/complex/unitRoots/index.js +2 -0
- package/lib/exercises/math/conversion/clock/clockReading.d.ts +12 -0
- package/lib/exercises/math/conversion/clock/clockReading.d.ts.map +1 -0
- package/lib/exercises/math/conversion/clock/clockReading.js +385 -0
- package/lib/exercises/math/conversion/clock/clockReadingPlusTimeOperation.d.ts +2 -0
- package/lib/exercises/math/conversion/clock/clockReadingPlusTimeOperation.d.ts.map +1 -0
- package/lib/exercises/math/conversion/clock/clockReadingPlusTimeOperation.js +521 -0
- package/lib/exercises/math/conversion/clock/clockWritingByManipulatingNeedles.d.ts +2 -0
- package/lib/exercises/math/conversion/clock/clockWritingByManipulatingNeedles.d.ts.map +1 -0
- package/lib/exercises/math/conversion/clock/clockWritingByManipulatingNeedles.js +359 -0
- package/lib/exercises/math/conversion/clock/dateTimeOperationAdd.d.ts +16 -0
- package/lib/exercises/math/conversion/clock/dateTimeOperationAdd.d.ts.map +1 -0
- package/lib/exercises/math/conversion/clock/dateTimeOperationAdd.js +319 -0
- package/lib/exercises/math/conversion/clock/index.d.ts +3 -0
- package/lib/exercises/math/conversion/clock/index.d.ts.map +1 -0
- package/lib/exercises/math/conversion/clock/index.js +4 -0
- package/lib/exercises/math/conversion/index.d.ts +1 -0
- package/lib/exercises/math/conversion/index.d.ts.map +1 -1
- package/lib/exercises/math/conversion/index.js +1 -0
- package/lib/exercises/math/geometry/angles/angleNatureFromFigure.d.ts +11 -0
- package/lib/exercises/math/geometry/angles/angleNatureFromFigure.d.ts.map +1 -0
- package/lib/exercises/math/geometry/angles/angleNatureFromFigure.js +233 -0
- package/lib/exercises/math/geometry/angles/angleNatureFromMeasure.d.ts +10 -0
- package/lib/exercises/math/geometry/angles/angleNatureFromMeasure.d.ts.map +1 -0
- package/lib/exercises/math/geometry/angles/angleNatureFromMeasure.js +137 -0
- package/lib/exercises/math/geometry/angles/index.d.ts +2 -0
- package/lib/exercises/math/geometry/angles/index.d.ts.map +1 -1
- package/lib/exercises/math/geometry/angles/index.js +2 -0
- package/lib/exercises/math/geometry/circles/buildCircleFromRadius.d.ts +9 -0
- package/lib/exercises/math/geometry/circles/buildCircleFromRadius.d.ts.map +1 -0
- package/lib/exercises/math/geometry/circles/buildCircleFromRadius.js +187 -0
- package/lib/exercises/math/geometry/circles/index.d.ts +1 -0
- package/lib/exercises/math/geometry/circles/index.d.ts.map +1 -1
- package/lib/exercises/math/geometry/circles/index.js +1 -0
- package/lib/exercises/math/geometry/lines/buildParallelFromLineAndPoint.d.ts +11 -0
- package/lib/exercises/math/geometry/lines/buildParallelFromLineAndPoint.d.ts.map +1 -0
- package/lib/exercises/math/geometry/lines/buildParallelFromLineAndPoint.js +154 -0
- package/lib/exercises/math/geometry/lines/buildPerpendicularFromLineAndPoint.d.ts +11 -0
- package/lib/exercises/math/geometry/lines/buildPerpendicularFromLineAndPoint.d.ts.map +1 -0
- package/lib/exercises/math/geometry/lines/buildPerpendicularFromLineAndPoint.js +157 -0
- package/lib/exercises/math/geometry/lines/index.d.ts +2 -0
- package/lib/exercises/math/geometry/lines/index.d.ts.map +1 -1
- package/lib/exercises/math/geometry/lines/index.js +2 -0
- package/lib/exercises/math/geometry/triangles/index.d.ts +2 -0
- package/lib/exercises/math/geometry/triangles/index.d.ts.map +1 -1
- package/lib/exercises/math/geometry/triangles/index.js +2 -1
- package/lib/exercises/math/geometry/triangles/traceHeightInTriangle.d.ts +13 -0
- package/lib/exercises/math/geometry/triangles/traceHeightInTriangle.d.ts.map +1 -0
- package/lib/exercises/math/geometry/triangles/traceHeightInTriangle.js +271 -0
- package/lib/exercises/math/geometry/triangles/traceMedianInTriangle.d.ts +8 -0
- package/lib/exercises/math/geometry/triangles/traceMedianInTriangle.d.ts.map +1 -1
- package/lib/exercises/math/geometry/triangles/traceMedianInTriangle.js +284 -53
- package/lib/exercises/math/geometry/vectors/constructions/index.d.ts +1 -0
- package/lib/exercises/math/geometry/vectors/constructions/index.d.ts.map +1 -1
- package/lib/exercises/math/geometry/vectors/constructions/index.js +1 -0
- package/lib/exercises/math/geometry/vectors/constructions/traceVectorSumFromVecs.d.ts +8 -0
- package/lib/exercises/math/geometry/vectors/constructions/traceVectorSumFromVecs.d.ts.map +1 -0
- package/lib/exercises/math/geometry/vectors/constructions/traceVectorSumFromVecs.js +165 -0
- package/lib/exercises/math/geometry/volumes/index.d.ts +1 -0
- package/lib/exercises/math/geometry/volumes/index.d.ts.map +1 -1
- package/lib/exercises/math/geometry/volumes/index.js +1 -0
- package/lib/exercises/math/geometry/volumes/volumeOfCylinder.d.ts +8 -0
- package/lib/exercises/math/geometry/volumes/volumeOfCylinder.d.ts.map +1 -0
- package/lib/exercises/math/geometry/volumes/volumeOfCylinder.js +157 -0
- package/lib/exercises/math/spaceGeometry/basis/index.d.ts +1 -0
- package/lib/exercises/math/spaceGeometry/basis/index.d.ts.map +1 -1
- package/lib/exercises/math/spaceGeometry/basis/index.js +1 -0
- package/lib/exercises/math/spaceGeometry/basis/spaceSegmentLengthInRectangularPrism.d.ts +18 -0
- package/lib/exercises/math/spaceGeometry/basis/spaceSegmentLengthInRectangularPrism.d.ts.map +1 -0
- package/lib/exercises/math/spaceGeometry/basis/spaceSegmentLengthInRectangularPrism.js +538 -0
- package/lib/exercises/math/trigonometry/formulas/trigoAdditionFormulaUsage.d.ts.map +1 -1
- package/lib/exercises/math/trigonometry/formulas/trigoAdditionFormulaUsage.js +6 -5
- package/lib/exercises/math/trigonometry/triangle/trigonometrySohcahtoaCalcul.js +1 -1
- package/lib/exercises/utils/geogebra/toolBarConstructor.d.ts +1 -0
- package/lib/exercises/utils/geogebra/toolBarConstructor.d.ts.map +1 -1
- package/lib/exercises/utils/geogebra/toolBarConstructor.js +2 -0
- package/lib/geogebra/parsers/geogebraParser.d.ts +3 -0
- package/lib/geogebra/parsers/geogebraParser.d.ts.map +1 -1
- package/lib/geogebra/parsers/geogebraParser.js +27 -0
- package/lib/index.d.ts +213 -23
- package/lib/index.d.ts.map +1 -1
- package/lib/latexTester.js +2 -0
- package/lib/math/geometry/angle.d.ts.map +1 -1
- package/lib/math/geometry/angle.js +3 -0
- package/lib/math/geometry/segment.d.ts +1 -1
- package/lib/math/geometry/segment.d.ts.map +1 -1
- package/lib/math/geometry/segment.js +5 -2
- package/lib/math/utils/geometry/angleBetweenPoints.d.ts +4 -0
- package/lib/math/utils/geometry/angleBetweenPoints.d.ts.map +1 -0
- package/lib/math/utils/geometry/angleBetweenPoints.js +58 -0
- package/lib/math/utils/geometry/angleNWSE.d.ts +3 -0
- package/lib/math/utils/geometry/angleNWSE.d.ts.map +1 -0
- package/lib/math/utils/geometry/angleNWSE.js +56 -0
- package/lib/tests/singleExo.test.d.ts.map +1 -1
- package/lib/tests/singleExo.test.js +2 -2
- package/lib/utils/strings/frenchDays.d.ts +2 -0
- package/lib/utils/strings/frenchDays.d.ts.map +1 -0
- package/lib/utils/strings/frenchDays.js +9 -0
- package/package.json +1 -1
|
@@ -0,0 +1,271 @@
|
|
|
1
|
+
import { GeneratorOptionTarget, GeneratorOptionType, } from "../../../../exercises/exercise.js";
|
|
2
|
+
import { toolBarConstructor } from "../../../../exercises/utils/geogebra/toolBarConstructor.js";
|
|
3
|
+
import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions.js";
|
|
4
|
+
import { defaultArrayedOptsWhereNeeded } from "../../../../exercises/utils/options/arrayedOptions.js";
|
|
5
|
+
import { greenMain } from "../../../../geogebra/colors.js";
|
|
6
|
+
import { GeogebraConstructor } from "../../../../geogebra/geogebraConstructor.js";
|
|
7
|
+
import { GeogebraParser } from "../../../../geogebra/parsers/geogebraParser.js";
|
|
8
|
+
import { Point, PointConstructor } from "../../../../math/geometry/point.js";
|
|
9
|
+
import { Triangle, TriangleConstructor, } from "../../../../math/geometry/triangles/triangle.js";
|
|
10
|
+
import { Vector } from "../../../../math/geometry/vector.js";
|
|
11
|
+
import { randint } from "../../../../math/utils/random/randint.js";
|
|
12
|
+
import { round } from "../../../../math/utils/round.js";
|
|
13
|
+
import { PiNode } from "../../../../tree/nodes/numbers/piNode.js";
|
|
14
|
+
import { add } from "../../../../tree/nodes/operators/addNode.js";
|
|
15
|
+
import { multiply } from "../../../../tree/nodes/operators/multiplyNode.js";
|
|
16
|
+
import { substract } from "../../../../tree/nodes/operators/substractNode.js";
|
|
17
|
+
import { coinFlip } from "../../../../utils/alea/coinFlip.js";
|
|
18
|
+
import { random } from "../../../../utils/alea/random.js";
|
|
19
|
+
import { shuffle } from "../../../../utils/alea/shuffle.js";
|
|
20
|
+
import { zip } from "../../../../utils/arrays/arrayZip.js";
|
|
21
|
+
const degreesToRadians = (angleInDegrees, precision) => {
|
|
22
|
+
const oneOver180 = 0.00555555555555555;
|
|
23
|
+
return round(multiply(multiply(angleInDegrees, PiNode), oneOver180).evaluate(), precision);
|
|
24
|
+
};
|
|
25
|
+
const rotateVector = (vec, angle, name) => {
|
|
26
|
+
//x' = cos(t)*x -sin(t)*y
|
|
27
|
+
//y' = sin(t)*x + cos(t)*y
|
|
28
|
+
const cos = Math.cos(angle);
|
|
29
|
+
const sin = Math.sin(angle);
|
|
30
|
+
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());
|
|
31
|
+
};
|
|
32
|
+
const rotatePoint = (target, angle, center, name, precision = 2) => {
|
|
33
|
+
const vSrc = createVector(center, target, "vSrc", precision);
|
|
34
|
+
const vRotated = rotateVector(vSrc, angle, "vRotated");
|
|
35
|
+
return createPoint(add(center.x, vRotated.x).evaluate(), add(center.y, vRotated.y).evaluate(), name, precision);
|
|
36
|
+
};
|
|
37
|
+
const createVector = (from, to, name, precision = 5) => {
|
|
38
|
+
return new Vector(name, round(substract(to.x, from.x).evaluate(), precision).toTree(), round(substract(to.y, from.y).evaluate(), precision).toTree());
|
|
39
|
+
};
|
|
40
|
+
const createPoint = (x, y, name, precision = 5) => {
|
|
41
|
+
return new Point(name, round(x, precision), round(y, precision));
|
|
42
|
+
};
|
|
43
|
+
const getHydrated = (identifiers) => {
|
|
44
|
+
const { triangleIds } = identifiers;
|
|
45
|
+
const triangle = TriangleConstructor.fromIdentifiers(triangleIds);
|
|
46
|
+
const [point] = triangle.points;
|
|
47
|
+
const [segment] = triangle.sides;
|
|
48
|
+
return {
|
|
49
|
+
triangle,
|
|
50
|
+
point,
|
|
51
|
+
segment,
|
|
52
|
+
};
|
|
53
|
+
};
|
|
54
|
+
const getInstruction = (identifiers) => {
|
|
55
|
+
const { strNameTriangle } = identifiers;
|
|
56
|
+
const { point } = getHydrated(identifiers);
|
|
57
|
+
return `Avec les outils disponibles, construire la hauteur de $${strNameTriangle}$ issue de $${point.name}$.`;
|
|
58
|
+
};
|
|
59
|
+
const getGGBAnswer = (identifiers) => {
|
|
60
|
+
const { triangle, point, segment } = getHydrated(identifiers);
|
|
61
|
+
const ggbAnswer = [
|
|
62
|
+
...getStudentGGBCommands(triangle),
|
|
63
|
+
`lPer = PerpendicularLine(${point.name},${segment.ggbName})`,
|
|
64
|
+
`SetColor(lPer, "${greenMain}")`,
|
|
65
|
+
`ang = Angle(${segment.ggbName}, lPer)`,
|
|
66
|
+
`lDashed = Line(${segment.pointA.name}, ${segment.pointB.name})`,
|
|
67
|
+
`SetLineStyle(lDashed, 2)`,
|
|
68
|
+
];
|
|
69
|
+
return ggbAnswer;
|
|
70
|
+
};
|
|
71
|
+
const getHint = (identifiers) => {
|
|
72
|
+
const { point, segment } = getHydrated(identifiers);
|
|
73
|
+
return `Sélectionne l'outil Perpendiculaire dans Geogebra puis clique sur le segment $${segment.toTex()}$ puis sur le point $${point.name}$.`;
|
|
74
|
+
};
|
|
75
|
+
const getCorrection = (identifiers) => {
|
|
76
|
+
const { point, segment } = getHydrated(identifiers);
|
|
77
|
+
return `On sélectionne l'outil Perpendiculaire dans Geogebra puis on clique sur le segment $${segment.toTex()}$ puis sur le point $${point.name}$.`;
|
|
78
|
+
};
|
|
79
|
+
const getCorrectionGGBOptions = (identifiers) => {
|
|
80
|
+
const ggb = new GeogebraConstructor({
|
|
81
|
+
commands: [...getGGBAnswer(identifiers)],
|
|
82
|
+
hideGrid: true,
|
|
83
|
+
hideAxes: true,
|
|
84
|
+
isGridSimple: true,
|
|
85
|
+
fontSize: 16,
|
|
86
|
+
});
|
|
87
|
+
return ggb.getOptions({ coords: [-10, 10, -10, 10] });
|
|
88
|
+
};
|
|
89
|
+
const getStudentGGBCommands = (triangle) => {
|
|
90
|
+
const [point] = triangle.points;
|
|
91
|
+
const [segment] = triangle.sides;
|
|
92
|
+
return [
|
|
93
|
+
...triangle.points.flatMap((point) => point.toGGBCommand({
|
|
94
|
+
isFixed: true,
|
|
95
|
+
isSelectionnable: true,
|
|
96
|
+
showLabel: true,
|
|
97
|
+
})),
|
|
98
|
+
...triangle.sides.flatMap((segment) => segment.toGGBCommands(false, { isFixed: true, isSelectionnable: true })),
|
|
99
|
+
//force display of right angle (if needed)
|
|
100
|
+
...(() => {
|
|
101
|
+
const [angleRightAngle] = triangle.angles.filter((angle) => Math.abs(angle.evaluate(false) - 90) < 0.3);
|
|
102
|
+
if (angleRightAngle !== undefined) {
|
|
103
|
+
if (angleRightAngle.evaluate() === 90) {
|
|
104
|
+
//display is already ok
|
|
105
|
+
return [
|
|
106
|
+
...angleRightAngle.toCommands({
|
|
107
|
+
pointsAreNotBuilt: false,
|
|
108
|
+
showValue: false,
|
|
109
|
+
}),
|
|
110
|
+
];
|
|
111
|
+
}
|
|
112
|
+
else {
|
|
113
|
+
if (angleRightAngle !== undefined) {
|
|
114
|
+
const [pointRightAngle1, pointRightAngle2, pointRightAngle3] = angleRightAngle.points;
|
|
115
|
+
return [
|
|
116
|
+
`lPer = PerpendicularLine(${pointRightAngle2.name},${segment.ggbName})`,
|
|
117
|
+
`SetVisibleInView(lPer, 1, false)`,
|
|
118
|
+
`lPer2 = PerpendicularLine(${point.name},lPer)`,
|
|
119
|
+
`SetVisibleInView(lPer2, 1, false)`,
|
|
120
|
+
`prjct = Intersect(lPer, lPer2)`,
|
|
121
|
+
`SetVisibleInView(prjct, 1, false)`,
|
|
122
|
+
//horror?
|
|
123
|
+
`ang1 = Angle(${pointRightAngle1.name},${pointRightAngle2.name}, prjct)`,
|
|
124
|
+
`ShowLabel(ang1, false)`,
|
|
125
|
+
`ang2 = Angle(prjct,${pointRightAngle2.name},${pointRightAngle1.name})`,
|
|
126
|
+
`ShowLabel(ang2, false)`,
|
|
127
|
+
`SetVisibleInView(ang1, 1, ang1<ang2)`,
|
|
128
|
+
`SetVisibleInView(ang2, 1, ang2<ang1)`,
|
|
129
|
+
`ang3 = Angle(${pointRightAngle3.name},${pointRightAngle2.name}, prjct)`,
|
|
130
|
+
`ShowLabel(ang3, false)`,
|
|
131
|
+
`ang4 = Angle(prjct,${pointRightAngle2.name},${pointRightAngle3.name})`,
|
|
132
|
+
`ShowLabel(ang4, false)`,
|
|
133
|
+
`SetVisibleInView(ang3, 1, ang3<ang4)`,
|
|
134
|
+
`SetVisibleInView(ang4, 1, ang4<ang3)`,
|
|
135
|
+
];
|
|
136
|
+
}
|
|
137
|
+
else {
|
|
138
|
+
return [];
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
else {
|
|
143
|
+
return [];
|
|
144
|
+
}
|
|
145
|
+
})(),
|
|
146
|
+
];
|
|
147
|
+
};
|
|
148
|
+
const getStudentGGBOptions = (identifiers) => {
|
|
149
|
+
const { triangle } = getHydrated(identifiers);
|
|
150
|
+
const commands = getStudentGGBCommands(triangle);
|
|
151
|
+
const studentGGB = new GeogebraConstructor({
|
|
152
|
+
commands,
|
|
153
|
+
hideGrid: true,
|
|
154
|
+
hideAxes: true,
|
|
155
|
+
customToolBar: toolBarConstructor({
|
|
156
|
+
orthogonal: true,
|
|
157
|
+
}),
|
|
158
|
+
});
|
|
159
|
+
return studentGGB.getOptions({
|
|
160
|
+
coords: studentGGB.getCoordsForPoints([...triangle.points]),
|
|
161
|
+
});
|
|
162
|
+
};
|
|
163
|
+
const isGGBAnswerValid = (ans, { ggbAnswer, ...identifiers }) => {
|
|
164
|
+
const { point, segment } = getHydrated(identifiers);
|
|
165
|
+
const commands = ans;
|
|
166
|
+
const ggbParser = new GeogebraParser(commands);
|
|
167
|
+
const objectDict = ggbParser.objectDict();
|
|
168
|
+
const arrStrOrthogonalLine = Object.entries(objectDict)
|
|
169
|
+
.filter(([_, strObj]) => strObj.startsWith("OrthogonalLine"))
|
|
170
|
+
.map(([_, strObj]) => strObj);
|
|
171
|
+
//required: only one orthogonal line
|
|
172
|
+
if (arrStrOrthogonalLine.length !== 1) {
|
|
173
|
+
return false;
|
|
174
|
+
}
|
|
175
|
+
const [strOrthogonalLine] = arrStrOrthogonalLine;
|
|
176
|
+
const [namePointAns, nameLineAns] = GeogebraParser.argNamesForOrthogonalLineObj(strOrthogonalLine);
|
|
177
|
+
return zip([namePointAns, nameLineAns], [point.name, segment.ggbName]).every(([strAns, strAnswer]) => strAns === strAnswer);
|
|
178
|
+
};
|
|
179
|
+
const getTraceHeightInTriangleQuestion = (optsIn) => {
|
|
180
|
+
const arrayedOpts = defaultArrayedOptsWhereNeeded(optsIn, arrayedOptsDefault);
|
|
181
|
+
const opts = {
|
|
182
|
+
heightType: random(arrayedOpts.heightType),
|
|
183
|
+
};
|
|
184
|
+
const [nameA, nameB, nameC] = shuffle(["A", "B", "C"]);
|
|
185
|
+
const [pointARaw, pointBRaw, pointCRaw] = (() => {
|
|
186
|
+
const a = -randint(4, 12);
|
|
187
|
+
const b = +randint(4, 12);
|
|
188
|
+
const pointA = PointConstructor.fromCoords([a, 0], nameA);
|
|
189
|
+
const pointB = PointConstructor.fromCoords([b, 0], nameB);
|
|
190
|
+
switch (opts.heightType) {
|
|
191
|
+
case "intérieure": {
|
|
192
|
+
const c = randint(a + 1, b);
|
|
193
|
+
const h = +randint(4, 12);
|
|
194
|
+
const pointC = PointConstructor.fromCoords([c, h], nameC);
|
|
195
|
+
return [pointA, pointB, pointC];
|
|
196
|
+
}
|
|
197
|
+
case "sur un cathète": {
|
|
198
|
+
const isLeftSide = coinFlip();
|
|
199
|
+
const c = isLeftSide ? a : b;
|
|
200
|
+
const h = +randint(4, 12);
|
|
201
|
+
const pointC = PointConstructor.fromCoords([c, h], nameC);
|
|
202
|
+
return [pointA, pointB, pointC];
|
|
203
|
+
}
|
|
204
|
+
case "extérieure": {
|
|
205
|
+
const isLeftSide = coinFlip();
|
|
206
|
+
const c = isLeftSide ? a - randint(2, 8) : b + randint(2, 8);
|
|
207
|
+
const h = +randint(4, 12);
|
|
208
|
+
const pointC = PointConstructor.fromCoords([c, h], nameC);
|
|
209
|
+
return [pointA, pointB, pointC];
|
|
210
|
+
}
|
|
211
|
+
default:
|
|
212
|
+
throw new Error("Unsupported heightType: " + opts.heightType);
|
|
213
|
+
}
|
|
214
|
+
})();
|
|
215
|
+
const [pointA, pointB, pointC] = (() => {
|
|
216
|
+
const pointOrigin = new Point("O", 0, 0);
|
|
217
|
+
const angleInDegrees = randint(0, 360);
|
|
218
|
+
return [pointARaw, pointBRaw, pointCRaw].map((point) => rotatePoint(point, degreesToRadians(angleInDegrees, 5), pointOrigin, point.name));
|
|
219
|
+
})();
|
|
220
|
+
const triangle = new Triangle([pointC, pointB, pointA]);
|
|
221
|
+
const strNameTriangle = shuffle(triangle.name.split("")).join("");
|
|
222
|
+
const identifiers = {
|
|
223
|
+
triangleIds: triangle.toIdentifiers(),
|
|
224
|
+
strNameTriangle,
|
|
225
|
+
};
|
|
226
|
+
return getQuestionFromIdentifiers(identifiers);
|
|
227
|
+
};
|
|
228
|
+
const getQuestionFromIdentifiers = (identifiers, opts) => {
|
|
229
|
+
const question = {
|
|
230
|
+
ggbAnswer: getGGBAnswer(identifiers, opts),
|
|
231
|
+
instruction: getInstruction(identifiers, opts),
|
|
232
|
+
keys: [],
|
|
233
|
+
answerFormat: "tex",
|
|
234
|
+
identifiers,
|
|
235
|
+
studentGgbOptions: getStudentGGBOptions(identifiers, opts),
|
|
236
|
+
hint: getHint(identifiers, opts),
|
|
237
|
+
correction: getCorrection(identifiers, opts),
|
|
238
|
+
correctionGgbOptions: getCorrectionGGBOptions(identifiers, opts),
|
|
239
|
+
};
|
|
240
|
+
return question;
|
|
241
|
+
};
|
|
242
|
+
const arrayedOptsDefault = {
|
|
243
|
+
heightType: ["intérieure"],
|
|
244
|
+
};
|
|
245
|
+
const options = [
|
|
246
|
+
{
|
|
247
|
+
id: "heightType",
|
|
248
|
+
label: "Type de hauteur",
|
|
249
|
+
target: GeneratorOptionTarget.generation,
|
|
250
|
+
type: GeneratorOptionType.multiselect,
|
|
251
|
+
values: ["intérieure", "sur un cathète", "extérieure"],
|
|
252
|
+
defaultValue: arrayedOptsDefault.heightType,
|
|
253
|
+
},
|
|
254
|
+
];
|
|
255
|
+
export const traceHeightInTriangle = {
|
|
256
|
+
id: "traceHeightInTriangle",
|
|
257
|
+
connector: "=",
|
|
258
|
+
label: "Tracer une hauteur d'un triangle",
|
|
259
|
+
isSingleStep: true,
|
|
260
|
+
generator: (nb, opts) => getDistinctQuestions(() => getTraceHeightInTriangleQuestion(opts), nb),
|
|
261
|
+
options,
|
|
262
|
+
ggbTimer: 60,
|
|
263
|
+
isGGBAnswerValid,
|
|
264
|
+
subject: "Mathématiques",
|
|
265
|
+
answerType: "GGB",
|
|
266
|
+
getStudentGGBOptions,
|
|
267
|
+
getQuestionFromIdentifiers,
|
|
268
|
+
getHint,
|
|
269
|
+
getCorrection,
|
|
270
|
+
hasHintAndCorrection: true,
|
|
271
|
+
};
|
|
@@ -1,2 +1,10 @@
|
|
|
1
|
+
import { Exercise } from "../../../../exercises/exercise.js";
|
|
2
|
+
import { TriangleIdentifiers } from "../../../../math/geometry/triangles/triangle.js";
|
|
3
|
+
/************/
|
|
4
|
+
type Identifiers = {
|
|
5
|
+
triangleIds: TriangleIdentifiers;
|
|
6
|
+
strNameTriangle: string;
|
|
7
|
+
};
|
|
8
|
+
export declare const traceMedianInTriangle: Exercise<Identifiers>;
|
|
1
9
|
export {};
|
|
2
10
|
//# sourceMappingURL=traceMedianInTriangle.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"traceMedianInTriangle.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/triangles/traceMedianInTriangle.ts"],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"traceMedianInTriangle.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/triangles/traceMedianInTriangle.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAWT,MAAM,6BAA6B,CAAC;AAOrC,OAAO,EAGL,mBAAmB,EACpB,MAAM,2CAA2C,CAAC;AAuEnD,cAAc;AAEd,KAAK,WAAW,GAAG;IACjB,WAAW,EAAE,mBAAmB,CAAC;IACjC,eAAe,EAAE,MAAM,CAAC;CACzB,CAAC;AAqSF,eAAO,MAAM,qBAAqB,EAAE,QAAQ,CAAC,WAAW,CAgBvD,CAAC"}
|
|
@@ -1,53 +1,284 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
//
|
|
24
|
-
//
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
1
|
+
import { toolBarConstructor } from "../../../../exercises/utils/geogebra/toolBarConstructor.js";
|
|
2
|
+
import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions.js";
|
|
3
|
+
import { greenMain } from "../../../../geogebra/colors.js";
|
|
4
|
+
import { GeogebraConstructor } from "../../../../geogebra/geogebraConstructor.js";
|
|
5
|
+
import { GeogebraParser } from "../../../../geogebra/parsers/geogebraParser.js";
|
|
6
|
+
import { Point, PointConstructor } from "../../../../math/geometry/point.js";
|
|
7
|
+
import { Triangle, TriangleConstructor, } from "../../../../math/geometry/triangles/triangle.js";
|
|
8
|
+
import { Vector } from "../../../../math/geometry/vector.js";
|
|
9
|
+
import { randint } from "../../../../math/utils/random/randint.js";
|
|
10
|
+
import { round } from "../../../../math/utils/round.js";
|
|
11
|
+
import { PiNode } from "../../../../tree/nodes/numbers/piNode.js";
|
|
12
|
+
import { add } from "../../../../tree/nodes/operators/addNode.js";
|
|
13
|
+
import { multiply } from "../../../../tree/nodes/operators/multiplyNode.js";
|
|
14
|
+
import { substract } from "../../../../tree/nodes/operators/substractNode.js";
|
|
15
|
+
import { coinFlip } from "../../../../utils/alea/coinFlip.js";
|
|
16
|
+
import { shuffle } from "../../../../utils/alea/shuffle.js";
|
|
17
|
+
import { handleVEAError } from "../../../../utils/errors/handleVEAError.js";
|
|
18
|
+
const degreesToRadians = (angleInDegrees, precision) => {
|
|
19
|
+
const oneOver180 = 0.00555555555555555;
|
|
20
|
+
return round(multiply(multiply(angleInDegrees, PiNode), oneOver180).evaluate(), precision);
|
|
21
|
+
};
|
|
22
|
+
const rotateVector = (vec, angle, name) => {
|
|
23
|
+
//x' = cos(t)*x -sin(t)*y
|
|
24
|
+
//y' = sin(t)*x + cos(t)*y
|
|
25
|
+
const cos = Math.cos(angle);
|
|
26
|
+
const sin = Math.sin(angle);
|
|
27
|
+
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());
|
|
28
|
+
};
|
|
29
|
+
const rotatePoint = (target, angle, center, name, precision = 2) => {
|
|
30
|
+
const vSrc = createVector(center, target, "vSrc", precision);
|
|
31
|
+
const vRotated = rotateVector(vSrc, angle, "vRotated");
|
|
32
|
+
return createPoint(add(center.x, vRotated.x).evaluate(), add(center.y, vRotated.y).evaluate(), name, precision);
|
|
33
|
+
};
|
|
34
|
+
const createVector = (from, to, name, precision = 5) => {
|
|
35
|
+
return new Vector(name, round(substract(to.x, from.x).evaluate(), precision).toTree(), round(substract(to.y, from.y).evaluate(), precision).toTree());
|
|
36
|
+
};
|
|
37
|
+
const createPoint = (x, y, name, precision = 5) => {
|
|
38
|
+
return new Point(name, round(x, precision), round(y, precision));
|
|
39
|
+
};
|
|
40
|
+
const getHydrated = (identifiers) => {
|
|
41
|
+
const { triangleIds } = identifiers;
|
|
42
|
+
const triangle = TriangleConstructor.fromIdentifiers(triangleIds);
|
|
43
|
+
const [point] = triangle.points;
|
|
44
|
+
const [segment] = triangle.sides;
|
|
45
|
+
return {
|
|
46
|
+
triangle,
|
|
47
|
+
point,
|
|
48
|
+
segment,
|
|
49
|
+
};
|
|
50
|
+
};
|
|
51
|
+
const getInstruction = (identifiers) => {
|
|
52
|
+
const { strNameTriangle } = identifiers;
|
|
53
|
+
const { point } = getHydrated(identifiers);
|
|
54
|
+
return `Avec les outils disponibles, construire la médiane de $${strNameTriangle}$ issue de $${point.name}$.`;
|
|
55
|
+
};
|
|
56
|
+
const getGGBAnswer = (identifiers) => {
|
|
57
|
+
const { triangle, point, segment } = getHydrated(identifiers);
|
|
58
|
+
const ggbAnswer = [
|
|
59
|
+
...getStudentGGBCommands(triangle),
|
|
60
|
+
`M = Midpoint(${segment.pointA.name}, ${segment.pointB.name})`,
|
|
61
|
+
`lMed = Line(${point.name},M)`,
|
|
62
|
+
`SetColor(lMed, "${greenMain}")`,
|
|
63
|
+
];
|
|
64
|
+
return ggbAnswer;
|
|
65
|
+
};
|
|
66
|
+
const getHint = (identifiers) => {
|
|
67
|
+
const { point } = getHydrated(identifiers);
|
|
68
|
+
return `La médiane issue du point $${point.name}$ est la droite qui relie $${point.name}$ avec le milieu du côté opposé à $${point.name}$.`;
|
|
69
|
+
};
|
|
70
|
+
const getCorrection = (identifiers) => {
|
|
71
|
+
const { point, segment } = getHydrated(identifiers);
|
|
72
|
+
return `On sélectionne l'outil Milieu dans Geogebra puis on clique sur le segment $${segment.toTex()}$. On sélectionne ensuite l'outil Droite pour relier le milieu qui vient d'être créé avec le point $${point.name}$.`;
|
|
73
|
+
};
|
|
74
|
+
const getCorrectionGGBOptions = (identifiers) => {
|
|
75
|
+
const ggb = new GeogebraConstructor({
|
|
76
|
+
commands: [...getGGBAnswer(identifiers)],
|
|
77
|
+
hideGrid: true,
|
|
78
|
+
hideAxes: true,
|
|
79
|
+
isGridSimple: true,
|
|
80
|
+
fontSize: 16,
|
|
81
|
+
});
|
|
82
|
+
return ggb.getOptions({ coords: [-10, 10, -10, 10] });
|
|
83
|
+
};
|
|
84
|
+
const getStudentGGBCommands = (triangle) => {
|
|
85
|
+
const [point] = triangle.points;
|
|
86
|
+
const [segment] = triangle.sides;
|
|
87
|
+
return [
|
|
88
|
+
...triangle.points.flatMap((point) => point.toGGBCommand({
|
|
89
|
+
isFixed: true,
|
|
90
|
+
isSelectionnable: true,
|
|
91
|
+
showLabel: true,
|
|
92
|
+
})),
|
|
93
|
+
...triangle.sides.flatMap((segment) => segment.toGGBCommands(false, { isFixed: true, isSelectionnable: true })),
|
|
94
|
+
//force display of right angle (if needed)
|
|
95
|
+
...(() => {
|
|
96
|
+
const [angleRightAngle] = triangle.angles.filter((angle) => Math.abs(angle.evaluate(false) - 90) < 0.3);
|
|
97
|
+
if (angleRightAngle !== undefined) {
|
|
98
|
+
if (angleRightAngle.evaluate() === 90) {
|
|
99
|
+
//display is already ok
|
|
100
|
+
return [
|
|
101
|
+
...angleRightAngle.toCommands({
|
|
102
|
+
pointsAreNotBuilt: false,
|
|
103
|
+
showValue: false,
|
|
104
|
+
}),
|
|
105
|
+
];
|
|
106
|
+
}
|
|
107
|
+
else {
|
|
108
|
+
if (angleRightAngle !== undefined) {
|
|
109
|
+
const [pointRightAngle1, pointRightAngle2, pointRightAngle3] = angleRightAngle.points;
|
|
110
|
+
return [
|
|
111
|
+
`lPer = PerpendicularLine(${pointRightAngle2.name},${segment.ggbName})`,
|
|
112
|
+
`SetVisibleInView(lPer, 1, false)`,
|
|
113
|
+
`lPer2 = PerpendicularLine(${point.name},lPer)`,
|
|
114
|
+
`SetVisibleInView(lPer2, 1, false)`,
|
|
115
|
+
`prjct = Intersect(lPer, lPer2)`,
|
|
116
|
+
`SetVisibleInView(prjct, 1, false)`,
|
|
117
|
+
//horror?
|
|
118
|
+
`ang1 = Angle(${pointRightAngle1.name},${pointRightAngle2.name}, prjct)`,
|
|
119
|
+
`ShowLabel(ang1, false)`,
|
|
120
|
+
`ang2 = Angle(prjct,${pointRightAngle2.name},${pointRightAngle1.name})`,
|
|
121
|
+
`ShowLabel(ang2, false)`,
|
|
122
|
+
`SetVisibleInView(ang1, 1, ang1<ang2)`,
|
|
123
|
+
`SetVisibleInView(ang2, 1, ang2<ang1)`,
|
|
124
|
+
`ang3 = Angle(${pointRightAngle3.name},${pointRightAngle2.name}, prjct)`,
|
|
125
|
+
`ShowLabel(ang3, false)`,
|
|
126
|
+
`ang4 = Angle(prjct,${pointRightAngle2.name},${pointRightAngle3.name})`,
|
|
127
|
+
`ShowLabel(ang4, false)`,
|
|
128
|
+
`SetVisibleInView(ang3, 1, ang3<ang4)`,
|
|
129
|
+
`SetVisibleInView(ang4, 1, ang4<ang3)`,
|
|
130
|
+
];
|
|
131
|
+
}
|
|
132
|
+
else {
|
|
133
|
+
return [];
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
else {
|
|
138
|
+
return [];
|
|
139
|
+
}
|
|
140
|
+
})(),
|
|
141
|
+
];
|
|
142
|
+
};
|
|
143
|
+
const getStudentGGBOptions = (identifiers) => {
|
|
144
|
+
const { triangle } = getHydrated(identifiers);
|
|
145
|
+
const commands = getStudentGGBCommands(triangle);
|
|
146
|
+
const studentGGB = new GeogebraConstructor({
|
|
147
|
+
commands,
|
|
148
|
+
hideGrid: true,
|
|
149
|
+
hideAxes: true,
|
|
150
|
+
customToolBar: toolBarConstructor({
|
|
151
|
+
orthogonal: true,
|
|
152
|
+
midpoint: true,
|
|
153
|
+
join: true,
|
|
154
|
+
}),
|
|
155
|
+
});
|
|
156
|
+
return studentGGB.getOptions({
|
|
157
|
+
coords: studentGGB.getCoordsForPoints([...triangle.points]),
|
|
158
|
+
});
|
|
159
|
+
};
|
|
160
|
+
const isGGBAnswerValid = (ans, { ggbAnswer, ...identifiers }) => {
|
|
161
|
+
const { triangle, point, segment } = getHydrated(identifiers);
|
|
162
|
+
try {
|
|
163
|
+
const commands = ans;
|
|
164
|
+
const ggbParser = new GeogebraParser(commands);
|
|
165
|
+
const objectDict = ggbParser.objectDict();
|
|
166
|
+
const arrStrOrthogonalLine = Object.entries(objectDict)
|
|
167
|
+
.filter(([_, strObj]) => strObj.startsWith("OrthogonalLine"))
|
|
168
|
+
.map(([_, strObj]) => strObj);
|
|
169
|
+
//required: no orthogonal line
|
|
170
|
+
if (arrStrOrthogonalLine.length > 0) {
|
|
171
|
+
return false;
|
|
172
|
+
}
|
|
173
|
+
const arrStrLine = Object.entries(objectDict)
|
|
174
|
+
.filter(([_, strObj]) => strObj.startsWith("Line"))
|
|
175
|
+
.map(([_, strObj]) => strObj);
|
|
176
|
+
//required: only one line
|
|
177
|
+
if (arrStrLine.length !== 1) {
|
|
178
|
+
return false;
|
|
179
|
+
}
|
|
180
|
+
const [strLine] = arrStrLine;
|
|
181
|
+
const [namePoint1Ans, namePoint2Ans] = GeogebraParser.pointNamesForLineObj(strLine);
|
|
182
|
+
const [point1Ans, point2Ans] = [namePoint1Ans, namePoint2Ans].map((namePoint) => {
|
|
183
|
+
const pointCoords = ggbParser.pointCoords(namePoint);
|
|
184
|
+
if (pointCoords) {
|
|
185
|
+
const point = PointConstructor.fromCoords(pointCoords, namePoint);
|
|
186
|
+
return point;
|
|
187
|
+
}
|
|
188
|
+
else {
|
|
189
|
+
const [point] = triangle.points.filter((point) => point.name === namePoint);
|
|
190
|
+
return point;
|
|
191
|
+
}
|
|
192
|
+
});
|
|
193
|
+
const midPoint = segment.getMidpoint();
|
|
194
|
+
return [
|
|
195
|
+
[point1Ans, point2Ans],
|
|
196
|
+
[point2Ans, point1Ans],
|
|
197
|
+
].some(([point1Ans, point2Ans]) => {
|
|
198
|
+
const isPoint = () => point1Ans.distanceTo(point) < 0.1;
|
|
199
|
+
const isMidPoint = () => point2Ans.distanceTo(midPoint) < 0.1;
|
|
200
|
+
return isPoint() && isMidPoint();
|
|
201
|
+
});
|
|
202
|
+
}
|
|
203
|
+
catch (e) {
|
|
204
|
+
console.log(e);
|
|
205
|
+
handleVEAError(e);
|
|
206
|
+
return false;
|
|
207
|
+
}
|
|
208
|
+
};
|
|
209
|
+
const getTraceMedianInTriangleQuestion = () => {
|
|
210
|
+
const [nameA, nameB, nameC] = shuffle(["A", "B", "C"]);
|
|
211
|
+
const [pointARaw, pointBRaw, pointCRaw] = (() => {
|
|
212
|
+
const a = -randint(4, 12);
|
|
213
|
+
const b = +randint(4, 12);
|
|
214
|
+
const pointA = PointConstructor.fromCoords([a, 0], nameA);
|
|
215
|
+
const pointB = PointConstructor.fromCoords([b, 0], nameB);
|
|
216
|
+
const rand = randint(0, 3);
|
|
217
|
+
switch (rand) {
|
|
218
|
+
case 0: {
|
|
219
|
+
const c = randint(a + 1, b);
|
|
220
|
+
const h = +randint(4, 12);
|
|
221
|
+
const pointC = PointConstructor.fromCoords([c, h], nameC);
|
|
222
|
+
return [pointA, pointB, pointC];
|
|
223
|
+
}
|
|
224
|
+
case 1: {
|
|
225
|
+
const isLeftSide = coinFlip();
|
|
226
|
+
const c = isLeftSide ? a : b;
|
|
227
|
+
const h = +randint(4, 12);
|
|
228
|
+
const pointC = PointConstructor.fromCoords([c, h], nameC);
|
|
229
|
+
return [pointA, pointB, pointC];
|
|
230
|
+
}
|
|
231
|
+
case 2: {
|
|
232
|
+
const isLeftSide = coinFlip();
|
|
233
|
+
const c = isLeftSide ? a - randint(2, 8) : b + randint(2, 8);
|
|
234
|
+
const h = +randint(4, 12);
|
|
235
|
+
const pointC = PointConstructor.fromCoords([c, h], nameC);
|
|
236
|
+
return [pointA, pointB, pointC];
|
|
237
|
+
}
|
|
238
|
+
default:
|
|
239
|
+
throw new Error("Unsupported rand: " + rand);
|
|
240
|
+
}
|
|
241
|
+
})();
|
|
242
|
+
const [pointA, pointB, pointC] = (() => {
|
|
243
|
+
const pointOrigin = new Point("O", 0, 0);
|
|
244
|
+
const angleInDegrees = randint(0, 360);
|
|
245
|
+
return [pointARaw, pointBRaw, pointCRaw].map((point) => rotatePoint(point, degreesToRadians(angleInDegrees, 5), pointOrigin, point.name));
|
|
246
|
+
})();
|
|
247
|
+
const triangle = new Triangle([pointC, pointB, pointA]);
|
|
248
|
+
const strNameTriangle = shuffle(triangle.name.split("")).join("");
|
|
249
|
+
const identifiers = {
|
|
250
|
+
triangleIds: triangle.toIdentifiers(),
|
|
251
|
+
strNameTriangle,
|
|
252
|
+
};
|
|
253
|
+
return getQuestionFromIdentifiers(identifiers);
|
|
254
|
+
};
|
|
255
|
+
const getQuestionFromIdentifiers = (identifiers, opts) => {
|
|
256
|
+
const question = {
|
|
257
|
+
ggbAnswer: getGGBAnswer(identifiers, opts),
|
|
258
|
+
instruction: getInstruction(identifiers, opts),
|
|
259
|
+
keys: [],
|
|
260
|
+
answerFormat: "tex",
|
|
261
|
+
identifiers,
|
|
262
|
+
studentGgbOptions: getStudentGGBOptions(identifiers, opts),
|
|
263
|
+
hint: getHint(identifiers, opts),
|
|
264
|
+
correction: getCorrection(identifiers, opts),
|
|
265
|
+
correctionGgbOptions: getCorrectionGGBOptions(identifiers, opts),
|
|
266
|
+
};
|
|
267
|
+
return question;
|
|
268
|
+
};
|
|
269
|
+
export const traceMedianInTriangle = {
|
|
270
|
+
id: "traceMedianInTriangle",
|
|
271
|
+
connector: "=",
|
|
272
|
+
label: "Tracer une médiane d'un triangle",
|
|
273
|
+
isSingleStep: true,
|
|
274
|
+
generator: (nb) => getDistinctQuestions(getTraceMedianInTriangleQuestion, nb),
|
|
275
|
+
ggbTimer: 60,
|
|
276
|
+
isGGBAnswerValid,
|
|
277
|
+
subject: "Mathématiques",
|
|
278
|
+
answerType: "GGB",
|
|
279
|
+
getStudentGGBOptions,
|
|
280
|
+
getQuestionFromIdentifiers,
|
|
281
|
+
getHint,
|
|
282
|
+
getCorrection,
|
|
283
|
+
hasHintAndCorrection: true,
|
|
284
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/exercises/math/geometry/vectors/constructions/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,0BAA0B,CAAC;AACzC,cAAc,0BAA0B,CAAC;AACzC,cAAc,uBAAuB,CAAC;AACtC,cAAc,mCAAmC,CAAC;AAClD,cAAc,uCAAuC,CAAC;AACtD,cAAc,oBAAoB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/exercises/math/geometry/vectors/constructions/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,0BAA0B,CAAC;AACzC,cAAc,0BAA0B,CAAC;AACzC,cAAc,uBAAuB,CAAC;AACtC,cAAc,mCAAmC,CAAC;AAClD,cAAc,uCAAuC,CAAC;AACtD,cAAc,oBAAoB,CAAC;AACnC,cAAc,6BAA6B,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Exercise } from "../../../../../exercises/exercise.js";
|
|
2
|
+
import { PointIdentifiers } from "../../../../../math/geometry/point.js";
|
|
3
|
+
type Identifiers = {
|
|
4
|
+
pointIds: PointIdentifiers[];
|
|
5
|
+
};
|
|
6
|
+
export declare const traceVectorSumFromVecs: Exercise<Identifiers>;
|
|
7
|
+
export {};
|
|
8
|
+
//# sourceMappingURL=traceVectorSumFromVecs.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"traceVectorSumFromVecs.d.ts","sourceRoot":"","sources":["../../../../../../src/exercises/math/geometry/vectors/constructions/traceVectorSumFromVecs.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAWT,MAAM,6BAA6B,CAAC;AAMrC,OAAO,EAGL,gBAAgB,EACjB,MAAM,8BAA8B,CAAC;AAGtC,KAAK,WAAW,GAAG;IACjB,QAAQ,EAAE,gBAAgB,EAAE,CAAC;CAC9B,CAAC;AAqMF,eAAO,MAAM,sBAAsB,EAAE,QAAQ,CAAC,WAAW,CAiBxD,CAAC"}
|