Given the centre of circle (x1, y1) and its radius r, find the equation of the circle having centre (x1, y1) and having radius r.
Input : x1 = 2, y1 = -3, r = 8
Output : x^2 + y^2 – 4*x + 6*y = 51.
Input : x1 = 0, y1 = 0, r = 2
Output : x^2 + y^2 – 0*x + 0*y = 4.
Given the centre of circle (x1, y1) and its radius r, we have to find the equation of the circle having centre (x1, y1) and having radius r.
the equation of circle having centre (x1, y1) and having radius r is given by :-
on expanding above equation
on arranging above we get
Below is the implemetation of above approach:
# Python3 program to find the
# equation of circle.
# Function to find the
# equation of circle
def circle_equation(x1, y1, r):
a = -2 * x1;
b = -2 * y1;
c = (r * r) – (x1 * x1) – (y1 * y1);
# Printing result
print(“x^2 + (“, a, “x) + “, end = “”);
print(“y^2 + (“, b, “y) = “, end = “”);
# Driver code
x1 = 2;
y1 = -3;
r = 8;
circle_equation(x1, y1, r);
# This code is contributed
# by mits
x^2 + (-4 x) + y^2 + (6 y) = 51.
- Number of rectangles in a circle of radius R
- Angular Sweep (Maximum points that can be enclosed in a circle of given radius)
- Find minimum radius such that atleast k point lie inside the circle
- Given equation of a circle as string, find area
- Radius of the biggest possible circle inscribed in rhombus which in turn is inscribed in a rectangle
- Maximize a value for a semicircle of given radius
- Program to find the Radius of the incircle of the triangle
- Area of a n-sided regular polygon with given Radius
- Number of solutions for the equation x + y + z <= n
- Find the missing value from the given equation a + b = c
- Equation of parabola from its focus and directrix
- Print values of 'a' in equation (a+b) <= n and a+b is divisible by x
- Find the number of solutions to the given equation
- Sort an array after applying the given equation
- Number of integral solutions of the equation x1 + x2 +.... + xN = k
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.