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.


get "libhdr"
 
let circle(x, y, c, r) = (r*r) >= (x/2) * (x/2) + (y-c) * (y-c)
 
let pixel(x, y, r) = 
    circle(x, y, -r/2, r/6) -> '#',
    circle(x, y, r/2, r/6)  -> '.',
    circle(x, y, -r/2, r/2) -> '.',
    circle(x, y, r/2, r/2)  -> '#',
    circle(x, y, 0, r)      -> x<0 -> '.', '#',
    ' '
 
let yinyang(r) be
    for y = -r to r
    $(  for x = -2*r to 2*r do
            wrch(pixel(x,y,r))
        wrch('*N')
    $)
 
let start() be 
$(  yinyang(4)
    yinyang(8)
$) 