> > ..... But what I really want is to plot circles > You should have said so originally. Bresenham's circle algorithm: I invented Bresenham's algorithm 25 years ago to solve a graphics plotting problem on a VDU. A year ago I found out that the method had a name and that Bresehnham had beaten me by 17 years ! :-) For interest, Bresenham is still alive and (apparently) well and replies to emails. I told him about a local student discovering his work for the first time in October last year. bresenhamj@exchange.winthrop.edu I think I used. He may appreciate knowing that people are still discovering his brilliant (albeit retrospectively obvious) concepts decades after the event for microprocessor use. It's well worth working out how the algorithm works. Can have application in other areas. Note that his original idea used addition only with no multiply/divide at all - which was very important with the computers of the day - as it is with PICs :-). Here's an excellent overview http://novalis.org/triz-talk-boston-pm/slide-16.html RM _______________ Andy said: > > x = 0 > y = radius > switch = 3 - 2*radius > > loop: > > plot (x,y): plot (x,-y): plot (-x,y): plot (-x,-y) > plot (y,x): plot (y,-x): plot (-y,x): plot (-y,-x) > > if switch < 0 then > switch = switch + 4 * x + 6 > else > switch = switch + 4 * (x - y) + 10 > y = y - 1 > > x = x + 1 > > if x <= y then goto loop > > end > -- http://www.piclist.com#nomail Going offline? Don't AutoReply us! email listserv@mitvma.mit.edu with SET PICList DIGEST in the body