File: /home/mmtprep/public_html/mathzen.mmtprep.com/assets/2F10-3-tSkPJRMp.js.map
{"version":3,"file":"2F10-3-tSkPJRMp.js","sources":["../../src/exercices/2e/2F10-3.js"],"sourcesContent":["import { droite } from '../../lib/2d/droites.js'\nimport { point, tracePoint } from '../../lib/2d/points.js'\nimport { repere } from '../../lib/2d/reperes.js'\nimport { labelPoint, texteParPosition } from '../../lib/2d/textes.js'\nimport { choice, combinaisonListes } from '../../lib/outils/arrayOutils'\nimport { texFractionReduite } from '../../lib/outils/deprecatedFractions.js'\nimport { ecritureAlgebrique, ecritureParentheseSiNegatif, reduireAxPlusB } from '../../lib/outils/ecritures'\nimport { pgcd } from '../../lib/outils/primalite'\nimport { texteGras } from '../../lib/format/style'\nimport Exercice from '../deprecatedExercice.js'\nimport { mathalea2d, colorToLatexOrHTML } from '../../modules/2dGeneralites.js'\nimport { listeQuestionsToContenu, randint } from '../../modules/outils.js'\nimport { min, max } from 'mathjs'\nexport const titre = 'Graphical representation of an affine function'\nexport const dateDeModifImportante = '08/05/2023'\n\n/**\n* @author Stéphane Guyon (mise à jour avec les cas Gilles Mora)\n* 2F10-3\n*/\nexport const uuid = 'c360e'\nexport const ref = '2F10-3'\nexport default function Representerfonctionaffine () {\n Exercice.call(this)\n this.titre = titre\n this.consigne = 'Represent graphically ' + (this.nbQuestions === 1 ? 'the following affine function $f$ defined' : 'the following affine functions $f$ defined') + ' on $\\\\mathbb R$ by:'\n this.nbQuestions = 3 // On complète le nb de questions\n this.nbCols = 1\n this.nbColsCorr = 1\n this.tailleDiaporama = 3\n this.video = ''\n this.spacing = 1\n this.spacingCorr = 1\n this.sup = 1\n\n this.nouvelleVersion = function () {\n this.sup = parseInt(this.sup)\n this.listeQuestions = []\n this.listeCorrections = []\n let typesDeQuestionsDisponibles = []\n if (this.sup === 1) {\n typesDeQuestionsDisponibles = [1]\n }\n if (this.sup === 2) {\n typesDeQuestionsDisponibles = [2]\n }\n if (this.sup === 3) {\n typesDeQuestionsDisponibles = [1, 2]\n }\n\n const listeTypeDeQuestions = combinaisonListes(typesDeQuestionsDisponibles, this.nbQuestions)\n const o = texteParPosition('O', -0.5, -0.5, 'medium', 'black', 1)\n for (let i = 0, a, b, r, c, d, tA, lA, tB, lB, xA, yA, xB, yB, f, lC, typesDeQuestions, texte, texteCorr, cadre, cadreFenetreSvg, cpt = 0;\n i < this.nbQuestions && cpt < 50;) { // on rajoute les variables dont on a besoin\n typesDeQuestions = listeTypeDeQuestions[i]\n switch (typesDeQuestions) {\n case 1:\n {\n f = (x) => a * x + b\n a = randint(0, 3, [0]) * choice([-1, 1])// coefficient non nul a de la fonction affine\n b = randint(0, 3, [0]) * choice([-1, 1])// ordonnée à l'origine b non nulle de la fonction affine\n f = (x) => a * x + b\n\n xA = 0\n yA = f(xA)\n xB = randint(1, 3) * choice([-1, 1])// Abscisse de B\n yB = f(xB)// Ordonnée de B\n\n const A = point(xA, yA, 'A')\n const B = point(xB, yB, 'B')\n c = droite(A, B)\n c.color = colorToLatexOrHTML('red')\n c.epaisseur = 2\n\n cadre = {\n xMin: min(-5, xA - 1, xB - 1),\n yMin: min(-5, yA - 1, yB - 1),\n xMax: max(5, xA + 1, xB + 1),\n yMax: max(5, yA + 1, yB + 1)\n }\n // It's weird but it's because in mathAlea, attributes don't have capital letters.\n // So even when it's the same frame, we have to do it.\n cadreFenetreSvg = {\n xmin: cadre.xMin,\n ymin: cadre.yMin,\n xmax: cadre.xMax,\n ymax: cadre.yMax,\n scale: 0.6\n }\n\n r = repere(cadre)\n\n tA = tracePoint(A, 'red') // Variable qui trace les points avec une croix\n tB = tracePoint(B, 'red') // Variable qui trace les points avec une croix\n lA = labelPoint(A, 'red')// Variable qui trace les nom s A et B\n lB = labelPoint(B, 'red')// Variable qui trace les nom s A et B\n\n tA.taille = 5\n tA.epaisseur = 2\n tB.taille = 5\n tB.epaisseur = 2\n\n texte = `$f(x)=${reduireAxPlusB(a, b)}$ <br>`\n if (a !== 0) {\n texteCorr = 'We know that the graphic representation of an affine function is a line.<br>'\n texteCorr += 'It is therefore sufficient to determine the coordinates of two points to be able to represent $f$.<br>'\n texteCorr += `Since $f(${xA})=${yA}$, we have $A(${xA},${yA}) \\\\in \\\\mathcal{C_f}$.<br>`\n texteCorr += 'We look for a second point, and we take an antecedent at random:<br>'\n texteCorr += `Let $x=${xB}$:<br>`\n texteCorr += `We calculate: $f(${xB})=${a} \\\\times ${ecritureParentheseSiNegatif(xB)}${ecritureAlgebrique(b)}=${yB}$.<br>`\n texteCorr += `We deduce that $B(${xB},${yB}) \\\\in \\\\mathcal{C_f}$.<br>`\n } else {\n texteCorr = 'We observe that $f$ is a constant function.<br>'\n texteCorr += `Its graphic representation is therefore a straight line parallel to the abscissa axis, with the equation $y=${yA}$.<br>`\n }\n texteCorr += mathalea2d(cadreFenetreSvg,\n lA, lB, r, c, tA, tB, o) }\n texteCorr += `<br>${texteGras('Noticed')}: to draw the line, we can also use the slope coefficient of the line ($${a}$) and its intercept ($${b}$).<br>`\n break\n\n case 2: // cas du coefficient directeur fractionnaire\n { a = randint(-5, 5, [0]) // numérateur coefficient directeur non nul\n b = randint(-5, 5, [0]) // ordonnée à l'origine non nulle\n d = randint(2, 5) // dénominateur coefficient directeur non multiple du numérateur pour éviter nombre entier\n while (pgcd(a, d) !== 1) {\n a = randint(-5, 5, [0]) // numérateur coefficient directeur non nul\n b = randint(-5, 5, [0]) // ordonnée à l'origine non nulle\n d = randint(2, 5)\n }\n f = (x) => a / d * x + b\n xA = 0 // Abscisse de A\n yA = f(xA)// Ordonnée de A\n xB = d\n yB = f(xB)\n\n const A1 = point(xA, yA, 'A')\n const B1 = point(xB, yB, 'B')\n c = droite(A1, B1)\n c.color = colorToLatexOrHTML('red')\n c.epaisseur = 2\n\n cadre = {\n xMin: min(-5, xA - 1, xB - 1),\n yMin: min(-5, yA - 1, yB - 1),\n xMax: max(5, xA + 1, xB + 1),\n yMax: max(5, yA + 1, yB + 1)\n }\n\n cadreFenetreSvg = {\n xmin: cadre.xMin,\n ymin: cadre.yMin,\n xmax: cadre.xMax,\n ymax: cadre.yMax,\n scale: 0.6\n }\n\n texte = `$f(x)=${texFractionReduite(a, d)}x ${ecritureAlgebrique(b)}$ <br>`\n\n texteCorr = 'We know that the graphic representation of an affine function is a line.<br>'\n texteCorr += 'It is therefore sufficient to determine the coordinates of two points to be able to represent $f$.<br>'\n texteCorr += `As $f(${xA})=${yA}$, we have: $A(${xA},${yA}) \\\\in \\\\mathcal{C_f}$.<br>`\n texteCorr += 'We look for a second point, and we take an antecedent which facilitates the calculations:<br>'\n texteCorr += `For example $x=${xB}$:<br>`\n texteCorr += `We calculate: $f(${xB})=${texFractionReduite(a, d)} \\\\times ${ecritureParentheseSiNegatif(xB)}${ecritureAlgebrique(b)}=${yB}$.<br>`\n texteCorr += `We deduce that $B(${xB},${yB}) \\\\in \\\\mathcal{C_f}$.<br>`\n\n tA = tracePoint(A1, 'red') // Variable qui trace les points avec une croix\n lA = labelPoint(A1, 'red')// Variable qui trace les nom s A et B\n tB = tracePoint(B1, 'red') // Variable qui trace les points avec une croix\n lB = labelPoint(B1, 'red')// Variable qui trace les nom s A et B\n // lC = labelPoint(f, 'C_f')// Variable which traces the names A and B\n\n r = repere(cadre)// On définit le repère\n texteCorr += mathalea2d(\n cadreFenetreSvg,\n r, c, tA, lA, tB, lB, lC, o)\n // We draw the graph\n texteCorr += `<br>${texteGras('Noticed')}: to draw the line, we can also use the slope coefficient of the line ($${texFractionReduite(a, d)}$) and its intercept ($${b}$).<br>`\n }\n break\n }\n\n if (this.questionJamaisPosee(i, a, b)) {\n // If the question has never been asked, we create another one\n this.listeQuestions.push(texte)\n this.listeCorrections.push(texteCorr)\n i++\n }\n cpt++\n }\n listeQuestionsToContenu(this)\n }\n this.besoinFormulaireNumerique = ['Question Types', 3, '1: Integer values\\n2: Fractional values\\n3: Combination of the two previous cases']\n}\n"],"names":["titre","dateDeModifImportante","uuid","ref","Representerfonctionaffine","Exercice","typesDeQuestionsDisponibles","listeTypeDeQuestions","combinaisonListes","o","texteParPosition","i","a","b","r","c","d","tA","lA","tB","lB","xA","yA","xB","yB","lC","typesDeQuestions","texte","texteCorr","cadre","cadreFenetreSvg","cpt","x","randint","choice","A","point","B","droite","colorToLatexOrHTML","min","max","repere","tracePoint","labelPoint","reduireAxPlusB","ecritureParentheseSiNegatif","ecritureAlgebrique","mathalea2d","texteGras","pgcd","A1","B1","texFractionReduite","listeQuestionsToContenu"],"mappings":"4SAaY,MAACA,EAAQ,iDACRC,GAAwB,aAMxBC,GAAO,QACPC,GAAM,SACJ,SAASC,IAA6B,CACnDC,EAAS,KAAK,IAAI,EAClB,KAAK,MAAQL,EACb,KAAK,SAAW,0BAA4B,KAAK,cAAgB,EAAI,4CAA8C,8CAAgD,uBACnK,KAAK,YAAc,EACnB,KAAK,OAAS,EACd,KAAK,WAAa,EAClB,KAAK,gBAAkB,EACvB,KAAK,MAAQ,GACb,KAAK,QAAU,EACf,KAAK,YAAc,EACnB,KAAK,IAAM,EAEX,KAAK,gBAAkB,UAAY,CACjC,KAAK,IAAM,SAAS,KAAK,GAAG,EAC5B,KAAK,eAAiB,CAAE,EACxB,KAAK,iBAAmB,CAAE,EAC1B,IAAIM,EAA8B,CAAE,EAChC,KAAK,MAAQ,IACfA,EAA8B,CAAC,CAAC,GAE9B,KAAK,MAAQ,IACfA,EAA8B,CAAC,CAAC,GAE9B,KAAK,MAAQ,IACfA,EAA8B,CAAC,EAAG,CAAC,GAGrC,MAAMC,EAAuBC,EAAkBF,EAA6B,KAAK,WAAW,EACtFG,EAAIC,EAAiB,IAAK,IAAM,IAAM,SAAU,QAAS,CAAC,EAChE,QAASC,EAAI,EAAGC,EAAGC,EAAGC,EAAGC,EAAGC,EAAGC,EAAIC,EAAIC,EAAIC,EAAIC,EAAIC,EAAIC,EAAIC,EAAI,EAAGC,EAAIC,EAAkBC,EAAOC,EAAWC,EAAOC,EAAiBC,EAAM,EACtIpB,EAAI,KAAK,aAAeoB,EAAM,IAAK,CAEnC,O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