input geometrie2d;

beginfig(1);
    %% Figure de Vecten

    pair A,B,C,M[];
    B = (0,0);
    C = (4,0);
    A = (2.7,3);

    M1 = B + ((A-B) rotated 90);
    M2 = A + ((B-A) rotated -90);

    M3 = A + ((C-A) rotated 90);
    M4 = C + ((A-C) rotated -90);

    M5 = C + ((B-C) rotated 90);
    M6 = B + ((C-B) rotated -90);

    M7 = .5[A,M1];
    M8 = .5[C,M3];
    M9 = .5[B,M5];

    %% Le point de Vecten
    M10 = whatever [M7,C];
    M10 = whatever [M8,B];

    trace A--B--C--cycle 
	withpen pencircle scaled 2pt;

    remplis A--M2--M1--B--cycle 
	withcolor 0.9white;

    trace A--M2--M1--B--cycle 
	withpen pencircle scaled 1pt;
    remplis C--M4--M3--A--cycle 
	withcolor 0.9white;
    trace C--M4--M3--A--cycle 
	withpen pencircle scaled 1pt;
    remplis B--M6--M5--C--cycle 
	withcolor 0.9white;
    trace B--M6--M5--C--cycle 
	withpen pencircle scaled 1pt;

    trace M7--M8--M9--cycle 
	withpen pencircle scaled 1.5pt withcolor (1,.5,.5);
    trace M7--C 
	withcolor (1,.5,.5);
    trace M8--B 
	withcolor (1,.5,.5);
    trace M9--A 
	withcolor (1,.5,.5);

    trace M2--C 
	withcolor blue;
    trace M1--C 
	withcolor blue;
    trace M4--B 
	withcolor blue;
    trace M3--B 
	withcolor blue;
    trace M6--A 
	withcolor blue;
    trace M5--A 
	withcolor blue;

    pointe Point_(M7) 
	withpen pencircle scaled 2pt withcolor (1,.5,.5);
    pointe Point_(M8) 
	withpen pencircle scaled 2pt withcolor (1,.5,.5);
    pointe Point_(M9) 
	withpen pencircle scaled 2pt withcolor (1,.5,.5);
    pointe Point_(M10) 
	withpen pencircle scaled 2pt withcolor green;

    label.top (lTEX("A"),A scaled gU);
    label.llft(lTEX("B"),B scaled gU);
    label.lrt (lTEX("C"),C scaled gU);
endfig;
end
