Download the source of T.B.N.I.C.C.U.W.!
http://www.vulkanware.de/stuff/256kS.zip

Take a look at bmaps.c, there you will find some functions for
different shapes. They may give you an idea.


no science involved