Given two integers r and R representing the length of Inradius and Circumradius respectively, the task is to calculate the distance d between Incenter and Circumcenter.
Inradius The inradius( r ) of a regular triangle( ABC ) is the radius of the incircle (having center as l), which is the largest circle that will fit inside the triangle.
Circumradius: The circumradius( R ) of a triangle is the radius of the circumscribed circle (having center as O) of that triangle.
Input: r = 2, R = 5
Input: r = 5, R = 12
The problem can be solved using Euler’s Theorem in geometry, which states that the distance between the incentre and circumcentre of a triangle can be calculated by the equation:
Below is the implementation of the above approach:
Time Complexity: O(1)
Auxiliary Space: O(1)
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.
- Program to find Circumcenter of a Triangle
- Program to Find the Incenter of a Triangle
- Circumradius of a Cyclic Quadrilateral using the length of Sides
- Circumradius of the rectangle
- Distance of chord from center when distance between center and another equal length chord is given
- Biggest Reuleaux Triangle within a Square which is inscribed within a Right angle Triangle
- Biggest Reuleaux Triangle inscribed within a Square inscribed in an equilateral triangle
- Count paths with distance equal to Manhattan distance
- Maximum distance between two points in coordinate plane using Rotating Caliper's Method
- Find the radii of the circles which are lined in a row, and distance between the centers of first and last circle is given
- Find the side of the squares which are lined in a row, and distance between the centers of first and last square is given
- Find maximum and minimum distance between magnets
- Shortest distance between a Line and a Point in a 3-D plane
- Perpendicular distance between a point and a Line in 2 D
- Distance between a point and a Plane in 3 D
- Shortest distance between a point and a circle
- 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
- Distance between centers of two intersecting circles if the radii and common chord length is given
- Distance between end points of Hour and minute hand at given time
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.