summaryrefslogtreecommitdiff
path: root/info/drawing-with-metapost/src/mediation-sallows.mp
blob: 6814522e77634a9ae4fbeac495e39a2c860f0c1a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
\documentclass{standalone}
\usepackage{luamplib}
\begin{document}
\begin{mplibcode}
beginfig(3);
path t;  t = (0,0) -- (220,42) -- (180,-90) -- cycle;
pair centroid;
centroid = 2/3[point 0 of t,point 3/2 of t];

path s[];
for i=0 upto 5:
  s[i] = point 1/2 i of t -- point 1/2 + 1/2 i of t -- centroid -- cycle;
endfor

color c[];
c[0] = (1,0.96863,0.73725);
c[1] = (0.99608,0.76863,0.3098);
c[2] = (0.85098,0.37255,0.054902);

picture a,b;
a = image(
for i=0 upto 2:
  fill s[2i]   withcolor .6[c[i],white]; 
  fill s[2i+1] withcolor .4[c[i],white];
endfor
for i=0 upto 2:
draw point i of t -- point 3/2+i of t;
endfor
draw t;);
b = image(
for i=0 upto 2:
  fill s[2i]   withcolor .6[c[i],white]; 
  fill s[2i+1] rotatedabout(point i+1/2 of t, 180) withcolor .4[c[i],white];
endfor
for i=0 upto 2:
  draw point i of t -- centroid -- centroid rotatedabout(point i+1/2 of t,180) -- cycle;
endfor
draw t;);
draw a;
draw b shifted 222 right;
endfig;
\end{mplibcode}
\end{document}