User:Ato/Turkish flag metapost source

From Wikipedia, the free encyclopedia

The Metapost source file used in creating Turkish flag image. I am the author and I release this under terms of GPL version 2 as published by the Free Software Foundation. at0 06:14, 30 Jan 2005 (UTC)

verbatimtex 
%&latex 
\documentclass{article} 
\usepackage{mflogo}
\begin{document} 
etex

beginfig(1);
u=12cm;

path tbn, uck, dcm, icm, ycm, yild;
%ust discember, alt discember
path udc, adc;
numeric n;
%ust kesisim, alt kesisim, yildiz cemberi merkez
pair uks, aks, ycmmer;
%yildizin uclari ve koseleri;
pair yiluc[], ykos[];


tbn=(0,0)--(3/2u,0)--(3/2u,1u)--(0,1u)--cycle;
uck=(0,0)--(1/30u,0)--(1/30u,1u)--(0,1u)--cycle;
dcm=fullcircle scaled 1/2u shifted (1/30u+1/2u,1/2u);
icm=fullcircle scaled 0.4u shifted (1/30u+1/2u+0.0625u,1/2u);
udc=subpath(0, arctime (arclength(dcm)/2) of dcm) of dcm;
adc=subpath(arctime (arclength(dcm)/2) of dcm, arctime arclength(dcm) of dcm) of dcm;
uks = udc intersectionpoint icm;
aks = adc intersectionpoint icm;
ycmmer = (uks+aks)/2+(1/8u,0);
ycm = fullcircle scaled 1/4u shifted ycmmer;
yiluc[1] = (uks+aks)/2;
yiluc[2] = ((yiluc[1] shifted -ycmmer) rotated (1*360/5)) shifted ycmmer;
yiluc[3] = ((yiluc[2] shifted -ycmmer) rotated (1*360/5)) shifted ycmmer;
yiluc[4] = ((yiluc[3] shifted -ycmmer) rotated (1*360/5)) shifted ycmmer;
yiluc[5] = ((yiluc[4] shifted -ycmmer) rotated (1*360/5)) shifted ycmmer;
ykos[1] = (yiluc[1]..yiluc[3]) intersectionpoint (yiluc[2]..yiluc[5]);
ykos[2] = (yiluc[2]..yiluc[4]) intersectionpoint (yiluc[3]..yiluc[1]);
ykos[3] = (yiluc[3]..yiluc[5]) intersectionpoint (yiluc[4]..yiluc[2]);
ykos[4] = (yiluc[4]..yiluc[1]) intersectionpoint (yiluc[5]..yiluc[3]);
ykos[5] = (yiluc[5]..yiluc[2]) intersectionpoint (yiluc[1]..yiluc[4]);
yild = yiluc[1]--ykos[1]--yiluc[2]--ykos[2]--yiluc[3]--ykos[3]--yiluc[4]--ykos[4]--yiluc[5]--ykos[5]--cycle;

draw uck withcolor (0,0,0) withpen pencircle;
fill tbn withcolor (0.89,0.04,0.09);
fill uck withcolor (1,1,1);
fill dcm withcolor (1,1,1);
fill icm withcolor (0.89,0.04,0.09);
fill yild withcolor (1,1,1);

endfig;

end;