drawing circle without floating point calculation
Posted
by zaharpopov
on Stack Overflow
See other posts from Stack Overflow
or by zaharpopov
Published on 2010-05-31T03:35:49Z
Indexed on
2010/05/31
3:42 UTC
Read the original article
Hit count: 243
interview-questions
|geometry
This is common interview question (according to some interview sites) but I can find no normal answers in Internet - some are wrong and some point to complex theory I expect not looked for in interview (like Bressenham algorithm).
The question is simple:
The circle equation is: x^2 + y^2 = R^2. Given R, draw 0,0-centered circle as best as possible without using any floating point (no trigo, square roots, and so on, only integers)
© Stack Overflow or respective owner