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.


 
{{SVG 580 580}
 {YY 145 145 300}
 {YY 270 195 50}
 {YY 270 345 50}
}
 
{def YY
 {lambda {:x :y :s}
  {{G :x :y :s}
    {CIRCLE 0.5 0.5 0.5 black 0 0}
    {{G 0.5 0 1} {HALF_CIRCLE}}
    {CIRCLE 0.5 0.25 0.25 black 0 0}
    {CIRCLE 0.5 0.75 0.25 white 0 0}
    {CIRCLE 0.5 0.25 0.1 white 0 0}
    {CIRCLE 0.5 0.75 0.1 black 0 0}
    {CIRCLE 0.5 0.5 0.5 none gray 0.01} }}}
 
{def CIRCLE
 {lambda {:x :y :r :f :s :w}
  {circle {@ cx=":x" cy=":y" r=":r"
             fill=":f" stroke=":s" stroke-width=":w"}}}}
 
{def HALF_CIRCLE
  {path {@ d="M 0 0 A 0.5 0.5 0 0 0 0 1" fill="white"}}}
 
{def SVG
 {lambda {:w :h}
  svg {@ width=":w" height=":h"
         style="box-shadow:0 0 8px #888;"}}}
 
{def G
 {lambda {:x :y :s}
  g {@ transform="translate(:x,:y) scale(:s,:s)"}}}
 
Output: Sorry, I was unable to upload the following PNG picture (45kb). Need help.
 
http://lambdaway.free.fr/lambdawalks/data/lambdatalk_yinyang.png
 
 