import geometry; size(9cm, 0); defaultpen(fontsize(10pt)); dotfactor = 4; point A,B,C,D,M,Np,K,L,F,A1,B1,M1; D=(0,0); A= 4*dir(65); B= 5.5*dir(30); C=6*dir(0); M= point(A--B, 1/5); Np= point(C--D, 1/3); line DC = line(D,C); //line a = perpendicular(A, DC); line m = perpendicular(M, DC); line b = perpendicular(B, DC); K=intersectionpoint(line(D,M),line(A,Np)); L=intersectionpoint(line(C,M),line(B,Np)); //A1=intersectionpoint(DC,a); A1=projection(D,C)*A; M1=intersectionpoint(DC,m); B1=intersectionpoint(DC,b); F=intersectionpoint(line(A1,B),line(M,M1)); fill(A--K--D--cycle, blue+white); fill(B--L--C--cycle, blue+white); fill(K--M--L--Np--cycle, red); markrightangle(size=7, A, A1, D); markrightangle(size=7, M, M1, D); markrightangle(size=7, B, B1, D); draw(D--M^^M--C); draw(A--Np^^Np--B); draw(A1--B); draw(A--A1^^M--M1^^B--B1); draw(A--B--C--D--cycle); dot(A); label("$A$", A, N); dot(B); label("$B$", B, N); dot(C); label("$C$", C, S); dot(D); label("$D$", D, S); dot(M); label("$M$", M, N); dot(Np); label("$N$", Np, S); dot(K); label("$K$", K, 2*S); dot(L); label("$L$", L, 2*N+0.5*W); dot(F); label("$F$", F, WNW); dot(A1); label("$A_1$", A1, S); dot(B1); label("$B_1$", B1, S); dot(M1); label("$M_1$", M1, S);