Given are two circles with their centres C1(x1, y1) and C2(x2, y2) and radius r1 and r2, the task is to check if both the circles are orthogonal or not.
Two curves are said to be orthogonal if their angle of intersection is a right angle i.e the tangents at their point of intersection are perpendicular.
Input: C1(4, 3), C2(0, 1), r1 = 2, r2 = 4 Output: Yes Input: C1(4, 3), C2(1, 2), r1 = 2, r2 = 2 Output: No
- Find the distance between the centres of two circles ‘d’ with distance formula.
- For the circles to be orthogonal we need to check if
r1 * r1 + r2 * r2 = d * d
- If it is true, then both the circles are orthagonal. Else not.
Below is the implementation of the above approach:
Given circles are orthogonal.
GeeksforGeeks has prepared a complete interview preparation course with premium videos, theory, practice problems, TA support and many more features. Please refer Placement 100 for details
- Check whether a given matrix is orthogonal or not
- Check whether two straight lines are orthogonal or not
- Ratio of the distance between the centers of the circles and the point of intersection of two direct common tangents to the circles
- Ratio of the distance between the centers of the circles and the point of intersection of two transverse common tangents to the circles
- Check if two given circles touch or intersect each other
- Check whether given circle resides in boundary maintained by two other circles
- Check if a given circle lies completely inside the ring formed by two concentric circles
- Path in a Rectangle with Circles
- Maximum points of intersection n circles
- Program to calculate the area between two Concentric Circles
- Radius of the inscribed circle within three tangent circles
- Number of common tangents between two circles if their centers and radius is given
- Length of direct common tangent between the two non-intersecting Circles
- Length of direct common tangent between two intersecting Circles
- Length of the transverse common tangent between the two non intersecting circles
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.