BBS: Inland Empire Archive Date: 07-28-92 (12:56) Number: 107 From: BRIAN DESSENT Refer#: NONE To: SIMON KIRBY Recvd: NO Subj: Bresenham Line Algorithm Conf: (1) 80xxx
> BD> I also have source for an all-integer math circle drawing routine... > YES! I want it too! I have sort of made my own, except I can't > seem to make it work the proper dots per size etc.. THANKS! Okay, again, this isn't asm, so I apologize for being off topic, but maybe someone can translate this into ASM and post it :-) circle (int xc, yc, radius) ; center coordinates, radius int x, y, d x = 0 y = radius d = 2 * (1 - radius) while y > x plot dot at (xc + x, yc + y) ; I think there's only 4, but plot dot at (xc - x, yc + y) ; there may be 8 plotdot routines plot dot at (xc + x, yc - y) plot dot at (xc - x, yc - y) if d + y > 0 then y = y + 1 d = d - 2 * y + 1 endif if x > d then x = x + 1 d = d + 2 * x + 1 endif endwhile done --- FMail 0.90 * Origin: I'm not an actor, but I play one on TV. (1:3641/202)
Books at Amazon:
Back to BASIC: The History, Corruption, and Future of the Language
Hackers: Heroes of the Computer Revolution (including Tiny BASIC)
Go to: The Story of the Math Majors, Bridge Players, Engineers, Chess Wizards, Scientists and Iconoclasts who were the Hero Programmers of the Software Revolution
The Advent of the Algorithm: The Idea that Rules the World
Moths in the Machine: The Power and Perils of Programming
Mastering Visual Basic .NET