HEX
Server: Apache
System: Linux vps.mmtprep.com 4.18.0-477.21.1.el8_8.x86_64 #1 SMP Thu Aug 10 13:51:50 EDT 2023 x86_64
User: mmtprep (1001)
PHP: 8.1.34
Disabled: exec,passthru,shell_exec,system
Upload Files
File: /home/mmtprep/public_html/mathzen.mmtprep.com/assets/betaExoLimite-W4WIoxpN.js.map
{"version":3,"file":"betaExoLimite-W4WIoxpN.js","sources":["../../src/exercices/beta/betaExoLimite.js"],"sourcesContent":["import { courbe } from '../../lib/2d/courbes.js'\nimport { repere } from '../../lib/2d/reperes.js'\nimport { choice, shuffle } from '../../lib/outils/arrayOutils'\nimport Exercice from '../Exercice.js'\nimport { mathalea2d } from '../../modules/2dGeneralites.js'\nimport { randint, listeQuestionsToContenu } from '../../modules/outils.js'\nexport const titre = 'Lecture graphique de limites'\n\n// Les exports suivants sont optionnels mais au moins la date de publication semble essentielle\nexport const dateDePublication = '01/02/2022' // La date de publication initiale au format 'jj/mm/aaaa' pour affichage temporaire d'un tag\nexport const dateDeModifImportante = '09/02/2022' // Une date de modification importante au format 'jj/mm/aaaa' pour affichage temporaire d'un tag\n\n/**\n * Description didactique de l'exercice\n * @author Mathieu Degrange\n * Référence\n*/\nexport default function NomExercice () {\n  Exercice.call(this) // Héritage de la classe Exercice()\n  this.nbQuestions = 3 // Nombre de questions par défaut\n  this.sup = false // x>2 au lieu de x->2+\n  this.sup2 = false // asymptotes\n\n  this.nouvelleVersion = function () {\n    this.listeQuestions = [] // Liste de questions\n    this.listeCorrections = [] // Liste de questions corrigées\n    this.autoCorrection = []\n\n    for (let i = 0, texte, texteCorr, cpt = 0; i < this.nbQuestions && cpt < 50;) { // Boucle principale où i+1 correspond au numéro de la question\n      const nom = ['f', 'g', 'h', 'p', 'q', 'r', 's'][i % 7]\n      texte = `Déterminer graphiquement les ${this.sup2 ? 'limites et asymtpotes' : 'limites'} de la fonction $${nom}$ dont la courbe représentative est tracée ci-dessous.<br>`\n      texteCorr = ''\n\n      // On détermine aléatoirement les abscisses avec une discontinuité\n      // Étape n°1 : On liste les possibilités\n      let x = [-5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5]\n      // Étape n°2 : On mélange les possibilités\n      x = shuffle(x)\n      // Étape n°3 : On choisi un nombre aléatoire de discontinuités\n      // Il pourra y avoir de 0 à 3 discontinuité sauf pour la première question où il y aura toujours au moins une discontinuité\n      x = x.slice(0, choice([i !== 0 ? 0 : 2, 1, 1, 2, 2, 3]))\n      // Étape n°4 : On tri les discontinuités dans l'ordre croissant\n      x = x.sort((a, b) => a - b) // Il faut passer une fonction de tri car par défaut javascript tri par code unicode donc -2 < -4\n\n      const id = x.slice() // identifiant de la question qui dépant des données aléatoires\n\n      const f = []\n      const monRepere = repere()\n\n      const limG = randint(-5, 5) // lim x->-oo\n      const limD = randint(-5, 5, [limG]) // lim x->+oo\n\n      if (x.length !== 0) {\n        // Calcul entre xmin et x[0]\n        {\n          const lim1 = limG // lim x->-oo\n          const lim2 = choice([-1, 1]) // lim x->x[0]- (-1 pour -oo, +1 pour +oo)\n          const g = t => lim1 + lim2 * 1 / (t - x[0])\n          f.push(courbe(g, { color: 'red', repere: monRepere, xMin: -10, xMax: x[0] - 0.5, yMin: -10, yMax: 10, step: 0.1 }))\n          f.push(courbe(g, { color: 'red', repere: monRepere, xMin: x[0] - 0.5, xMax: x[0] - 0.001, yMin: -10, yMax: 10, step: 0.001 }))\n          id.push(lim1, lim2)\n          texteCorr += `$\\\\displaystyle\\\\lim_{x \\\\to -\\\\infty} ${nom}(x) = ${lim1}$<br>`\n          texteCorr += `$\\\\displaystyle\\\\lim_{${xversreel(x[0], '-')}} ${nom}(x) = ${lim2 < 0 ? '+\\\\infty' : '-\\\\infty'}$<br>`\n        }\n\n        for (let k = 0; k < x.length - 1; k++) {\n          // Calcul entre chaque borne\n          const lim1 = choice([-1, 1]) // lim x->x[k]+ (-1 pour -oo, +1 pour +oo)\n          const lim2 = choice([-1, 1]) // lim x->x[k+1]- (-1 pour -oo, +1 pour +oo)\n          const c = randint(-3, 3)\n          const g = t => lim1 * 1 / (t - x[k]) + c + lim2 * 1 / (t - x[k + 1])\n          f.push(courbe(g, { color: 'red', repere: monRepere, xMin: x[k] + 0.001, xMax: x[k] + 0.5, yMin: -10, yMax: 10, step: 0.001 }))\n          f.push(courbe(g, { color: 'red', repere: monRepere, xMin: x[k] + 0.5, xMax: x[k + 1] - 0.5, yMin: -10, yMax: 10, step: 0.1 }))\n          f.push(courbe(g, { color: 'red', repere: monRepere, xMin: x[k + 1] - 0.5, xMax: x[k + 1] - 0.001, yMin: -10, yMax: 10, step: 0.001 }))\n          id.push(lim1, lim2 /*, c */)\n          texteCorr += `$\\\\displaystyle\\\\lim_{${xversreel(x[k], '+')}} ${nom}(x) = ${lim1 > 0 ? '+\\\\infty' : '-\\\\infty'}$<br>`\n          texteCorr += `$\\\\displaystyle\\\\lim_{${xversreel(x[k + 1], '-')}} ${nom}(x) = ${lim2 < 0 ? '+\\\\infty' : '-\\\\infty'}$<br>`\n        }\n\n        // Calcul entre x[n] et xmax\n        {\n          const lim1 = choice([-1, 1]) // lim x->x[n]+ (-1 pour -oo, +1 pour +oo)\n          const lim2 = limD // lim x->+oo\n          const g = t => lim1 * 1 / (t - x[x.length - 1]) + lim2\n          f.push(courbe(g, { color: 'red', repere: monRepere, xMin: x[x.length - 1] + 0.001, xMax: x[x.length - 1] + 0.5, yMin: -10, yMax: 10, step: 0.001 }))\n          f.push(courbe(g, { color: 'red', repere: monRepere, xMin: x[x.length - 1] + 0.5, xMax: 10, yMin: -10, yMax: 10, step: 0.1 }))\n          id.push(lim1, lim2)\n          texteCorr += `$\\\\displaystyle\\\\lim_{${xversreel(x[x.length - 1], '+')}} ${nom}(x) = ${lim1 > 0 ? '+\\\\infty' : '-\\\\infty'}$<br>`\n          texteCorr += `$\\\\displaystyle\\\\lim_{x \\\\to +\\\\infty} ${nom}(x) = ${lim2}$<br>`\n        }\n      } else {\n        // f(x) = ax^3 + bx² + cx + d\n        // f(-10) = l\n        // f(10) = L\n        // f'(-10) = 0\n        // f'(10) = 0\n        // f'(x) = 3ax^2 + 2bx + c\n        // f'(10) = 300a + 20b + c\n        // f'(-10) = 300a - 20b + c\n        // 300a + 20b = 300a - 20b donc b = 0\n        // 300a + c = 0 donc c = -300a\n        // f(10) = 1000a - 3000a + d = -2000a + d = l\n        // f(-10) = -1000a + 3000a + d = 2000a + d = L\n        // d=(l+L)/2\n        // a = (L-l)/4000\n        // c = -3/40*(L-l)\n\n        const a = (limG - limD) / 4000\n        const c = -3 / 40 * (limG - limD)\n        const d = (limG + limD) / 2\n        const g = t => a * t * t * t + c * t + d\n        f.push(courbe(g, { color: 'red', repere: monRepere, xMin: -10, xMax: 10, yMin: -10, yMax: 10, step: 0.1 }))\n        id.push('∅', limG, limD)\n        texteCorr += `$\\\\displaystyle\\\\lim_{x \\\\to -\\\\infty} ${nom}(x) = ${limG}$<br>`\n        texteCorr += `$\\\\displaystyle\\\\lim_{x \\\\to +\\\\infty} ${nom}(x) = ${limD}$<br>`\n      }\n\n      if (this.sup2) {\n        texteCorr += `La courbe admet les asymptotes horizontales d'équations $y=${limG}$ et $y=${limD}$.<br>`\n        switch (x.length) {\n          case 0 :\n            break\n          case 1 :\n            texteCorr += `La courbe admet une asymptote verticale d'équation $x=${x[0]}$.<br>`\n            break\n          default :\n            texteCorr += `La courbe admet les asymptotes verticales d'équations ${x.map((k, i) => (i === x.length - 1 ? ' et ' : ', ') + '$x=' + k + '$ ').join('').substring(2)}.<br>`\n        }\n      }\n\n      texte += mathalea2d({ xmin: -10, ymin: -10, xmax: 10, ymax: 10, scale: 0.5 }, monRepere, ...f)\n\n      // Si la question n'a jamais été posée, on l'enregistre\n      if (this.questionJamaisPosee(i, id)) { // <- laisser le i et ajouter toutes les variables qui rendent les exercices différents (par exemple a, b, c et d)\n        // Ici, a est utilisée mais pas b, c et d, alors supprime ces trois derniers !\n        this.listeQuestions.push(texte)\n        this.listeCorrections.push(texteCorr)\n        i++\n      }\n      cpt++\n    }\n    listeQuestionsToContenu(this) // On envoie l'exercice à la fonction de mise en page\n  }\n  this.besoinFormulaireCaseACocher = ['Notation x>2 au lieu de 2+']\n\n  const xversreel = (x, sens) => {\n    let output = this.sup ? '\\\\substack{' : ''\n    output += `x \\\\to ${x}`\n    output += this.sup ? `\\\\\\\\x ${sens === '+' ? '>' : '<'} ${x}}` : `^${sens}`\n    return output\n  }\n\n  this.besoinFormulaire2CaseACocher = ['Question sur les asymptotes']\n}\n"],"names":["titre","dateDePublication","dateDeModifImportante","NomExercice","Exercice","i","texte","texteCorr","cpt","nom","x","shuffle","choice","a","b","id","f","monRepere","repere","limG","randint","limD","lim1","lim2","g","t","courbe","xversreel","k","c","d","mathalea2d","listeQuestionsToContenu","sens","output"],"mappings":"gKAMY,MAACA,EAAQ,+BAGRC,EAAoB,aACpBC,EAAwB,aAOtB,SAASC,GAAe,CACrCC,EAAS,KAAK,IAAI,EAClB,KAAK,YAAc,EACnB,KAAK,IAAM,GACX,KAAK,KAAO,GAEZ,KAAK,gBAAkB,UAAY,CACjC,KAAK,eAAiB,CAAE,EACxB,KAAK,iBAAmB,CAAE,EAC1B,KAAK,eAAiB,CAAE,EAExB,QAASC,EAAI,EAAGC,EAAOC,EAAWC,EAAM,EAAGH,EAAI,KAAK,aAAeG,EAAM,IAAK,CAC5E,MAAMC,EAAM,CAAC,IAAK,IAAK,IAAK,IAAK,IAAK,IAAK,GAAG,EAAEJ,EAAI,CAAC,EACrDC,EAAQ,gCAAgC,KAAK,KAAO,wBAA0B,SAAS,oBAAoBG,CAAG,6DAC9GF,EAAY,GAIZ,IAAIG,EAAI,CAAC,GAAI,GAAI,GAAI,GAAI,GAAI,EAAG,EAAG,EAAG,EAAG,EAAG,CAAC,EAE7CA,EAAIC,EAAQD,CAAC,EAGbA,EAAIA,EAAE,MAAM,EAAGE,EAAO,CAACP,IAAM,EAAI,EAAI,EAAG,EAAG,EAAG,EAAG,EAAG,CAAC,CAAC,CAAC,EAEvDK,EAAIA,EAA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