%@Auteur:Thomas Rey
prologues := 2;

input geometriesyr16;

figure(-u,-u,6.5u,6u);
pair A,B,C,D,E,F,G,H,I,J,K;

trace 2coinbg--2coinbd--2coinhd--2coinhg--cycle;

H=(0,0);
G=(4u,-.5u);
F=(5.5u,u);
E-F=H-G;
D=(0,4u);
C-G=D-H;
B-F=C-G;
A-E=B-F;

trace D--A--B--C--D--H--G--F--B;
trace C--G;
trace A--E--F dashed evenly;
trace E--H dashed evenly;
nomme.top(A);
nomme.top(B);
nomme.rt(C);
nomme.lft(D);
nomme.lft(E);
nomme.rt(F);
nomme.bot(G);
nomme.bot(H);

fin;

%%%%%%%%%%%%%%%%%%%%
%12
u:=1cm;
figure(-u,-u,6.5u,6u);
pair M,N,P;
picture depart;

trace 2coinbg--2coinbd--2coinhd--2coinhg--cycle;

M-A=(5/8)*(D-A);
N-C=(4/8)*(D-C);
P-H=(5/8)*(D-H);

depart=image(
trace N--M--A--B--C--N--P--H--G--F--B;
trace C--G;
trace M--P;
trace A--E--F dashed evenly;
trace E--H dashed evenly;
nomme.top(A);
nomme.top(B);
nomme.rt(C);
nomme.lft(E);
nomme.rt(F);
nomme.bot(G);
nomme.bot(H);
nomme.lft(M);
nomme.urt(N);
nomme.lft(P);
);% fin de image
trace depart;

fin;

%%%%%%%%%%%%%%%%%%%%
%13
u:=1cm;
figure(-u,-u,6.5u,6u);
pair I,J;

trace 2coinbg--2coinbd--2coinhd--2coinhg--cycle;

trace depart;

%I = intersection plan cherché et (AM) :
I-A=whatever*(A-M);
I-C=whatever*(M-N);
% J = intersection plan et (PH) :
J-H=whatever*(P-H);
J-I=whatever*(M-P);

trace M--N withcolor red withpen pencircle scaled 1bp;
trace C--I withcolor red withpen pencircle scaled 1bp;
nomme.lft(I);

fin;

%%%%%%%%%%%%%%%%%%%%
%14
u:=1cm;
figure(-u,-u,6.5u,6u);

trace 2coinbg--2coinbd--2coinhd--2coinhg--cycle;

trace depart;
trace C--I withcolor red withpen pencircle scaled 1bp;
trace M--P withcolor red withpen pencircle scaled 1bp;
trace I--J dashed evenly withcolor red withpen pencircle scaled 1bp;
nomme.lft(I);
nomme.lft(J);

fin;

%%%%%%%%%%%%%%%%%%%%
%15
u:=1cm;
figure(-u,-u,6.5u,6u);

trace 2coinbg--2coinbd--2coinhd--2coinhg--cycle;

trace depart;
trace C--I withcolor red withpen pencircle scaled 1bp;
trace I--J dashed evenly withcolor red withpen pencircle scaled 1bp;
trace P--N withcolor red withpen pencircle scaled 1bp;
trace J--C withcolor red withpen pencircle scaled 1bp;
nomme.lft(I);
nomme.lft(J);
fin;

%%%%%%%%%%%%%%%%%%%%
%16
u:=1cm;
figure(-u,-u,6.5u,6u);

trace 2coinbg--2coinbd--2coinhd--2coinhg--cycle;

trace depart;
trace C--I withcolor red withpen pencircle scaled 1bp;
trace I--J dashed evenly withcolor red withpen pencircle scaled 1bp;
trace P--N withcolor red withpen pencircle scaled 1bp;
trace J--C withcolor red withpen pencircle scaled 1bp;
nomme.lft(I);
nomme.lft(J);
fillcolor:=.5*red+.5*white;
transparence(C--I--J--cycle);

fin;

%%%%%%%%%%%%%%%%%%%%
%17
u:=1cm;
figure(-u,-u,6.5u,6u);

trace 2coinbg--2coinbd--2coinhd--2coinhg--cycle;

trace I--A--B--C--G--F--B;
trace G--H--J;
trace A--E--F dashed evenly;
trace E--H dashed evenly;
trace C--I--J--C withpen pencircle scaled 1bp withcolor red;
fillcolor:=red;
transparence(C--I--J--cycle);
nomme.top(A);
nomme.top(B);
nomme.rt(C);
nomme.lft(E);
nomme.rt(F);
nomme.bot(G);
nomme.bot(H);
nomme.lft(I);
nomme.lft(J);

fin;

end