Given a radius of a circle, draw the circle without using floating point arithmetic.
Following program uses a simple concept. Let the radius of the circle be r. Consider a square of size (2r+1)*(2r+1) around the circle to be drawn. Now walk through every point inside the square. For every every point (x,y), if (x, y) lies inside the circle (or x^2+ y^2 < r^2), then print it, otherwise print space.
Please write comments if you find anything incorrect, or you want to share more information about the topic discussed above
Attention reader! Don’t stop learning now. Get hold of all the important DSA concepts with the DSA Self Paced Course at a student-friendly price and become industry ready.
- sizeof() for Floating Constant in C
- Time-Space Trade-Off in Algorithms
- Advantages and Disadvantages of Array in C
- Tips to Manage Docker Containers using CLI
- Find a pair in Array with second largest product
- PyQt5 - How to automate Progress Bar while downloading using urllib?
- First element of every K sets having consecutive elements with exactly K prime factors less than N
- Sorting algorithm visualization : Insertion Sort
- Check if row-major order path of Matrix is palindrome or not
- Generate an array of given size with equal count and sum of odd and even numbers
- Dropbox - An Introduction
- Escape Sequences in Java
- Minimum number of blocks required to form Hollow Rectangular Prism
- Visibility Modes in C++ with Examples