Given the vertices of a triangle and length of its sides. A circle is inscribed in a triangle. The task is to find the incenter of a triangle.
Input: A(2, 2), B(1, 1), C(3, 1) and AB = 2, BC = 1, AC = 1 Output: (2, 1.5) Input: A(3, 3), B(1, 2), C(2, 2) and AB = 3, BC = 2, AC = 2 Output: (2.5, 2.83)
- The centre of the circle that touches the sides of a triangle is called its incenter.
- Suppose the vertices of the triangle are A(x1, y1), B(x2, y2) and C(x3, y3).
- Let the side AB = a, BC = b, AC = c then the coordinates of the in-center is given by the formula:
Below is the implementation of the above approach:
Incenter= (2.0, 1.5)
- Program to find Circumcenter of a Triangle
- Program to find area of a triangle
- Program to find the Centroid of the triangle
- Program to find the Radius of the incircle of the triangle
- Program to find the Type of Triangle from the given Coordinates
- Program to find third side of triangle using law of cosines
- Program to find Area of Triangle inscribed in N-sided Regular Polygon
- Program to print Sum Triangle for a given array
- C Program to print Floyd's triangle
- Program to print Fibonacci Triangle
- Program for incrementing/decrementing triangle pattern
- Program to calculate area and perimeter of equilateral triangle
- Program to calculate area of Circumcircle of an Equilateral Triangle
- Find all angles of a triangle in 3D
- Find all angles of a given triangle
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.