Dear All,
Seeing we are now in the area of digital implementations of functions without resorting to floats/doubles etc. This tiny function
draws a (not too bad) circle using the sin/cos recursion technique and only 12 bits. Here is the c version which is actually
used to draw circles for a tic-tac-toe app that runs on our favourite computer.
This is actually a quadrature signal generator.
int circle(ix,iy) // Draw circle at coord x,y
int ix,iy;
{
int re,im,tm,i;
re=0;
im=1000;
for (i=0;i<19;i++) {
dispxy(ix+re/20,iy+im/20);
tm=re+im/3;
im=im-tm/3;
re=tm;
}
}
More of a curiosity than something useful!
BW, Ian.