One well-known symbol of the philosophy of duality known as yin and yang is the taijitu.



Task

   Create a function that, given a parameter representing size, generates such a symbol scaled to the requested size.
   Generate and display the symbol for two different (small) sizes.


vardef yinyang(expr u) =
  picture pic_;
  path p_;
  p_ := halfcircle scaled 2u rotated -90 --
    halfcircle scaled u rotated 90 shifted (0, 1/2u) reflectedabout ((0,1), (0,-1)) --
    halfcircle scaled u rotated -270 shifted (0, -1/2u) -- cycle;
 
  pic_ := nullpicture;
  addto pic_ contour fullcircle scaled 2u withcolor black;
  addto pic_ contour p_ withcolor white;
  addto pic_ doublepath p_ withcolor black withpen pencircle scaled 0.5mm;
  addto pic_ contour fullcircle scaled 1/3u shifted (0, 1/2u) withcolor white;
  addto pic_ contour fullcircle scaled 1/3u shifted (0, -1/2u) withcolor black;
  pic_
enddef;
 
beginfig(1)
  % let's create a Yin Yang symbol with a radius of 5cm
  draw yinyang(5cm) shifted (5cm, 5cm);
  % and another one, radius 2.5cm, rotated 180 degrees and translated
  draw yinyang(2.5cm) rotated 180 shifted (11cm, 11cm);
endfig;
 
end.