exemple.mp [ source brut ]
verbatimtex %&latex \documentclass{article} \usepackage{mathrsfs} \begin{document} etex input geometriesyr16; vardef ProjectionsurDroite(expr aa,bb,cc)=%de aa sur (bbcc) save vc; color vd; numeric vc,vcc; vc=Module(Normal(bb,aa,cc))/Module(cc-bb); vcc=Module(bb-aa); vd=bb+sqrt(vcc**2-vc**2)*(cc-bb); vd enddef;
figureespace(-10u,-10u,10u,10u); Initialisation(5,26,20,650); color E,F,G,J,I,K,A,B,C,S,R,T,O,Fp,F'; F=(1.25,0,0); E-F=(0,1.25,0); G-F=(-1.5,0,0); J=3/5[E,F]; I-J=G-F; K-J=(0,0,1); A=1/3[G,F]+(0.2,0,1); B-A=E-F+(0.4,0,0); C=1/3[G,F]+B-A; S-A=1.5/5[G,F]-G; R-S=C-B; T=IntersectionDroite(A,B,K,K+I-J)+S-A; O=0.55[C,B]; Fp=ProjectionsurPlan(O,I,J,K); F'=ProjectionsurDroite(O,A+T-S,A+T-S+C-B); path dhh; dhh=IntersectionPlanPlan(I,J,K,A,B,C); path dh; dh=droite(Fp,I+Fp-J); %tracé fillcolor:=0.75[orange,blanc]; transparence polygone(A+T-S,A,A+C-B,A+T-S+C-B); fillcolor:=0.75[jaune,blanc]; transparence polygone(I,J,K,K+I-J); fillcolor:=0.75[orange,blanc]; transparence polygone(A+T-S,B,C,A+T-S+C-B); trace segment(O,Fp); trace dhh cutbefore droite(K,K+I-J) cutafter droite(I,J) withcolor gris; trace dh cutbefore droite(K,J) cutafter dhh; trace dh cutbefore dhh cutafter droite(K+I-J,I) dashed evenly; trace segment(O,F') dashed evenly; %plan (RST)->ok trace chemin(T,S,R,R+T-S) cutafter segment(K,J); trace chemin(T,S,R,R+T-S) cutbefore segment(K,J) dashed evenly; trace segment(T,T+R-S) withcolor gris; %plan (EFG) trace chemin(E,F,G) cutafter droite(K,J); trace chemin(F,G,G+E-F) cutbefore droite(K,J) cutafter droite(B,C) dashed evenly; trace chemin(G,G+E-F,E) cutbefore droite(B,C); %Plan (IJK)->ok trace segment(J,I) cutbefore droite(C,C+A-B) dashed evenly; trace segment(J,I) cutafter droite(C,C+A-B); trace chemin(J,K,K+I-J,I) cutafter droite(A,B); trace chemin(J,K,K+I-J,I) cutbefore droite(A,B) dashed evenly; %Plan (ABC)->ok trace segment(C,C+A-B) cutbefore droite(I,J) dashed evenly; trace segment(C,C+A-B) cutafter droite(I,J); trace chemin(C,B,A,A+C-B) cutafter droite(T,S); trace chemin(C,B,A,A+C-B) cutbefore droite(T,S) dashed evenly; %sucre :) trace appelation(J,1/3[J,I],2mm,btex \small Tableau etex); trace codeperp(O,Fp,0.55[J,K],8); trace codeperp(O,F',A+T-S,8); label.rt(btex $O$ etex,Projette(O)); dotlabel.ulft(btex $F'$ etex,Projette(F')); dotlabel.ulft(btex $F_p$ etex,Projette(Fp)); labeloffset:=labeloffset*2; label.lrt(btex $\mathscr{P'}$ etex,Projette(A)); label.lrt(btex $\mathscr{P}$ etex,Projette(S)); labeloffset:=labeloffset/2; label.rt(btex $(h')$ etex,Projette(iso(A+T-S,F'))); trace appelation(F',O,2mm, btex $d'$ etex); trace appelation(Fp,O,-2mm,btex $d$ etex); trace appelation(1.4[Fp+I-J,Fp],Fp,2mm,btex $(h)$ etex); finespace; end