{"id":10302,"date":"2025-09-22T10:02:37","date_gmt":"2025-09-22T08:02:37","guid":{"rendered":"https:\/\/spgoo.org\/?page_id=10302"},"modified":"2025-09-22T10:05:37","modified_gmt":"2025-09-22T08:05:37","slug":"is-lm","status":"publish","type":"page","link":"https:\/\/spgoo.org\/?page_id=10302","title":{"rendered":"IS-LM"},"content":{"rendered":"<link rel=\"stylesheet\" href=\"https:\/\/cdn.jsdelivr.net\/npm\/jsxgraph\/distrib\/jsxgraph.css\" \/>\r\n<script src=\"https:\/\/cdn.jsdelivr.net\/npm\/jsxgraph@1.11.1\/distrib\/jsxgraphcore.js\"><\/script>\r\n\r\n<script>\r\nwindow.MathJax = {\r\n  tex: {\r\n    inlineMath: [ ['$','$'], [\"\\\\(\",\"\\\\)\"] ],\r\n    displayMath: [ ['$$','$$'], [\"\\\\[\",\"\\\\]\"] ],\r\n    packages: ['base', 'ams']\r\n  },\r\n  options: {\r\n    ignoreHtmlClass: 'tex2jax_ignore',\r\n    processHtmlClass: 'tex2jax_process'\r\n  }\r\n}; \r\n<\/script>\r\n<script src=\"https:\/\/cdn.jsdelivr.net\/npm\/mathjax@3\/es5\/tex-svg.js\"><\/script>\r\n\r\n<style>\r\n\t.boards-container {\r\n\t\tdisplay: flex;\r\n\t\tgap: 20px;\r\n\t\tjustify-content: center;\r\n\t\tflex-wrap: wrap;\r\n\t}\r\n\r\n\t.jxgbox {\r\n\t\twidth: 45%;\r\n\t\theight: 520px;\r\n\t\tbackground: #fff;\r\n\t\tborder-radius: 10px;\r\n\t\tborder: 1px solid #ddd;\r\n\t}\r\n\r\n\t.hint {\r\n\t\tfont-size: 13px;\r\n\t\tcolor: #666;\r\n\t\tmargin-top: -8px;\r\n\t}\r\n\tspan { \r\n\t\tmargin:0px 0px 0px 80px;\r\n\t\tcolor:white;\r\n\t}\r\n\r\n\t.custom-input::placeholder {\r\n\t\tcolor: #AE181E;\r\n\t\topacity: 0.6;\r\n\t}\r\n\r\n\t.custom-input:focus {\r\n\t\tborder-bottom: 1px solid #AE181E;\r\n\t}\r\n<\/style>\r\n\r\n\r\n  <div class=\"boards-container\">\r\n    <div id=\"board1\" class=\"jxgbox\"><\/div>\r\n    <div id=\"board2\" class=\"jxgbox\"><\/div>\r\n  <\/div>\r\n\t<span>$\\textrm{Cliquer une fois sur un carr\u00e9 jaune, la courbe se fige et vous pouvez la d\u00e9placer en conservant sa position initiale.}$<\/span>\r\n\t<br\/>\r\n\t<span>$\\textrm{Cliquer une deuxi\u00e8me fois sur un carr\u00e9 jaune, la courbe en pointill\u00e9s dispara\u00eet.}$<\/span>\r\n\t<br\/>\r\n\t<span>$\\textrm{Cliquer sur les deux  carr\u00e9s jaunes, pour obtenir l&#8217;effet des variations des param\u00e8tres.}$<\/span>\r\n\r\n  <script>\r\n\/\/ Board 1\r\nconst b1 = JXG.JSXGraph.initBoard('board1',{boundingbox:[-2,2000,10,-100],keepaspectratio:false,axis:true,grid:false,showNavigation:false,showCopyright:false,\r\n});\r\n\r\nb1.renderer.container.style.backgroundColor='gainsboro';\r\nJXG.Options.text.useMathJax = true;\r\n\t\t \r\n\/\/ Board 2\r\nconst b2 = JXG.JSXGraph.initBoard('board2',{boundingbox:[-5,5,5,-7.0],showInfoBox:false,keepaspectratio:true,axis:false,showNavigation:false,showCopyright:false});\r\nb2.renderer.container.style.backgroundColor='gainsboro';\r\n\r\nconst title = b2.create('text',[0,4.5,'\\\\(\\\\textrm{Mod\u00e8le IS-LM}\\\\)'],{fixed:true,highlight:false,color:\"#AE181E\",anchorX:'middle',anchorY:'middle',fontSize:20});\r\nconst subtitle0 = b2.create('text',[-5,3.8,'\\\\(\\\\textrm{March\u00e9 des Biens et Services}\\\\)'],{fixed:true,highlight:false,color:\"#AE181E\",anchorX:'middle',anchorY:'middle',fontSize:16});\r\nconst subtitle1 = b2.create('text',[5,3.8,'\\\\(\\\\textrm{March\u00e9 de la Monnaie}\\\\)'],{fixed:true,highlight:false,color:\"#AE181E\",anchorX:'middle',anchorY:'middle',fontSize:16});\r\n\r\n\/\/Consommation\r\nconst Consommation0 = b2.create('text',[-8.5,3,'\\\\(C(Y^d) =  c_1 Y^d  + c_0  = \\\\)'],{fixed:true,highlight:false,color:\"darkblue\",anchorX:'left',anchorY:'middle',fontSize:16,useMathJax:true});\r\nconst inc0 = b2.create('text',[-4.2,3.05,'<input id=\"inc0-input\" type=\"number\" placeholder=\"0.8\" value = \"0.8\" min=\"0.5\" max=\"0.9\" step=\"0.01\" class=\"custom-input\" style=\"width: 50px !important; padding: 0; margin: 0; background: transparent; border: none; color: #AE181E; font-family: \\'Latin Modern Roman\\', serif; font-size: 20px; text-align: center; outline: none; box-sizing: content-box;\">'],{strokeColor:'#AE181E',fixed:true,layer:10});\r\n\r\nconst Consommation1 = b2.create('text',[-3.3,3,'\\\\(Y^d + \\\\)'],{fixed:true,highlight:false,color:\"darkblue\",anchorX:'left',anchorY:'middle',fontSize:16,useMathJax:true});\r\nconst inc1 = b2.create('text',[-2.5,3.05,'<input id=\"inc1-input\" type=\"number\" placeholder=\"50\" value=\"50\" min=\"40\" max=\"70\" step=\"1\" class=\"custom-input\" style=\"width: 45px !important; padding: 0; margin: 0; background: transparent; border: none; color: #AE181E; font-family: \\'Latin Modern Roman\\', serif; font-size: 20px; text-align: center; outline: none; box-sizing: content-box;\">'],{strokeColor:'#AE181E',fixed:true,layer:10});\r\n\r\nconst revdis0 = b2.create('text',[-8.5,2,'\\\\(Y^d = Y - T + Tr \\\\)'],{fixed:true,highlight:false,color:\"darkblue\",anchorX:'left',anchorY:'middle',fontSize:16,useMathJax:true});\r\nconst Imp0 = b2.create('text',[-8.5,1,'\\\\(T =  t Y + T_0  = \\\\)'],{fixed:true,highlight:false,color:\"darkblue\",anchorX:'left',anchorY:'middle',fontSize:16,useMathJax:true});\r\nconst t0 = b2.create('text',[-5.5,1.05,'<input id=\"t0-input\" type=\"number\" placeholder=\"0.25\" value=\"0.25\" min=\"0\" max=\"0.35\" step=\"0.01\" class=\"custom-input\" style=\"width: 50px !important; padding: 0; margin: 0; background: transparent; border: none; color: #AE181E; font-family: \\'Latin Modern Roman\\', serif; font-size: 20px; text-align: center; outline: none; box-sizing: content-box;\">'],{strokeColor:'#AE181E',fixed:true,layer:10});\r\n\r\nconst Imp1 = b2.create('text',[-4.4,1,'\\\\(Y + \\\\)'],{fixed:true,highlight:false,color:\"darkblue\",anchorX:'left',anchorY:'middle',fontSize:16,useMathJax:true});\r\nconst T1 = b2.create('text',[-3.7,1.05,'<input id=\"T1-input\" type=\"number\" placeholder=\"100\" value=\"100\" min=\"0\" max=\"200\" step=\"010\" class=\"custom-input\" style=\"width: 45px !important; padding: 0; margin: 0; background: transparent; border: none; color: #AE181E; font-family: \\'Latin Modern Roman\\', serif; font-size: 20px; text-align: center; outline: none; box-sizing: content-box;\">'],{strokeColor:'#AE181E',fixed:true,layer:10});\r\n\r\nconst trans0 = b2.create('text',[-8.5,0,'\\\\(Tr =  s Y + S_0  = \\\\)'],{fixed:true,highlight:false,color:\"darkblue\",anchorX:'left',anchorY:'middle',fontSize:16,useMathJax:true});\r\nconst s0 = b2.create('text',[-5.3,0.05,'<input id=\"s0-input\" type=\"number\" placeholder=\"0.1\" value=\"0.1\" min=\"0\" max=\"0.2\" step=\"0.01\" class=\"custom-input\" style=\"width: 50px !important; padding: 0; margin: 0; background: transparent; border: none; color: #AE181E; font-family: \\'Latin Modern Roman\\', serif; font-size: 20px; text-align: center; outline: none; box-sizing: content-box;\">'],{strokeColor:'#AE181E',fixed:true,layer:10});\r\n\r\nconst trans1 = b2.create('text',[-4.4,0,'\\\\(Y + \\\\)'],{fixed:true,highlight:false,color:\"darkblue\",anchorX:'left',anchorY:'middle',fontSize:16,useMathJax:true});\r\nconst S1 = b2.create('text',[-3.6,0.05,'<input id=\"S1-input\" type=\"number\" placeholder=\"80\" value=\"80\" min=\"0\" max=\"200\" step=\"10\" class=\"custom-input\" style=\"width: 45px !important; padding: 0; margin: 0; background: transparent; border: none; color: #AE181E; font-family: \\'Latin Modern Roman\\', serif; font-size: 20px; text-align: center; outline: none; box-sizing: content-box;\">'],{strokeColor:'#AE181E',fixed:true,layer:10});\r\n\r\nconst Invest0 = b2.create('text',[-8.5,-1,'\\\\(I =  - k\\\\, i + I_0  = \\\\)'],{fixed:true,highlight:false,color:\"darkblue\",anchorX:'left',anchorY:'middle',fontSize:16,useMathJax:true});\r\nconst k = b2.create('text',[-5.4,-0.95,'<input id=\"k-input\" type=\"number\" placeholder=\"50\" value=\"50\" min=\"0\" max=\"80\" step=\"1\" class=\"custom-input\" style=\"width: 50px !important; padding: 0; margin: 0; background: transparent; border: none; color: #AE181E; font-family: \\'Latin Modern Roman\\', serif; font-size: 20px; text-align: center; outline: none; box-sizing: content-box;\">'],{strokeColor:'#AE181E',fixed:true,layer:10});\r\n\r\nconst Invest1 = b2.create('text',[-4.5,-1,'\\\\(i + \\\\)'],{fixed:true,highlight:false,color:\"darkblue\",anchorX:'left',anchorY:'middle',fontSize:16,useMathJax:true});\r\nconst I1 = b2.create('text',[-3.7,-0.95,'<input id=\"I1-input\" type=\"number\" placeholder=\"100\" value=\"100\" min=\"50\" max=\"500\" step=\"10\" class=\"custom-input\" style=\"width: 45px !important; padding: 0; margin: 0; background: transparent; border: none; color: #AE181E; font-family: \\'Latin Modern Roman\\', serif; font-size: 20px; text-align: center; outline: none; box-sizing: content-box;\">'],{strokeColor:'#AE181E',fixed:true,layer:10});\r\n\r\nconst deppub0 = b2.create('text',[-8.5,-2,'\\\\(G =   \\\\)'],{fixed:true,highlight:false,color:\"darkblue\",anchorX:'left',anchorY:'middle',fontSize:16,useMathJax:true});\r\nconst deppub1 = b2.create('text',[-7.6,-1.95,'<input id=\"deppub1-input\" type=\"number\" placeholder=\"300\" value=\"300\" min=\"200\" max=\"400\" step=\"1\" class=\"custom-input\" style=\"width: 50px !important; padding: 0; margin: 0; background: transparent; border: none; color: #AE181E; font-family: \\'Latin Modern Roman\\', serif; font-size: 20px; text-align: center; outline: none; box-sizing: content-box;\">'],{strokeColor:'#AE181E',fixed:true,layer:10});\r\n\r\nconst IS0 = b2.create('text',[-5,-5,'\\\\(i = \\\\frac{1-c_1\\\\left(1-t - s\\\\right)}{k} Y + \\\\frac{c_0 + c_ 1(S_0 - T_0) + I_0 + G}{k}  \\\\)'],{fixed:true,highlight:false,color:\"darkblue\",anchorX:'middle',anchorY:'middle',fontSize:16,useMathJax:true});\r\n\r\n\r\nconst p0 = b2.create('point',[0,4],{visible:false});\r\nconst p1 = b2.create('point',[0,-6],{visible:false});\r\nconst seg1 =  b2.create('segment',[p0,p1],{color:\"#AE181E\",strokeWidth:3,shadow:true});\r\nconst info0 =  b2.create('text',[0,-6.5,'\\\\(\\\\textrm{(Les nombres en rouge peuvent \u00eatre ajust\u00e9s en cliquant dessus)}\\\\)'],{color:\"navy\",fontSize:8,shadow:true,anchorX:'middle'});\r\n\r\n\/\/LM\r\nconst OM0 = b2.create('text',[0.5,2.5,'\\\\(\\\\frac{M^0}{p} = \\\\frac{M}{p} =   \\\\)'],{fixed:true,highlight:false,color:\"darkblue\",anchorX:'left',anchorY:'middle',fontSize:16,useMathJax:true});\r\nconst OM1 = b2.create('text',[2.8,2.6,'<input id=\"OM1-input\" type=\"number\" placeholder=\"200\" value=\"200\" min=\"100\" max=\"500\" step=\"1\" class=\"custom-input\" style=\"width: 50px !important; padding: 0; margin: 0; background: transparent; border: none; color: #AE181E; font-family: \\'Latin Modern Roman\\', serif; font-size: 20px; text-align: center; outline: none; box-sizing: content-box;\">'],{strokeColor:'#AE181E',fixed:true,layer:10});\r\n\r\nconst DM0 = b2.create('text',[0.5,1.5,'\\\\(\\\\frac{M^d}{p} = -l_2 i + l_1 Y + l_0  = \\\\)'],{fixed:true,highlight:false,color:\"darkblue\",anchorX:'left',anchorY:'middle',fontSize:16,useMathJax:true});\r\nconst DM1 = b2.create('text',[5.2,1.5,'<input id=\"DM1-input\" type=\"number\" placeholder=\"-100\" value = \"-100\" min=\"-150\" max=\"-50\" step=\"1\" class=\"custom-input\" style=\"width: 55px !important; padding: 0; margin: 0; background: transparent; border: none; color: #AE181E; font-family: \\'Latin Modern Roman\\', serif; font-size: 20px; text-align: center; outline: none; box-sizing: content-box;\">'],{strokeColor:'#AE181E',fixed:true,layer:10});\r\n\r\nconst DM2 = b2.create('text',[6.1,1.5,'\\\\(\\\\, i +  \\\\)'],{fixed:true,highlight:false,color:\"darkblue\",anchorX:'left',anchorY:'middle',fontSize:16,useMathJax:true});\r\nconst DM3 = b2.create('text',[6.5,1.5,'<input id=\"DM3-input\" type=\"number\" placeholder=\"0.5\" value=\"0.5\" min=\"0.3\" max=\"0.7\" step=\"0.01\" class=\"custom-input\" style=\"width: 55px !important; padding: 0; margin: 0; background: transparent; border: none; color: #AE181E; font-family: \\'Latin Modern Roman\\', serif; font-size: 20px; text-align: center; outline: none; box-sizing: content-box;\">'],{strokeColor:'#AE181E',fixed:true,layer:10});\r\n\r\nconst DM4 = b2.create('text',[7.4,1.5,'\\\\(\\\\, Y +  \\\\)'],{fixed:true,highlight:false,color:\"darkblue\",anchorX:'left',anchorY:'middle',fontSize:16,useMathJax:true});\r\nconst DM5 = b2.create('text',[7.9,1.5,'<input id=\"DM5-input\" type=\"number\" placeholder=\"0\" value=\"0\" min=\"0\" max=\"40\" step=\"1\" class=\"custom-input\" style=\"width: 55px !important; padding: 0; margin: 0; background: transparent; border: none; color: #AE181E; font-family: \\'Latin Modern Roman\\', serif; font-size: 20px; text-align: center; outline: none; box-sizing: content-box;\">'],{strokeColor:'#AE181E',fixed:true,layer:10});\r\n\r\nconst subtitle2 = b2.create('text',[-4.5,-3,'\\\\(\\\\textrm{Equilibre du March\u00e9 des Biens et Services (IS)}\\\\)'],{fixed:true,highlight:false,color:\"#AE181E\",anchorX:'middle',anchorY:'middle',fontSize:16});\r\nconst subtitle3 = b2.create('text',[5,0,'\\\\(\\\\textrm{Equilibre du March\u00e9 de la Monnaie (LM)}\\\\)'],{fixed:true,highlight:false,color:\"#AE181E\",anchorX:'middle',anchorY:'middle',fontSize:16});\r\n \r\nconst LM0 = b2.create('text',[3,-2,'\\\\(i = - \\\\left(\\\\frac{l_1}{l_2}\\\\right) \\\\, Y + \\\\left(\\\\frac{\\\\frac{M}{p}-l_0}{l_2} \\\\right) \\\\, = \\\\, \\\\)'],{fixed:true,highlight:false,color:\"darkblue\",anchorX:'middle',anchorY:'middle',fontSize:16,useMathJax:true});\r\n\r\n\/\/ Affichage des valeurs calcul\u00e9es\r\nconst varIS0 = b2.create('text', [-5.7, -6, '\\\\( = \\\\, \\\\)'],{fontSize:16,highlight:false,fixed:true,color:'darkblue',useMathJax: true});\r\nconst textPenteis = b2.create('text', [-5.3, -6, '\\\\(\\\\)'],{fontSize:16,highlight:false,fixed:true,color:'darkblue',useMathJax: true});\r\nconst varIS1 = b2.create('text', [-3.7, -6, '\\\\( i \\\\,+\\\\, \\\\)'],{fontSize:16,highlight:false,fixed:true,color:'darkblue',useMathJax: true});\r\nconst textOrdois = b2.create('text', [-2.9, -6, ''],{fontSize:16,highlight:false,fixed:true,color:'darkblue',useMathJax: true});\r\n\r\nconst textPentelm = b2.create('text', [5.6, -2, '\\\\( \\\\)'],{fontSize:16,highlight:false,fixed:true,color:'darkblue',useMathJax: true});\r\nconst varLM = b2.create('text', [7.1, -2, '\\\\( Y \\\\,\\\\, \\\\)'],{fontSize:16,highlight:false,fixed:true,color:'darkblue',useMathJax: true});\r\nconst textOrdolm = b2.create('text', [7.6, -2, ''],{fontSize:16,highlight:false,fixed:true,color:'darkblue',useMathJax: true});\r\n\r\n\r\nlet penteis=0;\r\nlet ordois=0;\r\nlet pentelm=0;\r\nlet ordolm=0;\r\n\r\nlet f=function(x) {return -penteis*x+ordois;};\r\nlet g=function(x) {return pentelm*x+ordolm;};\r\n\r\nfunction updateCalculations() {\r\n  \/\/ R\u00e9cup\u00e9ration des valeurs des inputs\r\n  const vinc0 = parseFloat(document.getElementById('inc0-input').value) || 0.8;\r\n  const vinc1 = parseFloat(document.getElementById('inc1-input').value) || 50;\r\n  const vt0   = parseFloat(document.getElementById('t0-input').value) || 0.25;\r\n  const vT1   = parseFloat(document.getElementById('T1-input').value) || 100;\r\n  const vs0   = parseFloat(document.getElementById('s0-input').value) || 0.1;\r\n  const vS1   = parseFloat(document.getElementById('S1-input').value) || 80;\r\n  const vk    = parseFloat(document.getElementById('k-input').value) || 50;\r\n  const vI1   = parseFloat(document.getElementById('I1-input').value) || 100;\r\n  const vdeppub1 = parseFloat(document.getElementById('deppub1-input').value) || 300;\r\n  const vOM1  = parseFloat(document.getElementById('OM1-input').value) || 200;\r\n  const vDM1  = parseFloat(document.getElementById('DM1-input').value) || -100; \r\n  const vDM3  = parseFloat(document.getElementById('DM3-input').value) || 0.5; \r\n  const vDM5  = parseFloat(document.getElementById('DM5-input').value) || 0;\r\n\r\n  \/\/ Calculs pour IS\r\n  let denominateuris = parseFloat(1 - vinc0 * (1 - vt0 - vs0));\r\n  let apenteis = parseFloat(vk \/ denominateuris);\r\n  let aordois  = parseFloat((vinc1 + vinc0 * (vS1 - vT1) + vI1 + vdeppub1) \/ denominateuris);\r\n  penteis = parseFloat(1 \/ apenteis);\r\n  ordois  = parseFloat(aordois \/ apenteis);\r\n\r\n  \/\/ Calculs pour LM\r\n  apentelm =  parseFloat(-vDM1 \/ vDM3);  \/\/ Corrig\u00e9: pas de signe moins ici car DM1 est d\u00e9j\u00e0 n\u00e9gatif\r\n  aordolm  =  parseFloat((vOM1 - vDM5) \/ vDM3);\/\/ Corrig\u00e9: soustraction pour l'ordonn\u00e9e\r\n  pentelm =   parseFloat(-vDM3 \/ vDM1);  \/\/ Corrig\u00e9: pas de signe moins ici car DM1 est d\u00e9j\u00e0 n\u00e9gatif\r\n ordolm  =   parseFloat(-aordolm*pentelm); \/\/ Corrig\u00e9: soustraction pour l'ordonn\u00e9e \r\n\r\n\r\n  \/\/ Mise \u00e0 jour de l'affichage\r\nconst texpis = `\\\\( ${penteis.toFixed(4)} \\\\)`;\r\ntextPenteis.setText(\"\\\\(\\\\)\");\r\ntextPenteis.setText(texpis);\r\nconst texois = `\\\\( ${ordois.toFixed(2)} \\\\)`;\r\ntextOrdois.setText(\"\\\\(\\\\)\");\r\ntextOrdois.setText(texois);\r\n\r\nconst texplm = `\\\\( ${pentelm.toFixed(4)} \\\\)`;\r\ntextPentelm.setText(\"\\\\(\\\\)\");\r\ntextPentelm.setText(texplm);\r\nconst texolm = `\\\\( ${ordolm.toFixed(2)} \\\\)`;\r\ntextOrdolm.setText(\"\\\\(\\\\)\");\r\ntextOrdolm.setText(texolm);\r\n  MathJax.typesetPromise();\r\n  \/\/ Mise \u00e0 jour MathJax\r\n  if (window.MathJax && typeof MathJax.typesetPromise === 'function') {\r\n    MathJax.typesetPromise([b2.renderer.container]).catch(function (err) {\r\n      console.warn('MathJax error:', err);\r\n    });\r\n  }\r\n  b1.setBoundingBox([-250,ordois*(1.2), (ordois\/penteis)*(1.2),-8]); \/\/ a mettre les valeurs calcul\u00e9es du nouveau boudingbox \r\n  b1.update();\r\n}\r\n\r\nlet IS = b1.create(\"functiongraph\",[f,0,1500],{higlight:false,color:'navy',shadow:true,strokeWidth:2,highlight:false});\r\nconst label0 = b1.create('text', [200,function(){return f(200)+0.5;},'\\\\(IS\\\\)'], \r\n\t\t\t\t{anchorX: 'middle',anchorY: 'middle',rotate:45,color:'navy'});\r\n\r\nlet LM =b1.create(\"functiongraph\",[g,0,1500],{higlight:false,color:'#AE181E',shadow:true,strokeWidth:2,highlight:false}); \r\nconst label1 = b1.create('text', [200,function(){return g(200)-0.5;},'\\\\(LM\\\\)'], \r\n\t\t\t\t{anchorX: 'middle',anchorY: 'middle',rotate:45, color:'#AE181E'});\r\n\r\nconst pc0 = b1.create('point',[0,function(){return f(0);}],{name:'',face:'square',color:'goldenrod',higlight:false,showInfobox:false});\r\nconst pc1 = b1.create('point',[0,function(){return g(0);}],{name:'',face:'square',color:'goldenrod',higlight:false,showInfobox:false});\r\n\r\n\/\/ --- Ajout toggle affichage des courbes en pointill\u00e9s (fig\u00e9es) ---\r\nlet dashedIS = null;\r\nlet dashedLM = null;\r\nlet interPrime = null; \/\/ Nouveau point E'\r\n\r\n\/\/ Toggle pour IS\r\npc0.on('hit', function() {\r\n    if (dashedIS) {\r\n        b1.removeObject(dashedIS);\r\n        dashedIS = null;\r\n    } else {\r\n        let penteNow = penteis;\r\n        let ordoNow = ordois;\r\n        let fDash = function(x){ return -penteNow*x + ordoNow; };\r\n        dashedIS = b1.create('functiongraph',[fDash,0,1500],\r\n            {strokeColor:'navy', dash:2, strokeWidth:2, fixed:true});\r\n    }\r\n    updateEprime();\r\n    b1.update();\r\n});\r\n\r\n\/\/ Toggle pour LM\r\npc1.on('hit', function() {\r\n    if (dashedLM) {\r\n        b1.removeObject(dashedLM);\r\n        dashedLM = null;\r\n    } else {\r\n        let penteNow = pentelm;\r\n        let ordoNow = ordolm;\r\n        let gDash = function(x){ return penteNow*x + ordoNow; };\r\n        dashedLM = b1.create('functiongraph',[gDash,0,1500],\r\n            {strokeColor:'#AE181E', dash:2, strokeWidth:2, fixed:true});\r\n    }\r\n    updateEprime();\r\n    b1.update();\r\n});\r\n\r\n\r\n\/\/ --- Labels des axes ---\r\nb1.create('text', [function(){return (ordois\/penteis)*(1.15)}, -0.5, '\\\\(Y\\\\)'], {\r\n    anchorX: 'middle', anchorY: 'top', fontSize: 16, color: 'black'\r\n});\r\nb1.create('text', [-50, function(){return ordois*1.15;}, '\\\\(i\\\\)'], {\r\n    anchorX: 'left', anchorY: 'middle', fontSize: 16, color: 'black'\r\n});\r\n\r\n\r\n\r\nconst inter0 = b1.create('intersection',[IS,LM],{name:'\\\\(E\\\\)',highlight:false,color:'forestgreen',label:{autoPosition: true, offset:[10, 0]}});\r\n\r\n\/\/-----\r\n\/\/ --- Textes pour afficher Delta Y et Delta i ---\r\nlet deltaYText = b1.create('text', [800, -6, ''], {\r\n    useMathJax: true, fixed: true, color: 'darkblue'\r\n});\r\nlet deltaIText = b1.create('text', [800, -6.5, ''], {\r\n    useMathJax: true, fixed: true, color: 'darkblue'\r\n});\r\n\r\nfunction updateDeltas() {\r\n    if (inter0 && interPrime) {\r\n        let dY = inter0.X() - interPrime.X();\r\n        let dI = inter0.Y() - interPrime.Y();\r\n        deltaYText.setText('\\\\( \\\\Delta Y = ' + dY.toFixed(2) + ' \\\\)');\r\n        deltaIText.setText('\\\\( \\\\Delta i = ' + dI.toFixed(2) + ' \\\\)');\r\n    } else {\r\n        deltaYText.setText('');\r\n        deltaIText.setText('');\r\n    }\r\n}\r\n\r\n\/\/ Ajouter dans updateEprime() pour recalculer \u00e0 chaque fois\r\nfunction updateEprime() {\r\n    if (interPrime) {\r\n        b1.removeObject(interPrime);\r\n        interPrime = null;\r\n    }\r\n    if (dashedIS && dashedLM) {\r\n        interPrime = b1.create('intersection', [dashedIS, dashedLM], {\r\n            name: '',\r\n            highlight: false,\r\n            color: 'green',\r\n            label: {autoPosition: true, offset:[10,0]}\r\n        });\r\n\t\tinterPrimet = b1.create('text', [dashedIs, dashedLM,'\\\\(E^\\\\prime\\\\)'], {\r\n            name: '',\r\n            highlight: false,\r\n            color: 'green',\r\n            label: {autoPosition: true, offset:[10,-10]}\r\n        });\r\n\t\t \r\n    }\r\n    updateDeltas(); \/\/ <--- ajout\u00e9 ici\r\n}\r\n\r\n\/\/ Et dans l\u2019update du board\r\nb1.on('update', function() {\r\n    updateDeltas();\r\n    \/*if (window.MathJax &#038;&#038; typeof MathJax.typesetPromise === 'function') {\r\n        MathJax.typesetPromise([b1.renderer.container]);\r\n    }*\/\r\n});\r\n\r\n\r\n\/\/-----\r\n\r\n\r\n\r\n\/\/ Ajouter les \u00e9couteurs d'\u00e9v\u00e9nements pour tous les inputs\r\nconst inputIds = ['inc0-input', 'inc1-input', 't0-input', 'T1-input', 's0-input', 'S1-input', 'k-input', 'I1-input', 'deppub1-input', 'OM1-input', 'DM1-input', 'DM3-input', 'DM5-input'];\r\n  \r\ninputIds.forEach(id => {\r\n    const input = document.getElementById(id);\r\n    if (input) {\r\n      input.addEventListener('input', updateCalculations);\r\n    }\r\n});\r\n\r\nupdateCalculations();\r\n\r\n\/\/ Attendre que le DOM soit compl\u00e8tement charg\u00e9\r\ndocument.addEventListener('DOMContentLoaded', function() {\r\n\tpa0 = b1.create('point',[function(){return inter0.X();},0],{name:'',visible:true,size:0,useMathJax:true});\r\n\tsa0 = b1.create('segment',[inter0,pa0],{highlight:false, dash:2});\r\n\tpa1 = b1.create('point',[0,function(){return inter0.Y();}],{name:'',visible:false});\r\n    ta0 = b1.create('text',[function(){return inter0.X()-100;},-1,function(){return'\\\\(Y^\\\\star = '+inter0.X().toFixed(2)+'\\\\)';}],\r\n\t\t\t\t\t{name:'',visible:true,useMathJax:true,anchorX:'left'});\r\n\tta1 = b1.create('text',[-120,function(){return inter0.Y();},function(){return'\\\\(i^\\\\star = '+inter0.Y().toFixed(2)+'\\\\)';}],\r\n\t\t\t\t\t{name:'',visible:true,useMathJax:true,anchorX:'middle', anchorY:'middle'});\t\r\n\tsa1 = b1.create('segment',[inter0,pa1],{highlight:false, dash:2});\r\n});\r\nb1.on('update', function() {\r\n    MathJax.typesetPromise(); \/\/ Re-renders MathJax expressions\r\n});\r\n<\/script>\r\n\r\n","protected":false},"excerpt":{"rendered":"","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-10302","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/spgoo.org\/index.php?rest_route=\/wp\/v2\/pages\/10302","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/spgoo.org\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/spgoo.org\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/spgoo.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/spgoo.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=10302"}],"version-history":[{"count":1,"href":"https:\/\/spgoo.org\/index.php?rest_route=\/wp\/v2\/pages\/10302\/revisions"}],"predecessor-version":[{"id":10303,"href":"https:\/\/spgoo.org\/index.php?rest_route=\/wp\/v2\/pages\/10302\/revisions\/10303"}],"wp:attachment":[{"href":"https:\/\/spgoo.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=10302"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}