Given two endpoint of diameter of a circle (x1, y1) and (x2, y2) find out the center of a circle.
Input : x1 = -9, y1 = 3, and x2 = 5, y2 = –7 Output : -2, –2 Input : x1 = 5, y1 = 3 and x2 = –10 y2 = 4 Output : –2.5, 3.5
The midpoint of two points, (x1, y2) and (x2, y2) is : M = ((x 1 + x 2) / 2, (y 1 + y 2) / 2)
The center of the circle is the mid point of its diameter so we calculate the mid point of its diameter by using midpoint formula.
- Find the other-end coordinates of diameter in a circle
- Minimum revolutions to move center of a circle to a target
- Program to find the diameter, cycles and edges of a Wheel Graph
- Program to find Circumference of a Circle
- Program to find area of a circle
- Given equation of a circle as string, find area
- Find the area of largest circle inscribed in ellipse
- Program to find smallest difference of angles of two parts of a given circle
- Find minimum radius such that atleast k point lie inside the circle
- Farthest distance of a 0 from the center of a 2-D matrix
- Python String Methods | Set 2 (len, count, center, ljust, rjust, isalpha, isalnum, isspace & join)
- Draw circle in C graphics
- Circle and Lattice Points
- Program to print circle pattern
- Area of square Circumscribed by Circle
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. 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.
Improved By : jit_t