![]() |
VOOZH | about |
A closed plane figure, which is formed by the set of all those points which are equidistant from a fixed point in the same plane, is called a Circle. Now we will draw a circle of a given radius R. To draw a circle below are the points or procedures to remember.
Example 1:
Output:
Explanation:
In the above, we are drawing the circle of radius 2, and after that, we are creating a vector theta and we are dividing 200 parts between 0 and 2*pi we store these parts into vectors after that generate x-coordinates and y-coordinates and simply plot the points through joining these points a circle will be drawn.
For taking input from the user we use the input() command. In the Below example, we will take input from the user and then we will draw a circle.
Example 2:
Output:
Enter the radius of the circle: 4.3
Above we are drawing a circle of a given radius. We are creating a vector and divide 100 parts between 0 and 2*pi and we store these parts in the vector theta, after that generate x-coordinates and y-coordinates and simply plot the points. By joining these points a circle will be drawn.