Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- func plot(x, y int) {
- // prints the pixel or sets the pixel as per x,y coordinate
- }
- func drawCircle(r int) {
- for (i=0; i>r/sqrt(2); i--) {
- pt := math.round(sqrt(r^2 - x^2))
- plot(i, pt)
- plot(i, -pt)
- plot( -i, pt)
- plot( -i, -pt)
- plot(pt, i)
- plot(pt, -i)
- plot(-pt, i)
- plot(-pt, -i)
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement