math-exercises 3.0.158 → 3.0.160
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/calculLitteral/equation/exp/expOfFEqualsExpOfGEquation.js +7 -6
- package/lib/exercises/math/calculLitteral/equation/exp/expOfTrinomEquals1Equation.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/equation/exp/expOfTrinomEquals1Equation.js +88 -9
- package/lib/exercises/math/calculLitteral/equation/factorizeEquation.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/equation/factorizeEquation.js +8 -2
- package/lib/exercises/math/calculLitteral/equation/index.d.ts +1 -0
- package/lib/exercises/math/calculLitteral/equation/index.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/equation/index.js +1 -0
- package/lib/exercises/math/calculLitteral/equation/multiplicationEquation.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/equation/multiplicationEquation.js +27 -2
- package/lib/exercises/math/calculLitteral/equation/solveByFactorizingWithIdRmq3.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/equation/solveByFactorizingWithIdRmq3.js +1 -3
- package/lib/exercises/math/calculLitteral/equation/square/equationSquareWithSteps.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/equation/square/equationSquareWithSteps.js +0 -1
- package/lib/exercises/math/calculLitteral/inequations/exp/expOfFEqualsExpOfGInequation.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/inequations/exp/expOfFEqualsExpOfGInequation.js +11 -4
- package/lib/exercises/math/calculLitteral/inequations/firstDegreeInequationsType3.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/inequations/firstDegreeInequationsType3.js +11 -5
- package/lib/exercises/math/calculLitteral/inequations/index.d.ts +1 -0
- package/lib/exercises/math/calculLitteral/inequations/index.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/inequations/index.js +1 -0
- package/lib/exercises/math/derivation/derivative/exp/expDerivativeFour.d.ts.map +1 -1
- package/lib/exercises/math/derivation/derivative/exp/expDerivativeFour.js +91 -21
- package/lib/exercises/math/derivation/derivative/exp/expDerivativeOne.d.ts.map +1 -1
- package/lib/exercises/math/derivation/derivative/exp/expDerivativeOne.js +63 -43
- package/lib/exercises/math/derivation/derivative/exp/expDerivativeThree.d.ts.map +1 -1
- package/lib/exercises/math/derivation/derivative/exp/expDerivativeThree.js +72 -49
- package/lib/exercises/math/derivation/derivative/exp/expDerivativeTwo.d.ts.map +1 -1
- package/lib/exercises/math/derivation/derivative/exp/expDerivativeTwo.js +19 -19
- package/lib/exercises/math/derivation/derivative/exp/expOverExpDerivative.d.ts.map +1 -1
- package/lib/exercises/math/derivation/derivative/exp/expOverExpDerivative.js +26 -14
- package/lib/exercises/math/derivation/derivative/exp/index.d.ts +1 -0
- package/lib/exercises/math/derivation/derivative/exp/index.d.ts.map +1 -1
- package/lib/exercises/math/derivation/derivative/exp/index.js +1 -0
- package/lib/exercises/math/derivation/variations/index.d.ts +1 -0
- package/lib/exercises/math/derivation/variations/index.d.ts.map +1 -1
- package/lib/exercises/math/derivation/variations/index.js +1 -0
- package/lib/exercises/math/derivation/variations/readExtremaAbscissFromDerivativeCurve.d.ts +7 -0
- package/lib/exercises/math/derivation/variations/readExtremaAbscissFromDerivativeCurve.d.ts.map +1 -0
- package/lib/exercises/math/derivation/variations/readExtremaAbscissFromDerivativeCurve.js +174 -0
- package/lib/exercises/math/functions/exponential/algebraic/approxExpAPlusB.d.ts.map +1 -1
- package/lib/exercises/math/functions/exponential/algebraic/approxExpAPlusB.js +30 -3
- package/lib/exercises/math/functions/exponential/algebraic/approxExpKa.d.ts.map +1 -1
- package/lib/exercises/math/functions/exponential/algebraic/approxExpKa.js +12 -7
- package/lib/exercises/math/functions/exponential/algebraic/approxExpN.js +1 -1
- package/lib/exercises/math/functions/exponential/algebraic/rewriteExpUsingExpA.js +2 -2
- package/lib/exercises/math/functions/exponential/definition/approxExpAPlusH.d.ts.map +1 -1
- package/lib/exercises/math/functions/exponential/definition/approxExpAPlusH.js +33 -44
- package/lib/exercises/math/functions/exponential/definition/expAntecedentFromGraph.d.ts.map +1 -1
- package/lib/exercises/math/functions/exponential/definition/expAntecedentFromGraph.js +80 -8
- package/lib/exercises/math/functions/exponential/definition/expImageFromGraph.d.ts.map +1 -1
- package/lib/exercises/math/functions/exponential/definition/expImageFromGraph.js +80 -25
- package/lib/exercises/math/functions/exponential/definition/isPlausibleExpFromGraph.d.ts.map +1 -1
- package/lib/exercises/math/functions/exponential/definition/isPlausibleExpFromGraph.js +6 -15
- package/lib/exercises/math/functions/exponential/expFactorization.d.ts.map +1 -1
- package/lib/exercises/math/functions/exponential/expFactorization.js +54 -42
- package/lib/exercises/math/functions/exponential/index.d.ts +2 -0
- package/lib/exercises/math/functions/exponential/index.d.ts.map +1 -1
- package/lib/exercises/math/functions/exponential/index.js +2 -0
- package/lib/exercises/math/functions/trinoms/equation/secondDegreeInequation.js +3 -0
- package/lib/exercises/math/functions/trinoms/factoForm/index.d.ts +1 -0
- package/lib/exercises/math/functions/trinoms/factoForm/index.d.ts.map +1 -1
- package/lib/exercises/math/functions/trinoms/factoForm/index.js +1 -0
- package/lib/exercises/math/functions/trinoms/factoForm/trinomDevelopFactorizedForm.d.ts +13 -0
- package/lib/exercises/math/functions/trinoms/factoForm/trinomDevelopFactorizedForm.d.ts.map +1 -0
- package/lib/exercises/math/functions/trinoms/factoForm/trinomDevelopFactorizedForm.js +147 -0
- package/lib/exercises/math/functions/trinoms/roots/niceRootsFromDevForm.d.ts.map +1 -1
- package/lib/exercises/math/functions/trinoms/roots/niceRootsFromDevForm.js +96 -0
- package/lib/exercises/math/functions/trinoms/roots/rootsFromDevForm.d.ts.map +1 -1
- package/lib/exercises/math/functions/trinoms/roots/rootsFromDevForm.js +95 -1
- package/lib/exercises/math/functions/trinoms/summitAndCanonical/devFormFromSummitAndPoint.d.ts +9 -0
- package/lib/exercises/math/functions/trinoms/summitAndCanonical/devFormFromSummitAndPoint.d.ts.map +1 -0
- package/lib/exercises/math/functions/trinoms/summitAndCanonical/devFormFromSummitAndPoint.js +173 -0
- package/lib/exercises/math/functions/trinoms/summitAndCanonical/index.d.ts +2 -0
- package/lib/exercises/math/functions/trinoms/summitAndCanonical/index.d.ts.map +1 -1
- package/lib/exercises/math/functions/trinoms/summitAndCanonical/index.js +2 -0
- package/lib/exercises/math/functions/trinoms/summitAndCanonical/summitAbscissFromRoots.js +1 -1
- package/lib/exercises/math/functions/trinoms/summitAndCanonical/summitAbscissFromSymetricPoints.d.ts +9 -0
- package/lib/exercises/math/functions/trinoms/summitAndCanonical/summitAbscissFromSymetricPoints.d.ts.map +1 -0
- package/lib/exercises/math/functions/trinoms/summitAndCanonical/summitAbscissFromSymetricPoints.js +97 -0
- package/lib/exercises/math/functions/variations/exp/varOfAEXPlusB.d.ts.map +1 -1
- package/lib/exercises/math/functions/variations/exp/varOfAEXPlusB.js +18 -23
- package/lib/exercises/math/functions/variations/exp/varOfAEXPlusBOverCEXPlusD.d.ts.map +1 -1
- package/lib/exercises/math/functions/variations/exp/varOfAEXPlusBOverCEXPlusD.js +24 -26
- package/lib/exercises/math/functions/variations/index.d.ts +1 -0
- package/lib/exercises/math/functions/variations/index.d.ts.map +1 -1
- package/lib/exercises/math/functions/variations/index.js +1 -0
- package/lib/exercises/math/geometry/cartesian/cartesianEquationOfLineFromPerpendicularLine.d.ts +12 -0
- package/lib/exercises/math/geometry/cartesian/cartesianEquationOfLineFromPerpendicularLine.d.ts.map +1 -0
- package/lib/exercises/math/geometry/cartesian/cartesianEquationOfLineFromPerpendicularLine.js +230 -0
- package/lib/exercises/math/geometry/cartesian/cartesianEquationOfLineFromPointAndNormalVector.d.ts +10 -0
- package/lib/exercises/math/geometry/cartesian/cartesianEquationOfLineFromPointAndNormalVector.d.ts.map +1 -0
- package/lib/exercises/math/geometry/cartesian/cartesianEquationOfLineFromPointAndNormalVector.js +167 -0
- package/lib/exercises/math/geometry/cartesian/index.d.ts +3 -0
- package/lib/exercises/math/geometry/cartesian/index.d.ts.map +1 -1
- package/lib/exercises/math/geometry/cartesian/index.js +3 -0
- package/lib/exercises/math/geometry/cartesian/normalVectorFromCartesianLineEquation.d.ts +10 -0
- package/lib/exercises/math/geometry/cartesian/normalVectorFromCartesianLineEquation.d.ts.map +1 -0
- package/lib/exercises/math/geometry/cartesian/normalVectorFromCartesianLineEquation.js +131 -0
- package/lib/exercises/math/geometry/circles/circleCanonicalEquationFromDevEquation.d.ts +10 -0
- package/lib/exercises/math/geometry/circles/circleCanonicalEquationFromDevEquation.d.ts.map +1 -0
- package/lib/exercises/math/geometry/circles/circleCanonicalEquationFromDevEquation.js +174 -0
- package/lib/exercises/math/geometry/circles/circleCenterAndRadiusFromEquation.d.ts +12 -0
- package/lib/exercises/math/geometry/circles/circleCenterAndRadiusFromEquation.d.ts.map +1 -0
- package/lib/exercises/math/geometry/circles/circleCenterAndRadiusFromEquation.js +161 -0
- package/lib/exercises/math/geometry/circles/circleEquationFromDiameter.d.ts +9 -0
- package/lib/exercises/math/geometry/circles/circleEquationFromDiameter.d.ts.map +1 -0
- package/lib/exercises/math/geometry/circles/circleEquationFromDiameter.js +145 -0
- package/lib/exercises/math/geometry/circles/circleEquationFromPointAndRadius.d.ts +13 -0
- package/lib/exercises/math/geometry/circles/circleEquationFromPointAndRadius.d.ts.map +1 -0
- package/lib/exercises/math/geometry/circles/circleEquationFromPointAndRadius.js +181 -0
- package/lib/exercises/math/geometry/circles/circleRadiusOrCenterFromDevEquation.d.ts +11 -0
- package/lib/exercises/math/geometry/circles/circleRadiusOrCenterFromDevEquation.d.ts.map +1 -0
- package/lib/exercises/math/geometry/circles/circleRadiusOrCenterFromDevEquation.js +191 -0
- package/lib/exercises/math/geometry/circles/index.d.ts +7 -0
- package/lib/exercises/math/geometry/circles/index.d.ts.map +1 -0
- package/lib/exercises/math/geometry/circles/index.js +6 -0
- package/lib/exercises/math/geometry/circles/isPointOnCircleFromCartesianEquation.d.ts +11 -0
- package/lib/exercises/math/geometry/circles/isPointOnCircleFromCartesianEquation.d.ts.map +1 -0
- package/lib/exercises/math/geometry/circles/isPointOnCircleFromCartesianEquation.js +131 -0
- package/lib/exercises/math/geometry/euclidian/pinSegmentFromRotation.d.ts.map +1 -1
- package/lib/exercises/math/geometry/euclidian/pinSegmentFromRotation.js +0 -2
- package/lib/exercises/math/geometry/index.d.ts +1 -0
- package/lib/exercises/math/geometry/index.d.ts.map +1 -1
- package/lib/exercises/math/geometry/index.js +1 -0
- package/lib/exercises/math/geometry/lines/cartesianEquationOfTriangleHeight.d.ts +10 -0
- package/lib/exercises/math/geometry/lines/cartesianEquationOfTriangleHeight.d.ts.map +1 -0
- package/lib/exercises/math/geometry/lines/cartesianEquationOfTriangleHeight.js +181 -0
- package/lib/exercises/math/geometry/lines/cartesianEquationToReduced.d.ts +4 -1
- package/lib/exercises/math/geometry/lines/cartesianEquationToReduced.d.ts.map +1 -1
- package/lib/exercises/math/geometry/lines/cartesianEquationToReduced.js +23 -3
- package/lib/exercises/math/geometry/lines/index.d.ts +1 -0
- package/lib/exercises/math/geometry/lines/index.d.ts.map +1 -1
- package/lib/exercises/math/geometry/lines/index.js +1 -0
- package/lib/exercises/math/geometry/vectors/scalarProduct/alKashi/index.d.ts +4 -0
- package/lib/exercises/math/geometry/vectors/scalarProduct/alKashi/index.d.ts.map +1 -0
- package/lib/exercises/math/geometry/vectors/scalarProduct/alKashi/index.js +3 -0
- package/lib/exercises/math/geometry/vectors/scalarProduct/alKashi/scalarProductAlKashiAngle.d.ts +9 -0
- package/lib/exercises/math/geometry/vectors/scalarProduct/alKashi/scalarProductAlKashiAngle.d.ts.map +1 -0
- package/lib/exercises/math/geometry/vectors/scalarProduct/alKashi/scalarProductAlKashiAngle.js +247 -0
- package/lib/exercises/math/geometry/vectors/scalarProduct/alKashi/scalarProductAlKashiBH.d.ts +13 -0
- package/lib/exercises/math/geometry/vectors/scalarProduct/alKashi/scalarProductAlKashiBH.d.ts.map +1 -0
- package/lib/exercises/math/geometry/vectors/scalarProduct/alKashi/scalarProductAlKashiBH.js +452 -0
- package/lib/exercises/math/geometry/vectors/scalarProduct/alKashi/scalarProductAlKashiSideLength.d.ts +9 -0
- package/lib/exercises/math/geometry/vectors/scalarProduct/alKashi/scalarProductAlKashiSideLength.d.ts.map +1 -0
- package/lib/exercises/math/geometry/vectors/scalarProduct/alKashi/scalarProductAlKashiSideLength.js +253 -0
- package/lib/exercises/math/geometry/vectors/scalarProduct/alg/index.d.ts +4 -0
- package/lib/exercises/math/geometry/vectors/scalarProduct/alg/index.d.ts.map +1 -0
- package/lib/exercises/math/geometry/vectors/scalarProduct/alg/index.js +3 -0
- package/lib/exercises/math/geometry/vectors/scalarProduct/alg/scalarProductIdentities.d.ts +10 -0
- package/lib/exercises/math/geometry/vectors/scalarProduct/alg/scalarProductIdentities.d.ts.map +1 -0
- package/lib/exercises/math/geometry/vectors/scalarProduct/alg/scalarProductIdentities.js +174 -0
- package/lib/exercises/math/geometry/vectors/scalarProduct/alg/scalarProductInOrthonormalBasisIJ.d.ts +9 -0
- package/lib/exercises/math/geometry/vectors/scalarProduct/alg/scalarProductInOrthonormalBasisIJ.d.ts.map +1 -0
- package/lib/exercises/math/geometry/vectors/scalarProduct/alg/scalarProductInOrthonormalBasisIJ.js +231 -0
- package/lib/exercises/math/geometry/vectors/scalarProduct/alg/scalarProductLamdbaULambdaV.d.ts +14 -0
- package/lib/exercises/math/geometry/vectors/scalarProduct/alg/scalarProductLamdbaULambdaV.d.ts.map +1 -0
- package/lib/exercises/math/geometry/vectors/scalarProduct/alg/scalarProductLamdbaULambdaV.js +292 -0
- package/lib/exercises/math/geometry/vectors/scalarProduct/orth/index.d.ts +6 -0
- package/lib/exercises/math/geometry/vectors/scalarProduct/orth/index.d.ts.map +1 -0
- package/lib/exercises/math/geometry/vectors/scalarProduct/orth/index.js +5 -0
- package/lib/exercises/math/geometry/vectors/scalarProduct/orth/scalarProductIsOrthogonalVecsBasisIJ.d.ts +9 -0
- package/lib/exercises/math/geometry/vectors/scalarProduct/orth/scalarProductIsOrthogonalVecsBasisIJ.d.ts.map +1 -0
- package/lib/exercises/math/geometry/vectors/scalarProduct/orth/scalarProductIsOrthogonalVecsBasisIJ.js +202 -0
- package/lib/exercises/math/geometry/vectors/scalarProduct/orth/scalarProductIsOrthogonalVecsUsingCoords.d.ts +9 -0
- package/lib/exercises/math/geometry/vectors/scalarProduct/orth/scalarProductIsOrthogonalVecsUsingCoords.d.ts.map +1 -0
- package/lib/exercises/math/geometry/vectors/scalarProduct/orth/scalarProductIsOrthogonalVecsUsingCoords.js +127 -0
- package/lib/exercises/math/geometry/vectors/scalarProduct/orth/scalarProductIsPointOnCircle.d.ts +12 -0
- package/lib/exercises/math/geometry/vectors/scalarProduct/orth/scalarProductIsPointOnCircle.d.ts.map +1 -0
- package/lib/exercises/math/geometry/vectors/scalarProduct/orth/scalarProductIsPointOnCircle.js +167 -0
- package/lib/exercises/math/geometry/vectors/scalarProduct/orth/scalarProductIsPointOnPerpendicularBisector.d.ts +12 -0
- package/lib/exercises/math/geometry/vectors/scalarProduct/orth/scalarProductIsPointOnPerpendicularBisector.d.ts.map +1 -0
- package/lib/exercises/math/geometry/vectors/scalarProduct/orth/scalarProductIsPointOnPerpendicularBisector.js +180 -0
- package/lib/exercises/math/geometry/vectors/scalarProduct/orth/scalarProductIsRightTriangleUsingPointCoords.d.ts +12 -0
- package/lib/exercises/math/geometry/vectors/scalarProduct/orth/scalarProductIsRightTriangleUsingPointCoords.d.ts.map +1 -0
- package/lib/exercises/math/geometry/vectors/scalarProduct/orth/scalarProductIsRightTriangleUsingPointCoords.js +235 -0
- package/lib/exercises/math/geometry/vectors/scalarProduct/scalarProductComputeBH.d.ts +12 -0
- package/lib/exercises/math/geometry/vectors/scalarProduct/scalarProductComputeBH.d.ts.map +1 -0
- package/lib/exercises/math/geometry/vectors/scalarProduct/scalarProductComputeBH.js +423 -0
- package/lib/exercises/math/geometry/vectors/scalarProduct/scalarProductOfVectsOnGrid1.d.ts +17 -0
- package/lib/exercises/math/geometry/vectors/scalarProduct/scalarProductOfVectsOnGrid1.d.ts.map +1 -0
- package/lib/exercises/math/geometry/vectors/scalarProduct/scalarProductOfVectsOnGrid1.js +347 -0
- package/lib/exercises/math/geometry/vectors/scalarProduct/scalarProductParallelogramDiagonalPlus.d.ts +8 -0
- package/lib/exercises/math/geometry/vectors/scalarProduct/scalarProductParallelogramDiagonalPlus.d.ts.map +1 -0
- package/lib/exercises/math/geometry/vectors/scalarProduct/scalarProductParallelogramDiagonalPlus.js +301 -0
- package/lib/exercises/math/probaStat/randomVariable/findValueForFairRandomVariable.d.ts +9 -0
- package/lib/exercises/math/probaStat/randomVariable/findValueForFairRandomVariable.d.ts.map +1 -0
- package/lib/exercises/math/probaStat/randomVariable/findValueForFairRandomVariable.js +141 -0
- package/lib/exercises/math/probaStat/randomVariable/findValueToMatchRandomVariableAverage.d.ts +10 -0
- package/lib/exercises/math/probaStat/randomVariable/findValueToMatchRandomVariableAverage.d.ts.map +1 -0
- package/lib/exercises/math/probaStat/randomVariable/findValueToMatchRandomVariableAverage.js +174 -0
- package/lib/exercises/math/probaStat/randomVariable/index.d.ts +1 -0
- package/lib/exercises/math/probaStat/randomVariable/index.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/randomVariable/index.js +2 -0
- package/lib/exercises/math/sequences/generation/index.d.ts +2 -0
- package/lib/exercises/math/sequences/generation/index.d.ts.map +1 -0
- package/lib/exercises/math/sequences/generation/index.js +1 -0
- package/lib/exercises/math/sequences/generation/recognizeRecurrenceOrExplicit.d.ts +8 -0
- package/lib/exercises/math/sequences/generation/recognizeRecurrenceOrExplicit.d.ts.map +1 -0
- package/lib/exercises/math/sequences/generation/recognizeRecurrenceOrExplicit.js +63 -0
- package/lib/exercises/math/sequences/graph/index.d.ts +2 -0
- package/lib/exercises/math/sequences/graph/index.d.ts.map +1 -0
- package/lib/exercises/math/sequences/graph/index.js +1 -0
- package/lib/exercises/math/sequences/graph/placeFirstSequencePoints.d.ts +11 -0
- package/lib/exercises/math/sequences/graph/placeFirstSequencePoints.d.ts.map +1 -0
- package/lib/exercises/math/sequences/graph/placeFirstSequencePoints.js +113 -0
- package/lib/exercises/math/sequences/index.d.ts +2 -0
- package/lib/exercises/math/sequences/index.d.ts.map +1 -1
- package/lib/exercises/math/sequences/index.js +2 -0
- package/lib/exercises/math/sequences/notation/identifyRankInSequenceTermsList.d.ts +12 -0
- package/lib/exercises/math/sequences/notation/identifyRankInSequenceTermsList.d.ts.map +1 -0
- package/lib/exercises/math/sequences/notation/identifyRankInSequenceTermsList.js +114 -0
- package/lib/exercises/math/sequences/notation/identifySequenceTermInList.d.ts +12 -0
- package/lib/exercises/math/sequences/notation/identifySequenceTermInList.d.ts.map +1 -0
- package/lib/exercises/math/sequences/notation/identifySequenceTermInList.js +111 -0
- package/lib/exercises/math/sequences/notation/index.d.ts +3 -0
- package/lib/exercises/math/sequences/notation/index.d.ts.map +1 -0
- package/lib/exercises/math/sequences/notation/index.js +2 -0
- package/lib/exercises/math/spaceGeometry/basis/findSpacePointOnRectangularPrism.d.ts.map +1 -1
- package/lib/exercises/math/spaceGeometry/basis/findSpacePointOnRectangularPrism.js +0 -1
- package/lib/exercises/math/spaceGeometry/sphere/sphereLatLonReading.2d.d.ts.map +1 -1
- package/lib/exercises/math/spaceGeometry/sphere/sphereLatLonReading.2d.js +0 -2
- package/lib/exercises/vea/cartesianLineVEA.d.ts +2 -0
- package/lib/exercises/vea/cartesianLineVEA.d.ts.map +1 -0
- package/lib/exercises/vea/cartesianLineVEA.js +1 -0
- package/lib/exercises/vea/pointVEA.d.ts +2 -0
- package/lib/exercises/vea/pointVEA.d.ts.map +1 -0
- package/lib/exercises/vea/pointVEA.js +7 -0
- package/lib/index.d.ts +164 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/math/geometry/circle.d.ts +6 -0
- package/lib/math/geometry/circle.d.ts.map +1 -1
- package/lib/math/geometry/circle.js +16 -0
- package/lib/math/geometry/line.d.ts +2 -0
- package/lib/math/geometry/line.d.ts.map +1 -1
- package/lib/math/geometry/line.js +7 -0
- package/lib/math/geometry/point.d.ts +1 -0
- package/lib/math/geometry/point.d.ts.map +1 -1
- package/lib/math/geometry/point.js +5 -0
- package/lib/math/geometry/polygons/relationPP.d.ts +8 -0
- package/lib/math/geometry/polygons/relationPP.d.ts.map +1 -0
- package/lib/math/geometry/polygons/relationPP.js +41 -0
- package/lib/math/polynomials/trinom.d.ts +1 -1
- package/lib/math/polynomials/trinom.d.ts.map +1 -1
- package/lib/math/polynomials/trinom.js +15 -6
- package/lib/math/utils/arithmetic/primeFactors.js +1 -1
- package/lib/math/utils/geometry/randomVecs2.d.ts +6 -0
- package/lib/math/utils/geometry/randomVecs2.d.ts.map +1 -0
- package/lib/math/utils/geometry/randomVecs2.js +34 -0
- package/lib/tests/questionTest.d.ts.map +1 -1
- package/lib/tests/questionTest.js +2 -2
- package/lib/tree/nodes/equations/equationSolutionNode.d.ts +1 -0
- package/lib/tree/nodes/equations/equationSolutionNode.d.ts.map +1 -1
- package/lib/tree/nodes/equations/equationSolutionNode.js +3 -0
- package/lib/tree/nodes/functions/expNode.d.ts +1 -1
- package/lib/tree/nodes/functions/expNode.d.ts.map +1 -1
- package/lib/tree/nodes/inequations/inequationSolutionNode.d.ts +1 -0
- package/lib/tree/nodes/inequations/inequationSolutionNode.d.ts.map +1 -1
- package/lib/tree/nodes/inequations/inequationSolutionNode.js +3 -0
- package/lib/tree/nodes/operators/fractionNode.d.ts +1 -1
- package/lib/tree/nodes/operators/fractionNode.d.ts.map +1 -1
- package/lib/tree/nodes/operators/fractionNode.js +6 -4
- package/lib/tree/nodes/sets/intervalNode.d.ts +6 -0
- package/lib/tree/nodes/sets/intervalNode.d.ts.map +1 -1
- package/lib/tree/nodes/sets/namedIntervalNode.d.ts +31 -0
- package/lib/tree/nodes/sets/namedIntervalNode.d.ts.map +1 -0
- package/lib/tree/nodes/sets/namedIntervalNode.js +77 -0
- package/package.json +1 -1
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
import { addValidProp, shuffleProps, propWhile, tryToAddWrongProp, } from "../../../../exercises/exercise.js";
|
|
2
|
+
import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions.js";
|
|
3
|
+
import { Line } from "../../../../math/geometry/line.js";
|
|
4
|
+
import { PointConstructor, } from "../../../../math/geometry/point.js";
|
|
5
|
+
import { Vector, VectorConstructor } from "../../../../math/geometry/vector.js";
|
|
6
|
+
import { equal } from "../../../../tree/nodes/equations/equalNode.js";
|
|
7
|
+
import { opposite } from "../../../../tree/nodes/functions/oppositeNode.js";
|
|
8
|
+
import { add } from "../../../../tree/nodes/operators/addNode.js";
|
|
9
|
+
import { multiply } from "../../../../tree/nodes/operators/multiplyNode.js";
|
|
10
|
+
import { substract } from "../../../../tree/nodes/operators/substractNode.js";
|
|
11
|
+
import { parseAlgebraic } from "../../../../tree/parsers/latexParser.js";
|
|
12
|
+
import { doWhile } from "../../../../utils/doWhile.js";
|
|
13
|
+
import { handleVEAError } from "../../../../utils/errors/handleVEAError.js";
|
|
14
|
+
import { alignTex } from "../../../../utils/latex/alignTex.js";
|
|
15
|
+
const getPropositions = (n, { answer }) => {
|
|
16
|
+
const propositions = [];
|
|
17
|
+
addValidProp(propositions, answer);
|
|
18
|
+
propWhile(propositions, n, () => {
|
|
19
|
+
const fakeA = PointConstructor.random("A");
|
|
20
|
+
const fakeB = PointConstructor.random("B");
|
|
21
|
+
const fakeC = PointConstructor.random("C");
|
|
22
|
+
tryToAddWrongProp(propositions, getAnswer({
|
|
23
|
+
AIds: fakeA.toIdentifiers(),
|
|
24
|
+
BIds: fakeB.toIdentifiers(),
|
|
25
|
+
CIds: fakeC.toIdentifiers(),
|
|
26
|
+
}));
|
|
27
|
+
});
|
|
28
|
+
return shuffleProps(propositions, n);
|
|
29
|
+
};
|
|
30
|
+
const getAnswer = (identifiers) => {
|
|
31
|
+
const { AIds, BIds, CIds } = identifiers;
|
|
32
|
+
const A = PointConstructor.fromIdentifiers(AIds);
|
|
33
|
+
const B = PointConstructor.fromIdentifiers(BIds);
|
|
34
|
+
const C = PointConstructor.fromIdentifiers(CIds);
|
|
35
|
+
const vector = VectorConstructor.fromPoints(B, C);
|
|
36
|
+
const c = opposite(add(multiply(vector.x, A.x), multiply(vector.y, A.y))).simplify();
|
|
37
|
+
return equal(add(add(multiply(vector.x, "x"), multiply(vector.y, "y")), c).simplify({
|
|
38
|
+
towardsDistribute: true,
|
|
39
|
+
forbidFactorize: true,
|
|
40
|
+
}), 0).toTex();
|
|
41
|
+
};
|
|
42
|
+
const getInstruction = (identifiers) => {
|
|
43
|
+
const { AIds, BIds, CIds } = identifiers;
|
|
44
|
+
const A = PointConstructor.fromIdentifiers(AIds);
|
|
45
|
+
const B = PointConstructor.fromIdentifiers(BIds);
|
|
46
|
+
const C = PointConstructor.fromIdentifiers(CIds);
|
|
47
|
+
return `Dans un repère orthonormé, on considère un triangle $ABC$ avec $${A.toTexWithCoords()}$, $${B.toTexWithCoords()}$ et $${C.toTexWithCoords()}$.
|
|
48
|
+
|
|
49
|
+
Donner une équation cartésienne de la hauteur issue de $A$.`;
|
|
50
|
+
};
|
|
51
|
+
const getHint = () => {
|
|
52
|
+
return `Dans un triangle $ABC$, la hauteur issue de $A$ est perpendiculaire à la droite $(BC)$.
|
|
53
|
+
|
|
54
|
+
Alors, tout vecteur directeur de $(BC)$ est un vecteur normal à cette hauteur.
|
|
55
|
+
|
|
56
|
+
Utilise alors ce vecteur normal et les coordonnées du point $A$ pour trouver une équation cartésienne de la hauteur issue de $A$.`;
|
|
57
|
+
};
|
|
58
|
+
const getCorrection = (identifiers) => {
|
|
59
|
+
const { AIds, BIds, CIds } = identifiers;
|
|
60
|
+
const A = PointConstructor.fromIdentifiers(AIds);
|
|
61
|
+
const B = PointConstructor.fromIdentifiers(BIds);
|
|
62
|
+
const C = PointConstructor.fromIdentifiers(CIds);
|
|
63
|
+
const normal = VectorConstructor.fromPoints(B, C);
|
|
64
|
+
const AM = new Vector("AM", substract("x", A.x), substract("y", A.y)).simplify();
|
|
65
|
+
return `La hauteur issue de $A$ est perpendiculaire à la droite $(BC)$.
|
|
66
|
+
|
|
67
|
+
Un vecteur directeur de $(BC)$ est $${normal.toTexWithBinomCoords()}$.
|
|
68
|
+
|
|
69
|
+
La hauteur issue de $A$ est donc une droite passant par $${A.toTexWithCoords()}$ et dont un vecteur normal est $${normal.toTexWithBinomCoords()}$.
|
|
70
|
+
|
|
71
|
+
Pour déterminer une équation cartésienne de cette hauteur, on considère un point $M(x;y)$.
|
|
72
|
+
|
|
73
|
+
Les coordonnées du vecteur $\\overrightarrow{AM}$ sont alors $${AM.toBinomCoords().toTex()}$.
|
|
74
|
+
|
|
75
|
+
Le point $M$ appartient à la hauteur si et seulement si :
|
|
76
|
+
|
|
77
|
+
${alignTex([
|
|
78
|
+
["", "\\overrightarrow{BC}\\cdot \\overrightarrow{AM}=0"],
|
|
79
|
+
["\\iff", `${normal.scalarProduct(AM).toTex()} = 0`],
|
|
80
|
+
[
|
|
81
|
+
"\\iff",
|
|
82
|
+
`${normal
|
|
83
|
+
.scalarProduct(AM)
|
|
84
|
+
.simplify({ forbidFactorize: true, towardsDistribute: true })
|
|
85
|
+
.toTex()} = 0`,
|
|
86
|
+
],
|
|
87
|
+
])}
|
|
88
|
+
|
|
89
|
+
Une équation cartésienne de $d$ est donc :
|
|
90
|
+
|
|
91
|
+
$$
|
|
92
|
+
${getAnswer(identifiers)}
|
|
93
|
+
$$
|
|
94
|
+
|
|
95
|
+
`;
|
|
96
|
+
};
|
|
97
|
+
const getKeys = () => {
|
|
98
|
+
return ["x", "y", "equal"];
|
|
99
|
+
};
|
|
100
|
+
const isAnswerValid = (ans, { answer: _answer, AIds, BIds, CIds }) => {
|
|
101
|
+
try {
|
|
102
|
+
const splitted = ans.split("=");
|
|
103
|
+
if (splitted.length !== 2)
|
|
104
|
+
return false;
|
|
105
|
+
const left = parseAlgebraic(splitted[0]);
|
|
106
|
+
const right = parseAlgebraic(splitted[1]);
|
|
107
|
+
const studentEq = substract(left, right);
|
|
108
|
+
const point = PointConstructor.fromIdentifiers(AIds);
|
|
109
|
+
const B = PointConstructor.fromIdentifiers(BIds);
|
|
110
|
+
const C = PointConstructor.fromIdentifiers(CIds);
|
|
111
|
+
const normal = VectorConstructor.fromPoints(B, C).simplify();
|
|
112
|
+
//le point est-il sur la droite ?
|
|
113
|
+
if (Math.abs(studentEq
|
|
114
|
+
.toDetailedEvaluation({
|
|
115
|
+
x: point.x,
|
|
116
|
+
y: point.y,
|
|
117
|
+
})
|
|
118
|
+
.evaluate()) > 0.0001)
|
|
119
|
+
return false;
|
|
120
|
+
//le vecteur est-il normal ?
|
|
121
|
+
const studentC = studentEq.toDetailedEvaluation({
|
|
122
|
+
x: (0).toTree(),
|
|
123
|
+
y: (0).toTree(),
|
|
124
|
+
});
|
|
125
|
+
const studentAXPlusBY = substract(studentEq, studentC);
|
|
126
|
+
const studentA = studentAXPlusBY.toDetailedEvaluation({
|
|
127
|
+
x: (1).toTree(),
|
|
128
|
+
y: (0).toTree(),
|
|
129
|
+
});
|
|
130
|
+
const studentB = studentAXPlusBY.toDetailedEvaluation({
|
|
131
|
+
x: (0).toTree(),
|
|
132
|
+
y: (1).toTree(),
|
|
133
|
+
});
|
|
134
|
+
const studentVecNormal = new Vector("m", studentA, studentB);
|
|
135
|
+
return studentVecNormal.isColinear(normal);
|
|
136
|
+
}
|
|
137
|
+
catch (err) {
|
|
138
|
+
return handleVEAError(err);
|
|
139
|
+
}
|
|
140
|
+
};
|
|
141
|
+
const getCartesianEquationOfTriangleHeightQuestion = () => {
|
|
142
|
+
const A = PointConstructor.random("A");
|
|
143
|
+
const B = doWhile(() => PointConstructor.random("B"), (p) => p.equals(A));
|
|
144
|
+
const line = new Line(A, B);
|
|
145
|
+
const C = doWhile(() => PointConstructor.random("C"), (p) => p.equals(A) || p.equals(B) || line.includes(p));
|
|
146
|
+
const identifiers = {
|
|
147
|
+
AIds: A.toIdentifiers(),
|
|
148
|
+
BIds: B.toIdentifiers(),
|
|
149
|
+
CIds: C.toIdentifiers(),
|
|
150
|
+
};
|
|
151
|
+
return getQuestionFromIdentifiers(identifiers);
|
|
152
|
+
};
|
|
153
|
+
const getQuestionFromIdentifiers = (identifiers) => {
|
|
154
|
+
return {
|
|
155
|
+
answer: getAnswer(identifiers),
|
|
156
|
+
instruction: getInstruction(identifiers),
|
|
157
|
+
keys: getKeys(identifiers),
|
|
158
|
+
answerFormat: "tex",
|
|
159
|
+
identifiers,
|
|
160
|
+
hint: getHint(identifiers),
|
|
161
|
+
correction: getCorrection(identifiers),
|
|
162
|
+
};
|
|
163
|
+
};
|
|
164
|
+
export const cartesianEquationOfTriangleHeight = {
|
|
165
|
+
id: "cartesianEquationOfTriangleHeight",
|
|
166
|
+
connector: "\\iff",
|
|
167
|
+
label: "Déterminer une équation cartésienne de la hauteur d'un triangle",
|
|
168
|
+
isSingleStep: true,
|
|
169
|
+
generator: (nb, opts) => getDistinctQuestions(() => getCartesianEquationOfTriangleHeightQuestion(opts), nb),
|
|
170
|
+
qcmTimer: 60,
|
|
171
|
+
freeTimer: 60,
|
|
172
|
+
getPropositions,
|
|
173
|
+
isAnswerValid,
|
|
174
|
+
subject: "Mathématiques",
|
|
175
|
+
getInstruction,
|
|
176
|
+
getHint,
|
|
177
|
+
getCorrection,
|
|
178
|
+
getAnswer,
|
|
179
|
+
getQuestionFromIdentifiers,
|
|
180
|
+
hasHintAndCorrection: true,
|
|
181
|
+
};
|
|
@@ -5,6 +5,9 @@ type Identifiers = {
|
|
|
5
5
|
c: number;
|
|
6
6
|
toReduced: boolean;
|
|
7
7
|
};
|
|
8
|
-
|
|
8
|
+
type Options = {
|
|
9
|
+
direction: string;
|
|
10
|
+
};
|
|
11
|
+
export declare const cartesianEquationToReduced: Exercise<Identifiers, Options>;
|
|
9
12
|
export {};
|
|
10
13
|
//# sourceMappingURL=cartesianEquationToReduced.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cartesianEquationToReduced.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/lines/cartesianEquationToReduced.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,
|
|
1
|
+
{"version":3,"file":"cartesianEquationToReduced.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/lines/cartesianEquationToReduced.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAkBT,MAAM,6BAA6B,CAAC;AAiBrC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,SAAS,EAAE,OAAO,CAAC;CACpB,CAAC;AA4PF,KAAK,OAAO,GAAG;IACb,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAgBF,eAAO,MAAM,0BAA0B,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAmBrE,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { addValidProp, shuffleProps, tryToAddWrongProp, propWhile, } from "../../../../exercises/exercise.js";
|
|
1
|
+
import { addValidProp, shuffleProps, tryToAddWrongProp, propWhile, GeneratorOptionTarget, GeneratorOptionType, } from "../../../../exercises/exercise.js";
|
|
2
2
|
import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions.js";
|
|
3
3
|
import { RationalConstructor } from "../../../../math/numbers/rationals/rational.js";
|
|
4
4
|
import { gcd } from "../../../../math/utils/arithmetic/gcd.js";
|
|
@@ -187,7 +187,7 @@ const isAnswerValid = (ans, { answer, ...identifiers }) => {
|
|
|
187
187
|
return handleVEAError(err);
|
|
188
188
|
}
|
|
189
189
|
};
|
|
190
|
-
const getCartesianEquationToReducedQuestion = () => {
|
|
190
|
+
const getCartesianEquationToReducedQuestion = (opts) => {
|
|
191
191
|
let a;
|
|
192
192
|
let b;
|
|
193
193
|
let c;
|
|
@@ -200,7 +200,12 @@ const getCartesianEquationToReducedQuestion = () => {
|
|
|
200
200
|
b = randint(-9, 10, [0]);
|
|
201
201
|
c = randint(-9, 10, (a === 1 && b === 0) || (a === 0 && b === 1) ? [0] : undefined);
|
|
202
202
|
} while (gcd(a, b, c) !== 1 || (a <= 0 && b <= 0 && c <= 0));
|
|
203
|
-
const
|
|
203
|
+
const toReduced = opts?.direction === "D'équation cartésienne à équation réduite"
|
|
204
|
+
? true
|
|
205
|
+
: opts?.direction === "D'équation réduite à équation cartésienne"
|
|
206
|
+
? false
|
|
207
|
+
: coinFlip();
|
|
208
|
+
const identifiers = { a, b, c, toReduced };
|
|
204
209
|
return getQuestionFromIdentifiers(identifiers);
|
|
205
210
|
};
|
|
206
211
|
const getQuestionFromIdentifiers = (identifiers) => {
|
|
@@ -214,6 +219,20 @@ const getQuestionFromIdentifiers = (identifiers) => {
|
|
|
214
219
|
correction: getCorrection(identifiers),
|
|
215
220
|
};
|
|
216
221
|
};
|
|
222
|
+
const options = [
|
|
223
|
+
{
|
|
224
|
+
id: "direction",
|
|
225
|
+
label: "Sens demandé",
|
|
226
|
+
target: GeneratorOptionTarget.generation,
|
|
227
|
+
type: GeneratorOptionType.select,
|
|
228
|
+
values: [
|
|
229
|
+
"D'équation réduite à équation cartésienne",
|
|
230
|
+
"D'équation cartésienne à équation réduite",
|
|
231
|
+
"L'un ou l'autre aléatoirement",
|
|
232
|
+
],
|
|
233
|
+
defaultValue: "L'un ou l'autre aléatoirement",
|
|
234
|
+
},
|
|
235
|
+
];
|
|
217
236
|
export const cartesianEquationToReduced = {
|
|
218
237
|
id: "cartesianEquationToReduced",
|
|
219
238
|
label: "Passer de l'équation réduite d'une droite à une équation cartésienne, et inversement",
|
|
@@ -230,4 +249,5 @@ export const cartesianEquationToReduced = {
|
|
|
230
249
|
getAnswer,
|
|
231
250
|
getQuestionFromIdentifiers,
|
|
232
251
|
hasHintAndCorrection: true,
|
|
252
|
+
options,
|
|
233
253
|
};
|
|
@@ -15,4 +15,5 @@ export * from "./findParallelLineFromCartesianEquation.js";
|
|
|
15
15
|
export * from "./drawLineFromPointAndVector.js";
|
|
16
16
|
export * from "./cartesianEquationsIntersection.js";
|
|
17
17
|
export * from "./directorVectorFromAnother.js";
|
|
18
|
+
export * from "./cartesianEquationOfTriangleHeight.js";
|
|
18
19
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/lines/index.ts"],"names":[],"mappings":"AAAA,cAAc,6BAA6B,CAAC;AAC5C,cAAc,wCAAwC,CAAC;AACvD,cAAc,iCAAiC,CAAC;AAChD,cAAc,2CAA2C,CAAC;AAC1D,cAAc,oBAAoB,CAAC;AACnC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,oCAAoC,CAAC;AACnD,cAAc,0BAA0B,CAAC;AACzC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,kCAAkC,CAAC;AACjD,cAAc,uCAAuC,CAAC;AACtD,cAAc,yCAAyC,CAAC;AACxD,cAAc,4CAA4C,CAAC;AAC3D,cAAc,iCAAiC,CAAC;AAChD,cAAc,qCAAqC,CAAC;AACpD,cAAc,gCAAgC,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/lines/index.ts"],"names":[],"mappings":"AAAA,cAAc,6BAA6B,CAAC;AAC5C,cAAc,wCAAwC,CAAC;AACvD,cAAc,iCAAiC,CAAC;AAChD,cAAc,2CAA2C,CAAC;AAC1D,cAAc,oBAAoB,CAAC;AACnC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,oCAAoC,CAAC;AACnD,cAAc,0BAA0B,CAAC;AACzC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,kCAAkC,CAAC;AACjD,cAAc,uCAAuC,CAAC;AACtD,cAAc,yCAAyC,CAAC;AACxD,cAAc,4CAA4C,CAAC;AAC3D,cAAc,iCAAiC,CAAC;AAChD,cAAc,qCAAqC,CAAC;AACpD,cAAc,gCAAgC,CAAC;AAC/C,cAAc,wCAAwC,CAAC"}
|
|
@@ -15,3 +15,4 @@ export * from "./findParallelLineFromCartesianEquation.js";
|
|
|
15
15
|
export * from "./drawLineFromPointAndVector.js";
|
|
16
16
|
export * from "./cartesianEquationsIntersection.js";
|
|
17
17
|
export * from "./directorVectorFromAnother.js";
|
|
18
|
+
export * from "./cartesianEquationOfTriangleHeight.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../src/exercises/math/geometry/vectors/scalarProduct/alKashi/index.ts"],"names":[],"mappings":"AAAA,cAAc,gCAAgC,CAAC;AAC/C,cAAc,qCAAqC,CAAC;AACpD,cAAc,6BAA6B,CAAC"}
|
package/lib/exercises/math/geometry/vectors/scalarProduct/alKashi/scalarProductAlKashiAngle.d.ts
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Exercise } from "../../../../../../exercises/exercise.js";
|
|
2
|
+
import { TriangleIdentifiers } from "../../../../../../math/geometry/triangles/triangle.js";
|
|
3
|
+
type Identifiers = {
|
|
4
|
+
triangleIds: TriangleIdentifiers;
|
|
5
|
+
indexAngle: number;
|
|
6
|
+
};
|
|
7
|
+
export declare const scalarProductAlKashiAngle: Exercise<Identifiers>;
|
|
8
|
+
export {};
|
|
9
|
+
//# sourceMappingURL=scalarProductAlKashiAngle.d.ts.map
|
package/lib/exercises/math/geometry/vectors/scalarProduct/alKashi/scalarProductAlKashiAngle.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scalarProductAlKashiAngle.d.ts","sourceRoot":"","sources":["../../../../../../../src/exercises/math/geometry/vectors/scalarProduct/alKashi/scalarProductAlKashiAngle.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAgBT,MAAM,6BAA6B,CAAC;AAGrC,OAAO,EAEL,mBAAmB,EACpB,MAAM,2CAA2C,CAAC;AAkBnD,KAAK,WAAW,GAAG;IACjB,WAAW,EAAE,mBAAmB,CAAC;IACjC,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC;AAmSF,eAAO,MAAM,yBAAyB,EAAE,QAAQ,CAAC,WAAW,CAoB3D,CAAC"}
|
package/lib/exercises/math/geometry/vectors/scalarProduct/alKashi/scalarProductAlKashiAngle.js
ADDED
|
@@ -0,0 +1,247 @@
|
|
|
1
|
+
import { addValidProp, shuffleProps, tryToAddWrongProp, propWhile, } from "../../../../../../exercises/exercise.js";
|
|
2
|
+
import { getDistinctQuestions } from "../../../../../../exercises/utils/getDistinctQuestions.js";
|
|
3
|
+
import { GeogebraConstructor } from "../../../../../../geogebra/geogebraConstructor.js";
|
|
4
|
+
import { TriangleConstructor, } from "../../../../../../math/geometry/triangles/triangle.js";
|
|
5
|
+
import { randfloat } from "../../../../../../math/utils/random/randfloat.js";
|
|
6
|
+
import { randint } from "../../../../../../math/utils/random/randint.js";
|
|
7
|
+
import { round } from "../../../../../../math/utils/round.js";
|
|
8
|
+
import { arccos } from "../../../../../../tree/nodes/functions/arccosNode.js";
|
|
9
|
+
import { PiNode } from "../../../../../../tree/nodes/numbers/piNode.js";
|
|
10
|
+
import { add } from "../../../../../../tree/nodes/operators/addNode.js";
|
|
11
|
+
import { frac } from "../../../../../../tree/nodes/operators/fractionNode.js";
|
|
12
|
+
import { multiply } from "../../../../../../tree/nodes/operators/multiplyNode.js";
|
|
13
|
+
import { power } from "../../../../../../tree/nodes/operators/powerNode.js";
|
|
14
|
+
import { substract } from "../../../../../../tree/nodes/operators/substractNode.js";
|
|
15
|
+
import { parseAlgebraic } from "../../../../../../tree/parsers/latexParser.js";
|
|
16
|
+
import { probaFlip } from "../../../../../../utils/alea/probaFlip.js";
|
|
17
|
+
import { arrayRotation } from "../../../../../../utils/arrays/rotation.js";
|
|
18
|
+
import { handleVEAError } from "../../../../../../utils/errors/handleVEAError.js";
|
|
19
|
+
const precision = 2;
|
|
20
|
+
const getHydrated = (identifiers) => {
|
|
21
|
+
const { triangleIds, indexAngle } = identifiers;
|
|
22
|
+
const triangle = TriangleConstructor.fromIdentifiers(triangleIds);
|
|
23
|
+
const sides = arrayRotation(triangle.sides, indexAngle);
|
|
24
|
+
const angleNames = arrayRotation(triangle.angles, indexAngle).map((angle) => angle.toTexMini());
|
|
25
|
+
return {
|
|
26
|
+
triangle,
|
|
27
|
+
sides,
|
|
28
|
+
angleNames,
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
const getInstruction = (identifiers) => {
|
|
32
|
+
const { indexAngle } = identifiers;
|
|
33
|
+
const { triangle } = getHydrated(identifiers);
|
|
34
|
+
return `Soit $${triangle.name}$ un triangle dont on connaît les longueurs des côtés :
|
|
35
|
+
|
|
36
|
+
${triangle.sides.map((segment) => `- $${segment.toInsideName()} = ${segment.getLength().frenchify()}$`).join(`
|
|
37
|
+
|
|
38
|
+
`)}
|
|
39
|
+
|
|
40
|
+
Combien l'angle $${triangle.angles[indexAngle].toTexMini()}$ mesure-t-il ?
|
|
41
|
+
Donner une valeur approchée en degrés avec $${precision}$ décimales.`;
|
|
42
|
+
};
|
|
43
|
+
const getAnswerStuff = (identifiers) => {
|
|
44
|
+
const { sides } = getHydrated(identifiers);
|
|
45
|
+
const nodeCosAngle = frac(substract(add(power(sides[1].getLengthNode(), 2), power(sides[2].getLengthNode(), 2)), power(sides[0].getLengthNode(), 2)), multiply(2, multiply(sides[1].getLengthNode(), sides[2].getLengthNode())));
|
|
46
|
+
const nodeAngleInRadians = arccos(nodeCosAngle);
|
|
47
|
+
const nodeAngleInDegrees = multiply(nodeAngleInRadians, frac(180, PiNode));
|
|
48
|
+
return {
|
|
49
|
+
nodeCosAngle,
|
|
50
|
+
nodeAngleInRadians,
|
|
51
|
+
nodeAngleInDegrees,
|
|
52
|
+
};
|
|
53
|
+
};
|
|
54
|
+
const getAnswerNode = (identifiers) => {
|
|
55
|
+
return getAnswerStuff(identifiers).nodeAngleInDegrees;
|
|
56
|
+
};
|
|
57
|
+
const getAnswer = (identifiers) => {
|
|
58
|
+
return round(getAnswerNode(identifiers).evaluate(), precision).frenchify();
|
|
59
|
+
};
|
|
60
|
+
const getHint = (identifiers) => {
|
|
61
|
+
const { angleNames } = getHydrated(identifiers);
|
|
62
|
+
return `Applique le théorème d'Al Kashi dans le triangle $ABC$ pour l'angle $${angleNames[0]}$.`;
|
|
63
|
+
};
|
|
64
|
+
const getCorrection = (identifiers) => {
|
|
65
|
+
const { indexAngle } = identifiers;
|
|
66
|
+
const { sides, angleNames } = getHydrated(identifiers);
|
|
67
|
+
const sideNames = arrayRotation(sides, indexAngle)
|
|
68
|
+
.map((segment) => segment.toInsideName())
|
|
69
|
+
.map((name) => {
|
|
70
|
+
return {
|
|
71
|
+
AB: "c",
|
|
72
|
+
AC: "b",
|
|
73
|
+
BC: "a",
|
|
74
|
+
}[name];
|
|
75
|
+
});
|
|
76
|
+
const nodeCosAngle = frac(substract(add(power(sideNames[1], 2), power(sideNames[2], 2)), power(sideNames[0], 2)), multiply(2, multiply(sideNames[1], sideNames[2])));
|
|
77
|
+
const nodeAngle = arccos(nodeCosAngle);
|
|
78
|
+
return `On applique le théorème d'Al Kashi dans le triangle $ABC$.
|
|
79
|
+
|
|
80
|
+
On utilise les notations suivantes :
|
|
81
|
+
|
|
82
|
+
$$
|
|
83
|
+
a \\ = \\ BC \\ ; \\ b \\ = \\ AC \\ ; \\ c \\ = \\ AB \\
|
|
84
|
+
$$
|
|
85
|
+
|
|
86
|
+
$$
|
|
87
|
+
${sideNames[0]}^2 = ${sideNames[1]}^2 + ${sideNames[2]}^2 - 2 ${sideNames[1]} ${sideNames[2]} \\cos(${angleNames[0]})
|
|
88
|
+
$$
|
|
89
|
+
|
|
90
|
+
$$
|
|
91
|
+
\\cos(${angleNames[0]}) = ${nodeCosAngle.toTex()}
|
|
92
|
+
$$
|
|
93
|
+
|
|
94
|
+
En radians :
|
|
95
|
+
|
|
96
|
+
$$
|
|
97
|
+
${angleNames[0]} = ${nodeAngle.toTex()}
|
|
98
|
+
$$
|
|
99
|
+
|
|
100
|
+
Il ne faut pas oublier de passer en degrés :
|
|
101
|
+
|
|
102
|
+
$$
|
|
103
|
+
${angleNames[0]}_{deg} = ${angleNames[0]}_{rad} \\times \\frac{180}{${PiNode.toTex()}}
|
|
104
|
+
$$
|
|
105
|
+
|
|
106
|
+
On arrondit à la toute fin :
|
|
107
|
+
|
|
108
|
+
$$
|
|
109
|
+
${angleNames[0]} \\approx ${getAnswer(identifiers)} {}^{\\circ}
|
|
110
|
+
$$
|
|
111
|
+
|
|
112
|
+
`;
|
|
113
|
+
};
|
|
114
|
+
//too helpful for student ?
|
|
115
|
+
const getGGBOptions = (identifiers) => {
|
|
116
|
+
const { triangle } = getHydrated(identifiers);
|
|
117
|
+
// const { indexAngle } = identifiers;
|
|
118
|
+
// const angle = arrayRotation(triangle.angles, indexAngle)[0];
|
|
119
|
+
const ggb = new GeogebraConstructor({
|
|
120
|
+
commands: [
|
|
121
|
+
//triangle
|
|
122
|
+
...triangle.commands,
|
|
123
|
+
// //angle
|
|
124
|
+
// `Ang = Angle(${angle.points
|
|
125
|
+
// .reverse()
|
|
126
|
+
// .map((point) => point.name)
|
|
127
|
+
// .join(",")})`,
|
|
128
|
+
// `ShowLabel(Ang, false)`,
|
|
129
|
+
],
|
|
130
|
+
hideAxes: true,
|
|
131
|
+
});
|
|
132
|
+
return ggb.getOptions({
|
|
133
|
+
coords: ggb.getCoordsForPoints(triangle.points),
|
|
134
|
+
});
|
|
135
|
+
};
|
|
136
|
+
const getPropositions = (n, { answer, ...identifiers }) => {
|
|
137
|
+
const propositions = [];
|
|
138
|
+
addValidProp(propositions, answer);
|
|
139
|
+
const { indexAngle } = identifiers;
|
|
140
|
+
const { sides } = getHydrated(identifiers);
|
|
141
|
+
const answerStuff = getAnswerStuff(identifiers);
|
|
142
|
+
//student: cos value
|
|
143
|
+
{
|
|
144
|
+
const valueCos = answerStuff.nodeCosAngle.evaluate();
|
|
145
|
+
if (valueCos > 0) {
|
|
146
|
+
tryToAddWrongProp(propositions, round(valueCos, precision).frenchify());
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
//student: radians instead of degrees
|
|
150
|
+
{
|
|
151
|
+
tryToAddWrongProp(propositions, round(answerStuff.nodeAngleInRadians.evaluate(), precision).frenchify());
|
|
152
|
+
}
|
|
153
|
+
//student: sign error when getting cos
|
|
154
|
+
{
|
|
155
|
+
const nodeCosAngle = frac(substract(add(power(sides[1].getLengthNode(), 2), power(sides[2].getLengthNode(), 2)), power(sides[0].getLengthNode(), 2)), multiply(-2, multiply(sides[1].getLengthNode(), sides[2].getLengthNode())));
|
|
156
|
+
const nodeAngleInRadians = arccos(nodeCosAngle);
|
|
157
|
+
const nodeAngleInDegrees = multiply(nodeAngleInRadians, frac(180, PiNode));
|
|
158
|
+
tryToAddWrongProp(propositions, round(nodeAngleInDegrees.evaluate(), precision).frenchify());
|
|
159
|
+
}
|
|
160
|
+
//student: wrong angle
|
|
161
|
+
{
|
|
162
|
+
[0, 1, 2]
|
|
163
|
+
.filter((i) => i !== indexAngle)
|
|
164
|
+
.forEach((indexAngleWrong) => {
|
|
165
|
+
const identifiersWrong = Object.assign({}, identifiers, {
|
|
166
|
+
indexAngle: indexAngleWrong,
|
|
167
|
+
});
|
|
168
|
+
const texAnswerWrong = getAnswer(identifiersWrong);
|
|
169
|
+
tryToAddWrongProp(propositions, texAnswerWrong);
|
|
170
|
+
});
|
|
171
|
+
}
|
|
172
|
+
//terror: around answer, _most of the time_
|
|
173
|
+
{
|
|
174
|
+
const value = (() => {
|
|
175
|
+
if (probaFlip(0.71)) {
|
|
176
|
+
return answerStuff.nodeAngleInDegrees.evaluate();
|
|
177
|
+
}
|
|
178
|
+
else {
|
|
179
|
+
const indexAngleWrong = randint(0, 3, [indexAngle]);
|
|
180
|
+
const identifiersWrong = Object.assign({}, identifiers, {
|
|
181
|
+
indexAngle: indexAngleWrong,
|
|
182
|
+
});
|
|
183
|
+
return getAnswerNode(identifiersWrong).evaluate();
|
|
184
|
+
}
|
|
185
|
+
})();
|
|
186
|
+
[...Array(4).keys()].forEach(() => {
|
|
187
|
+
const valueAnswerOffsetted = value + randfloat(-7, 7, 2, [0]);
|
|
188
|
+
tryToAddWrongProp(propositions, round(valueAnswerOffsetted, precision).frenchify());
|
|
189
|
+
});
|
|
190
|
+
}
|
|
191
|
+
propWhile(propositions, n, () => {
|
|
192
|
+
tryToAddWrongProp(propositions, randfloat(0, 180, 2, [0, 180]).frenchify());
|
|
193
|
+
});
|
|
194
|
+
return shuffleProps(propositions, n);
|
|
195
|
+
};
|
|
196
|
+
const getKeys = () => {
|
|
197
|
+
return [];
|
|
198
|
+
};
|
|
199
|
+
const isAnswerValid = (ans, { answer }) => {
|
|
200
|
+
try {
|
|
201
|
+
const parsed = parseAlgebraic(ans);
|
|
202
|
+
return parsed.simplify().toTex() === answer;
|
|
203
|
+
}
|
|
204
|
+
catch (err) {
|
|
205
|
+
return handleVEAError(err);
|
|
206
|
+
}
|
|
207
|
+
};
|
|
208
|
+
const getScalarProductAlKashiAngleQuestion = () => {
|
|
209
|
+
const triangle = TriangleConstructor.randomNiceSides({});
|
|
210
|
+
const indexAngle = randint(0, 3);
|
|
211
|
+
const identifiers = {
|
|
212
|
+
triangleIds: triangle.toIdentifiers(),
|
|
213
|
+
indexAngle,
|
|
214
|
+
};
|
|
215
|
+
return getQuestionFromIdentifiers(identifiers);
|
|
216
|
+
};
|
|
217
|
+
const getQuestionFromIdentifiers = (identifiers) => {
|
|
218
|
+
return {
|
|
219
|
+
answer: getAnswer(identifiers),
|
|
220
|
+
instruction: getInstruction(identifiers),
|
|
221
|
+
keys: getKeys(identifiers),
|
|
222
|
+
answerFormat: "tex",
|
|
223
|
+
identifiers,
|
|
224
|
+
hint: getHint(identifiers),
|
|
225
|
+
correction: getCorrection(identifiers),
|
|
226
|
+
ggbOptions: getGGBOptions(identifiers),
|
|
227
|
+
};
|
|
228
|
+
};
|
|
229
|
+
export const scalarProductAlKashiAngle = {
|
|
230
|
+
id: "scalarProductAlKashiAngle",
|
|
231
|
+
connector: "=",
|
|
232
|
+
label: "Connaissant les longueurs des trois côtés d'un triangle, calculer un angle",
|
|
233
|
+
isSingleStep: true,
|
|
234
|
+
generator: (nb, opts) => getDistinctQuestions(() => getScalarProductAlKashiAngleQuestion(opts), nb),
|
|
235
|
+
qcmTimer: 60,
|
|
236
|
+
freeTimer: 60,
|
|
237
|
+
getPropositions,
|
|
238
|
+
isAnswerValid,
|
|
239
|
+
subject: "Mathématiques",
|
|
240
|
+
getInstruction,
|
|
241
|
+
getHint,
|
|
242
|
+
getCorrection,
|
|
243
|
+
hasHintAndCorrection: true,
|
|
244
|
+
getAnswer,
|
|
245
|
+
getQuestionFromIdentifiers,
|
|
246
|
+
hasGeogebra: true,
|
|
247
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Exercise } from "../../../../../../exercises/exercise.js";
|
|
2
|
+
import { PointIdentifiers } from "../../../../../../math/geometry/point.js";
|
|
3
|
+
import { TriangleIdentifiers } from "../../../../../../math/geometry/triangles/triangle.js";
|
|
4
|
+
type Identifiers = {
|
|
5
|
+
triangleIds: TriangleIdentifiers;
|
|
6
|
+
pointIdsH: PointIdentifiers;
|
|
7
|
+
};
|
|
8
|
+
type Options = {
|
|
9
|
+
sectorOfPointH: string;
|
|
10
|
+
};
|
|
11
|
+
export declare const scalarProductAlKashiBH: Exercise<Identifiers, Options>;
|
|
12
|
+
export {};
|
|
13
|
+
//# sourceMappingURL=scalarProductAlKashiBH.d.ts.map
|
package/lib/exercises/math/geometry/vectors/scalarProduct/alKashi/scalarProductAlKashiBH.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scalarProductAlKashiBH.d.ts","sourceRoot":"","sources":["../../../../../../../src/exercises/math/geometry/vectors/scalarProduct/alKashi/scalarProductAlKashiBH.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAmBT,MAAM,6BAA6B,CAAC;AAKrC,OAAO,EAGL,gBAAgB,EACjB,MAAM,8BAA8B,CAAC;AAGtC,OAAO,EAGL,mBAAmB,EACpB,MAAM,2CAA2C,CAAC;AAsBnD,KAAK,WAAW,GAAG;IACjB,WAAW,EAAE,mBAAmB,CAAC;IACjC,SAAS,EAAE,gBAAgB,CAAC;CAC7B,CAAC;AAggBF,KAAK,OAAO,GAAG;IACb,cAAc,EAAE,MAAM,CAAC;CACxB,CAAC;AAsBF,eAAO,MAAM,sBAAsB,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CA2BjE,CAAC"}
|