MetaPost code for PRC flag
def star(expr p, ang, r)=
pair a, b, c, d, z;
pair za, ab, bc, cd, dz;
z=(r*(0, 1) rotated ang)shifted p;
a=(r*(sind(72),cosd(72)) rotated ang) shifted p;
b=(r*(sind(36),- cosd(36)) rotated ang)shifted p;
c=(r*(- sind(36),- cosd(36)) rotated ang)shifted p;
d=(r*(- sind(72),cosd(72)) rotated ang)shifted p;
za = whatever[a, d] = whatever[z,b];
ab = whatever[a, c] = whatever[z,b];
bc = whatever[a, c] = whatever[b, d];
cd = whatever[c, z] = whatever[d,b];
dz = whatever[a, d] = whatever[z,c];
fill z--za--a--ab--b--bc--c
--cd--d--dz--cycle withcolor red+green;
enddef;
u=1.5cm;
fill (0, 2u)--(6u, 2u)--(6u, -2u)--(0, -2u)--cycle withcolor red;
t1=120.9637565;
t2=98.1301235;
t3=74.05460410;
t4=51.34019175;
star((u,u), 0, 6u/10);
star((2u,8u/5), t1, u/5);
star((12u/5,6u/5), t2, u/5);
star((12u/5,3u/5), t3, u/5);
star((2u,u/5), t4, u/5);
阅读(1313 次)

Leave a Reply