File: /home/mmtprep/public_html/mathzen.mmtprep.com/assets/2F32-2-Cyv8JnN2.js.map
{"version":3,"file":"2F32-2-Cyv8JnN2.js","sources":["../../src/exercices/2e/2F32-2.js"],"sourcesContent":["import { repere } from '../../lib/2d/reperes.js'\nimport { texteParPosition } from '../../lib/2d/textes.js'\nimport { ajouteChampTexteMathLive } from '../../lib/interactif/questionMathLive.js'\nimport { spline } from '../../lib/mathFonctions/Spline.js'\nimport { choice } from '../../lib/outils/arrayOutils'\nimport { fixeBordures, mathalea2d } from '../../modules/2dGeneralites.js'\nimport { listeQuestionsToContenu, randint } from '../../modules/outils.js'\nimport Exercice from '../Exercice'\nimport { setReponse } from '../../lib/interactif/gestionInteractif.js'\n\nexport const titre = 'Graphically determine the extrema'\nexport const interactifReady = true\nexport const interactifType = 'mathLive'\n\nexport const dateDePublication = '27/06/2023' // La date de publication initiale au format 'jj/mm/aaaa' pour affichage temporaire d'un tag\nexport const uuid = '7761e' // @todo à changer dans un nouvel exo (utiliser pnpm getNewUuid)\nexport const ref = '2F32-2'// @todo à modifier aussi\n// une liste de nœuds pour définir une fonction Spline\nconst noeuds1 = [{ x: -4, y: -1, deriveeGauche: 0, deriveeDroit: 0, isVisible: true },\n { x: -3, y: 1, deriveeGauche: 2, deriveeDroit: 2, isVisible: false },\n { x: -2, y: 4, deriveeGauche: 0, deriveeDroit: 0, isVisible: false },\n { x: -1, y: 1, deriveeGauche: -2, deriveeDroit: -2, isVisible: false },\n { x: 0, y: -3, deriveeGauche: 0, deriveeDroit: 0, isVisible: false },\n { x: 2, y: 2, deriveeGauche: 0, deriveeDroit: 0, isVisible: false },\n { x: 3, y: -2, deriveeGauche: 0, deriveeDroit: 0, isVisible: false },\n { x: 4, y: 1, deriveeGauche: 0, deriveeDroit: 0, isVisible: true }\n]\n// une autre liste de nœuds...\nconst noeuds2 = [{ x: -5, y: 3, deriveeGauche: 0, deriveeDroit: 0, isVisible: true },\n { x: -3, y: 4, deriveeGauche: 0, deriveeDroit: 0, isVisible: false },\n { x: -1, y: -3, deriveeGauche: 0, deriveeDroit: 0, isVisible: false },\n { x: 2, y: 2, deriveeGauche: -0.5, deriveeDroit: -0.5, isVisible: true }\n]\nconst noeuds3 = [{ x: -5, y: 0, deriveeGauche: -2, deriveeDroit: -2, isVisible: true },\n { x: -4, y: -3, deriveeGauche: 0, deriveeDroit: 0, isVisible: false },\n { x: -2, y: 1, deriveeGauche: 0, deriveeDroit: 0, isVisible: false },\n { x: 0, y: 0, deriveeGauche: -0.5, deriveeDroit: -0.5, isVisible: true }\n]\nconst noeuds4 = [{ x: -5, y: 0, deriveeGauche: -2, deriveeDroit: -2, isVisible: true },\n { x: -4, y: -3, deriveeGauche: 0, deriveeDroit: 0, isVisible: false },\n { x: -2, y: 1, deriveeGauche: 0, deriveeDroit: 0, isVisible: false },\n { x: 0, y: 0, deriveeGauche: -0.5, deriveeDroit: -0.5, isVisible: true }\n]\n// une liste des listes\nconst mesFonctions = [noeuds1, noeuds2, noeuds3, noeuds4]//, noeuds1, noeuds2, noeuds3, noeuds4\n\n/**\n * trouve les extrema mais ne fonctionne que si les extrema se trouvent en des noeuds.\n * @param {{x: number, y:number,deriveeGauche:number,deriveeDroit:number, isVisible:boolean}[]} nuage les noeuds\n * @returns {{yMin: number, yMax: number, xMax: number, xMin: number}}\n */\nfunction trouveMaxes (nuage) {\n const xMin = Math.floor(Math.min(...nuage.map(el => el.x)) - 1)\n const yMin = Math.floor(Math.min(...nuage.map(el => el.y)) - 1)\n const xMax = Math.ceil(Math.max(...nuage.map(el => el.x)) + 1)\n const yMax = Math.ceil(Math.max(...nuage.map(el => el.y)) + 1)\n return { xMin, xMax, yMin, yMax }\n}\n\n/**\n * choisit les caractèristique de la transformation de la courbe\n * @returns {{coeffX: -1|1, deltaX: int, deltaY: int, coeffY: -1|1}}\n */\nfunction aleatoiriseCourbe () {\n const coeffX = choice([-1, 1]) // symétries ou pas\n const coeffY = choice([-1, 1])\n const deltaX = randint(-2, +2) // translations\n const deltaY = randint(-2, +2)\n return { coeffX, coeffY, deltaX, deltaY }\n}\n\n/**\n * Aléatoirise une courbe et demande les antécédents d'une valeur entière (eux aussi entiers)\n * @author Gilles Mora (grâce au travail de Jean-Claude Lhote)\n * Référence (2F32-2)\n */\nexport default class BetaModeleSpline extends Exercice {\n constructor () {\n super()\n this.titre = titre\n this.sup = '4'\n this.nbQuestions = 1 // Nombre de questions par défaut\n }\n\n nouvelleVersion () {\n this.listeQuestions = [] // Liste de questions\n this.listeCorrections = [] // Liste de questions corrigées\n this.autoCorrection = []\n for (let i = 0; i < this.nbQuestions; i++) {\n const { coeffX, coeffY, deltaX, deltaY } = aleatoiriseCourbe()\n // the list of nodes of our function\n const nuage = choice(mesFonctions).map((noeud) => Object({\n x: (noeud.x + deltaX) * coeffX,\n y: (noeud.y + deltaY) * coeffY,\n deriveeGauche: noeud.deriveeGauche * coeffX * coeffY,\n deriveeDroit: noeud.deriveeDroit * coeffX * coeffY,\n isVisible: noeud.isVisible\n }))\n const maSpline = spline(nuage)\n const { xMin, xMax, yMin, yMax } = trouveMaxes(nuage)\n const o = texteParPosition('O', -0.3, -0.3, 'medium', 'black', 1)\n // the reference in which the curve will be drawn (it is important that xMin and yMin are integers hence the rounding during their definition above\n const repere1 = repere({\n xMin: xMin - 1,\n xMax: xMax + 1,\n yMin: yMin - 1,\n yMax: yMax + 1,\n grilleX: false,\n grilleY: false,\n grilleSecondaire: true,\n grilleSecondaireYDistance: 1,\n grilleSecondaireXDistance: 1,\n grilleSecondaireYMin: yMin - 1,\n grilleSecondaireYMax: yMax + 1,\n grilleSecondaireXMin: xMin - 1,\n grilleSecondaireXMax: xMax + 1\n })\n const courbe1 = maSpline.courbe({\n repere: repere1,\n epaisseur: 1.5,\n ajouteNoeuds: true,\n optionsNoeuds: { color: 'blue', taille: 1, style: '.', epaisseur: 2 },\n color: 'blue'\n })\n const objetsEnonce = [repere1, courbe1]\n let texteEnonce = `We give the representative curve of a function $f$ defined on the interval $[${maSpline.x[0]}\\\\,,\\\\,${maSpline.x[maSpline.n - 1]}]$. <br>`\n texteEnonce += 'Determine the extrema of the function and specify at what values they are reached.<br>'\n texteEnonce += mathalea2d(Object.assign({ scale: 0.7 }, fixeBordures(objetsEnonce)), objetsEnonce, o)\n if (this.interactif) {\n texteEnonce += '<br>The maximum of $f$ is:' + ajouteChampTexteMathLive(this, 4 * i, 'inline width10 nospacebefore')\n texteEnonce += '. It is reached at $x=$' + ajouteChampTexteMathLive(this, 4 * i + 1, 'inline width10 nospacebefore')\n texteEnonce += '<br>The minimum of $f$ is:' + ajouteChampTexteMathLive(this, 4 * i + 2, 'inline width10 nospacebefore')\n texteEnonce += '. It is reached at $x=$' + ajouteChampTexteMathLive(this, 4 * i + 3, 'inline width10 nospacebefore')\n }\n // we add the traces to identify the antecedents and we take advantage of this to make the other nodes invisible\n const solsMax = maSpline.solve(Math.max(...nuage.map(el => el.y)))\n const solsMin = maSpline.solve(Math.min(...nuage.map(el => el.y)))\n const solutionMax = solsMax.length === 1 ? solsMax[0] : 'We have a problem'\n const solutionMin = solsMin.length === 1 ? solsMin[0] : 'We have a problem'\n setReponse(this, 4 * i, Math.max(...nuage.map(el => el.y)))\n setReponse(this, 4 * i + 1, solutionMax)\n setReponse(this, 4 * i + 2, Math.min(...nuage.map(el => el.y)))\n setReponse(this, 4 * i + 3, solutionMin)\n\n const texteCorrection = `The highest point of the curve has coordinates $(${solutionMax}\\\\,,\\\\,${Math.max(...nuage.map(el => el.y))})$.<br>We deduce that the maximum of $f$ is $${Math.max(...nuage.map(el => el.y))}$. It is reached at $x=${solutionMax}$.<br>The lowest point of the curve has coordinates $(${solutionMin}\\\\,,\\\\,${Math.min(...nuage.map(el => el.y))})$.<br>We deduce that the minimum of $f $ is $${Math.min(...nuage.map(el => el.y))}$. It is reached at $x=${solutionMin}$. `\n this.listeQuestions.push(texteEnonce)\n this.listeCorrections.push(texteCorrection)\n }\n listeQuestionsToContenu(this) // On envoie l'exercice à la fonction de mise en page\n }\n}\n"],"names":["titre","interactifReady","interactifType","dateDePublication","uuid","ref","noeuds1","noeuds2","noeuds3","noeuds4","mesFonctions","trouveMaxes","nuage","xMin","el","yMin","xMax","yMax","aleatoiriseCourbe","coeffX","choice","coeffY","deltaX","randint","deltaY","BetaModeleSpline","Exercice","noeud","maSpline","spline","o","texteParPosition","repere1","repere","courbe1","objetsEnonce","texteEnonce","mathalea2d","fixeBordures","ajouteChampTexteMathLive","solsMax","solsMin","solutionMax","solutionMin","setReponse","texteCorrection","listeQuestionsToContenu"],"mappings":"6VAUY,MAACA,EAAQ,oCACRC,EAAkB,GAClBC,EAAiB,WAEjBC,EAAoB,aACpBC,EAAO,QACPC,GAAM,SAEbC,EAAU,CAAC,CAAE,EAAG,GAAI,EAAG,GAAI,cAAe,EAAG,aAAc,EAAG,UAAW,EAAM,EACnF,CAAE,EAAG,GAAI,EAAG,EAAG,cAAe,EAAG,aAAc,EAAG,UAAW,EAAO,EACpE,CAAE,EAAG,GAAI,EAAG,EAAG,cAAe,EAAG,aAAc,EAAG,UAAW,EAAO,EACpE,CAAE,EAAG,GAAI,EAAG,EAAG,cAAe,GAAI,aAAc,GAAI,UAAW,EAAO,EACtE,CAAE,EAAG,EAAG,EAAG,GAAI,cAAe,EAAG,aAAc,EAAG,UAAW,EAAO,EACpE,CAAE,EAAG,EAAG,EAAG,EAAG,cAAe,EAAG,aAAc,EAAG,UAAW,EAAO,EACnE,CAAE,EAAG,EAAG,EAAG,GAAI,cAAe,EAAG,aAAc,EAAG,UAAW,EAAO,EACpE,CAAE,EAAG,EAAG,EAAG,EAAG,cAAe,EAAG,aAAc,EAAG,UAAW,EAAM,CACpE,EAEMC,EAAU,CAAC,CAAE,EAAG,GAAI,EAAG,EAAG,cAAe,EAAG,aAAc,EAAG,UAAW,EAAM,EAClF,CAAE,EAAG,GAAI,EAAG,EAAG,cAAe,EAAG,aAAc,EAAG,UAAW,EAAO,EACpE,CAAE,EAAG,GAAI,EAAG,GAAI,cAAe,EAAG,aAAc,EA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