File: /home/mmtprep/public_html/mathzen.mmtprep.com/assets/2F20-4-k9oe__RF.js
var qe=Object.defineProperty;var Ne=(h,x,g)=>x in h?qe(h,x,{enumerable:!0,configurable:!0,writable:!0,value:g}):h[x]=g;var te=(h,x,g)=>(Ne(h,typeof x!="symbol"?x+"":x,g),g);import{E as Fe}from"./ExerciceTs-rGc5ChsI.js";import{r as s,am as he,w as z,h as ke,m as H,bK as xe,s as be,c as De,C as ge,y as $e,R as Pe,o as Ae,aa as we,k as Re}from"./index-hc8lvKav.js";import{f as Te}from"./figureApigeom-jVe8_5s4.js";import{F as Be}from"./main-bGW4GB57.js";import{R as Se}from"./RepereBuilder-dqBfo4dX.js";import{c as Me}from"./courbes-HH5ni-HU.js";import{P as se}from"./Polynome-vTUwDBL0.js";import{i as N}from"./MatriceCarree-1qzwJiWf.js";import"./reperes-MjYMQS1W.js";const Je="Résoudre graphiquement une équation ou une inéquation",We="29/10/2023",Ze=!0,et="mathLive",tt="28997",st="2F20-4",nt="29/12/2023";function Ee(h,x){const g=l=>l.replace("{.}",".").replace(",","."),D=g(h).split(";").sort((l,C)=>Number(l)-Number(C)),$=g(x).split(";").sort((l,C)=>Number(l)-Number(C));if(D.length!==$.length)return!1;let m=!0;for(let l=0;l<D.length;l++)if(Math.abs(Number(D[l].replace(",","."))-Number($[l].replace(",",".")))>.1){m=!1;break}return m}function Le(h,x,g,D,$){const m=[D,...x,$],l=m.filter((i,a)=>i!==m[a+1]),C=[];for(let i=0;i<l.length-1;i++){const a=(l[i]+l[i+1])/2,n=h.image(a);(n<0&&g||!g&&n>0)&&C.push(`[${z(l[i],1)};${z(l[i+1],1)}]`)}return C.join("\\cup")}function Oe(h,x){let g=!0;const D=l=>l.replaceAll("{,}",".").replaceAll(",",".");h=D(h),x=D(x);const $=h.match(/\[-?\d.?\d?;-?\d.?\d?]/g),m=x.match(/\[-?\d.?\d?;-?\d.?\d?]/g);if(m!=null&&$!=null){for(let l=0;l<m.length;l++){const[C,i]=m[l].match(/-?\d\.?\d?/g),[a,n]=$[l].match(/-?\d\.?\d?/g);(Math.abs(Number(a)-Number(C))>.1||Math.abs(Number(n)-Number(i))>.1)&&(g=!1)}return g}}function Ge(h,x,g,D){const $=h.derivee(),m=x.derivee();let l,C;if($.deg===2){const[i,a,n]=$.monomes,u=a**2-4*n*i;if(u>0){const E=Math.sqrt(u),L=(-a-E)/(2*n),k=(-a+E)/(2*n);l=n>0?h.image(Math.max(L,k)):h.image(Math.min(L,k))}else l=0}else if($.deg===1){const[i,a]=$.monomes;a<0?l=0:l=h.image(-i/a)}else l=0;if(m.deg===2){const[i,a,n]=m.monomes,u=a**2-4*n*i;if(u>0){const E=Math.sqrt(u),L=(-a-E)/(2*n),k=(-a+E)/(2*n);C=n>0?x.image(Math.max(L,k)):x.image(Math.min(L,k))}else C=0}else if(m.deg===1){const[i,a]=m.monomes;a<0?C=0:C=x.image(-i/a)}else C=0;return Math.min(l,C,...g.map(i=>i.y),...D.map(i=>i.y))}function F(h){const x=h.fonction,g=h.monomes.slice();for(;g.length<4;)g.push(0);const D=g.reverse(),$=Re(...D.map(m=>Math.abs(m)<1e-10?0:m)).replaceAll("\\,","").replaceAll("{,}",".");return{func:x,expr:$,poly:h}}class ot extends Fe{constructor(){super();te(this,"figure");te(this,"idApigeom");this.nbQuestions=1,this.nbQuestionsModifiable=!1,this.formatChampTexte="largeur15 inline",this.exoCustomResultat=!0,this.answers={},this.sup2=10,this.sup=1,this.besoinFormulaireNumerique=["Choix des questions",3,`1 : Résoudre une équation
2 : Résoudre une inéquation
3: Résoudre une équation et une inéquation`],this.besoinFormulaire2Numerique=["Choix des deux fonctions",10,`Constante-affine
Constante-degré2
Constante-degré3
Affine-affine
Affine-degré2
Affine-degré3
Degré2-degré2
Degré2-degré3
Degré3-degré3
Mélange`]}nouvelleVersion(g){this.listeQuestions=[],this.listeCorrections=[""],this.autoCorrection=[];const D=s(1,15),$=he(D),m=he(s(1,20,D)),l=this.sup2<10?this.sup2:s(1,9);let C,i,a,n,u,E="";const L=s(-2,2),k=-4+L,Q=s(-2,-1)+L,K=s(1,2)+L,V=4+L,ne=s(0,2),p=k-ne-1,P=p+10;let T,oe=0;do{oe++;let o,d,q,B,w,U,fe;const ee=(e,t,f,y)=>Object.assign({},{u:f-e,v:y-t}),de=(e,t)=>Math.abs(e.u*t.v-e.v*t.u)<.1;if(this.sup2<7){do o=s(-2,2),d=s(-3,3,o);while(Math.abs((d-o)/(Q-k))>1);const e=(d-o)/(Q-k),t=d-e*Q;q=e*K+t,B=e*V+t}else do o=s(-2,2),d=s(-3,3,o),q=s(-4,4,d),B=s(-2,3,[o,q,d]),w=ee(k,o,Q,d),U=ee(k,o,K,q),fe=ee(k,o,V,B);while(de(w,U)||de(w,fe));const r=[{x:k,y:o},{x:Q,y:d},{x:K,y:q},{x:V,y:B}].sort((e,t)=>e.x-t.x),c=[{x:k,y:o},{x:Q,y:d},{x:K,y:q},{x:V,y:B}].sort((e,t)=>e.x-t.x);switch(l){case 1:{i="constante",a="affine";const e=s(0,1),t=s(0,3,e);n={func:()=>r[e].y,expr:`${r[e].y}`,poly:new se({rand:!1,deg:3,coeffs:[r[e].y,0,0,0]})};const f=r.filter((v,M)=>M===e||M===t),y=N(f);u=F(y)}break;case 2:{i="constante",a="poly2";const e=0,t=s(1,3);n={func:()=>r[e].y,expr:`${r[e].y}`,poly:new se({rand:!1,deg:3,coeffs:[r[e].y,0,0,0]})},c[t].y=r[0].y;const f=s(0,3,[e,t]);c[f].y=s(-5,5,[r[e].y,r[e].y-1,r[e].y+1]);const y=c.filter((M,R)=>R===e||R===t||R===f),v=N(y);u=F(v)}break;case 3:{i="constante",a="poly3";const e=s(0,1),t=s(1,3,e),f=s(1,3,[e,t]),y=s(0,3,[e,t,f]);n={func:()=>r[e].y,expr:`${r[e].y}`,poly:new se({rand:!1,deg:3,coeffs:[r[e].y,0,0,0]})};for(const M of[e,t,f])c[M].y=r[e].y;c[y].y=s(-5,5,[r[e].y,r[e].y-1,r[e].y+1]);const v=N(c);u=F(v)}break;case 4:i="affine",a="affine";{const e=s(0,3),t=s(0,2,e),f=s(0,2,[e,t]),y=r.filter((I,b)=>b===e||b===t);c[f].y=s(-4,4,[r[e].y,r[t].y]);const v=c.filter((I,b)=>b===e||b===f),M=N(y);n=F(M);const R=N(v);u=F(R)}break;case 5:i="affine",a="poly2";{const e=s(0,3),t=s(0,3,e),f=s(0,3,[e,t]),y=r.filter((I,b)=>b===e||b===t),v=N(y);n=F(v);for(const I of[e,f])c[I].y=n.func(c[I].x);c[t].y=s(-5,5,[r[t].y,c[0].y,c[1].y,c[2].y,c[3].y]);const M=c.filter((I,b)=>b===e||b===t||b===f),R=N(M);u=F(R)}break;case 6:{i="affine",a="poly3";const e=s(0,3),t=s(0,3,e),f=s(0,3,[e,t]),y=s(0,3,[e,t,f]),v=r.filter((I,b)=>b===e||b===t),M=N(v);n=F(M);for(const I of[e,t,f])c[I].y=n.func(c[I].x);c[y].y=s(-5,5,[r[y].y,c[0].y,c[1].y,c[2].y,c[3].y]);const R=N(c);u=F(R)}break;case 7:i="poly2",a="poly2";{const e=s(0,3),t=s(0,3,e),f=s(0,3,[e,t]),y=s(0,3,[e,f,f]),v=r.filter((b,_)=>_===e||_===t||_===f),M=c.filter((b,_)=>_===e||_===f||_===y),R=N(v);n=F(R);const I=N(M);u=F(I)}break;case 8:i="poly2",a="poly3";{const e=s(0,3),t=s(0,3,e),f=s(0,3,[e,t]),y=r.filter((R,I)=>I===e||I===f||I===t),v=N(y);n=F(v);const M=N(c);u=F(M)}break;case 9:i="poly3",a="poly3";{const e=N(r);n=F(e);const t=s(0,3),f=r.map(M=>M.y);let y;do y=(r[t].y>0?-1:1)*s(-4,4,f);while(Math.abs(y-r[t].y)>5);c[t].y=y;const v=N(c);u=F(v)}break;default:i="affine",a="affine";{const e=s(0,3),t=s(0,3,e),f=s(0,3,[e,t]),y=r.filter((I,b)=>b===e||b===t),v=c.filter((I,b)=>b===e||b===f),M=N(y);n=F(M);const R=N(v);u=F(R)}break}const pe=[],me=n.poly;if(me==null)throw Error("la fonction 1 n'a pas de polynôme alors qu'elle devrait");const ye=me.multiply(-1).add(u.poly);for(let e=0;e<10;e++)pe.push(Math.abs(ye.image(k+e)-ye.image(k-1+e)));C=Math.min(...pe),T=Math.min(Ge(n.poly,u.poly,r,c),-1)-.3}while(C<.2&&oe<50);const J=T+12,W=n.poly.add(u.poly.multiply(-1));this.figure=new Be({xMin:p-.2,yMin:T,width:312,height:378}),this.figure.options.automaticUserMessage=!1,this.figure.userMessage="Cliquer sur le point $M$ pour le déplacer.",this.figure.create("Grid"),this.figure.options.limitNumberOfElement.set("Point",1);let ie,S;if(i==="constante"||i==="affine"){const o=n.poly.monomes[1],d=n.poly.monomes[0],q=this.figure.create("Point",{x:p,y:p*o+d,isVisible:!1}),B=this.figure.create("Point",{x:P,y:P*o+d,isVisible:!1}),w=this.figure.create("Segment",{point1:q,point2:B});w.color="blue",w.thickness=2,w.isDashed=!0,S=this.figure.create("PointOnLine",{line:w}),S.shape="o",S.color="blue"}else ie=this.figure.create("Graph",{expression:n.expr,color:"blue",thickness:2,fillOpacity:.5,xMin:p,xMax:V+1.05-ne,isDashed:!0}),S=this.figure.create("PointOnGraph",{graph:ie}),S.shape="o",S.color="blue";S.label="M",S.createSegmentToAxeX(),S.createSegmentToAxeY();const Ce=this.figure.create("DynamicX",{point:S}),ve=this.figure.create("DynamicY",{point:S});Ce.dynamicText.maximumFractionDigits=1,ve.dynamicText.maximumFractionDigits=1;let A,G,Y=!1;for(A=p;A<P&&!Y;A++)Math.abs(n.poly.image(A))<J-1&&(G=n.poly.image(A),Y=!0);Y||(A=P,n.poly.image(P)<0?G=T+1:G=T+10);const re=A-.5,le=G+.5;if(a==="affine"){const o=u.poly.monomes[1],d=u.poly.monomes[0],q=this.figure.create("Point",{x:p,y:o*p+d,isVisible:!1}),B=this.figure.create("Point",{x:P,y:o*P+d,isVisible:!1}),w=this.figure.create("Segment",{point1:q,point2:B});w.color="red",w.thickness=2,w.isDashed=!1}else this.figure.create("Graph",{expression:u.expr,color:"red",thickness:2,fillOpacity:.5,xMin:p,xMax:P+.05});for(this.figure.create("TextByPosition",{x:re,y:le,text:`$\\mathscr{C_${$}}$`,color:"blue"}),Y=!1,A=P;A>p&&!Y;A--)Math.abs(u.poly.image(A))<5&&(Y=!0,G=u.poly.image(A));Y||(A=p,u.poly.image(p)<0?G=T+1:G=T+10);const ae=A+.5,ce=G+.5;this.figure.create("TextByPosition",{x:ae,y:ce,text:`$\\mathscr{C_${m}}$`,color:"red"}),this.idApigeom=`apigeomEx${g}F0`;let j=`On considère les fonctions $${$}$ et $${m}$ définies sur $[${z(p,0)};${z(P,0)}]$ et dont on a représenté ci-dessous leurs courbes respectives.<br><br>`,O;const Z=!!ke([!0,!1]);if(O=[],n.poly==null&&u.poly==null)throw Error("Un problème avec l'un des polynome");const ue=W.racines();if(ue==null)throw Error(`Il n'y aurait pas de points d'intersection !!! polyDiff = ${W.toLatex()}`);const X=ue.map(o=>Number(o.toFixed(1)));for(let o=0;o<X.length;o++){const d=n.func(X[o]),q=X[o]<=P&&X[o]>=p,B=d>T&&d<T+12;q&&B&&O.push(X[o])}if(O=Array.from(new Set(O)),O=O.sort((o,d)=>o-d),(this.sup===1||this.sup===3)&&(j+=`Résoudre graphiquement l'équation $${$}(x)${H("~=~","black")}${m}(x)$.<br>`,this.interactif&&(j+="Les solutions doivent être séparées par un point-virgule.<br>"),E+=`L'ensemble de solutions de l'équation correspond aux abscisses des points d'intersection des deux courbes soit : $\\{${O.map(o=>z(o,1)).join(";")}\\}$<br><br>`),O!=null&&(this.sup===1||this.sup===3)&&(this.interactif&&(j+="L'ensemble de solutions de l'équation est : "+xe(this,0,"\\{%{soluces}\\}","inline lycee","\\ldots\\ldots")+"<br><br>"),be(this,0,{soluces:{value:Array.from(O).join(";"),compare:Ee}},{formatInteractif:"fillInTheBlank"})),this.sup===2||this.sup===3){j+=`Résoudre graphiquement l'inéquation $${$}(x)${Z?H("\\leqslant","black"):H("~\\geqslant~","black")}${m}(x)$.<br>`,this.interactif&&(j+="On peut taper 'union' au clavier ou utiliser le clavier virtuel pour le signe $\\cup$.<br>",j+="L'ensemble des solutions de l'inéquation est : "+xe(this,1,"%{solucesIneq}","inline lycee","\\ldots\\ldots")+"<br><br>");const o=Le(W,O,!!Z,p,p+10);be(this,1,{solucesIneq:{value:o,compare:Oe}},{formatInteractif:"fillInTheBlank"}),E+=`<br>Pour trouver l'ensemble des solutions de l'inéquation, on regarde les portions où la courbe $${H("\\mathscr{C_"+$+"}","blue")}$ est située ${Z?"en-dessous":"au-dessus"} de la courbe $${H("\\mathscr{C_"+m+"}","red")}$.<br>`,E+=`On lit les intervalles correspondants sur l'axe des abscisses : $${o}$.<br><br>`}this.figure.setToolbar({tools:["DRAG"],position:"top"}),this.figure.ui&&this.figure.ui.send("DRAG");const Ie=Te({exercice:this,idApigeom:this.idApigeom,figure:this.figure});if(this.figure.isDynamic=!0,this.figure.divButtons.style.display="flex",De.isHtml)this.listeQuestions=[j+Ie];else{const o=new Se({xMin:p-.2,yMin:T-.2,xMax:P+.2,yMax:J+.2}).setGrille({grilleX:{dx:1,xMin:p,xMax:P},grilleY:{dy:1,yMin:T,yMax:J}}).setGrilleSecondaire({grilleX:{dx:.2,xMin:p,xMax:P},grilleY:{dy:.2,yMin:T,yMax:T+12}}).buildStandard();let d,q;i==="constante"||i==="affine"?d=ge(p,n.func(p),P,n.func(P),"blue"):d=Me(n.func,{repere:o,xMin:p,xMax:P,color:"blue"});const B=$e(`\\mathscr{C_${$}}`,re,le,"blue",0,0,"",8);d.color=Pe("blue"),d.epaisseur=2,a==="affine"?q=ge(p,u.func(p),P,u.func(P),"red"):q=Me(u.func,{repere:o,xMin:p,xMax:P,color:"red"});const w=$e(`\\mathscr{C_${m}}`,ae,ce,"red",0,0,"",8);q.color=Pe("red"),d.epaisseur=2;const U=[d,q,B,w];this.listeQuestions=[j+Ae(Object.assign({},we([...o.objets,...U])),...o.objets,...U)]}this.listeCorrections=[E]}}export{nt as dateDeCreation,We as dateDePublication,ot as default,Ze as interactifReady,et as interactifType,st as ref,Je as titre,tt as uuid};
//# sourceMappingURL=2F20-4-k9oe__RF.js.map