samcarter
In latex one can draw rubber ducks with the `tikzducks` package, but how would I draw a duck in metapost?
Top Answer
samcarter
This is my first time using metapost, so there are probably much better ways to draw duck, but here is my attempt:
```
outputtemplate:="duck.mps";
beginfig(1);
% head
fill fullcircle xscaled 50 yscaled 62.5 shifted (90, 150) withcolor (0.926,0.828,0.145);
% body
fill (70.6943,132.3527) .. controls (58.5353,130.2274) and (39.1604,108.2324) .. (59.6228,88.6598) .. controls (80.1344,69.0872) and (186.8462,82.1851) .. (135.1951,145.8956) .. controls (91.7006,122.5166) and (106.6274,143.9181) .. (70.6943,132.3527) -- cycle withcolor (0.926,0.828,0.145);
% right eye
fill fullcircle xscaled 8.93 yscaled 12.5 rotated -20 shifted (86.5, 154) withcolor white;
fill fullcircle xscaled 3.57 yscaled 7.14 rotated -20 shifted (87.4, 153.5) withcolor black;
% left eye
fill fullcircle xscaled 7.86 yscaled 11.43 rotated -20 shifted (72, 158) withcolor white;
fill fullcircle xscaled 2.86 yscaled 6.43 rotated -20 shifted (73.2, 157.3) withcolor black;
% bill
fill (65.5831,149.7120) .. controls (77.3470,152.5909) and (72.2838,141.3230) .. (90.6000,144.6488) .. controls (49.5497,118.8379) and (58.7824,144.5995) .. (65.5831,149.7120) -- cycle withcolor (0.871,0.5,0.125);
endfig;
end
```
![document.png](/image?hash=020f64c1252c881536a44af0e99c9fd7f8b84344884b43d2160f862b5157462a)