SEARCH HOME
Math CentralQuandaries & Queries

search

Question from Nancy, a student:

I'm a computer programming student, and I'm supposed to figure out how to find the area of a circle inside a triangle if someone types in the length of each side of the triangle.

So, a user can type in any three numbers they want into the three "side length" boxes, and I have to find the area of the circle that would fit inside the triangle they create from those values.

So the circle can be any size, depending on the size and shape of the triangle the user creates. The circle has to touch all three sides of the triangle somewhere. Then, my program calculates the area of the triangle and thus the area of the circle. I just need to know how the circle would change depending on the length of each side of the triangle that the user puts in. Is there a way to find out how the circle's area is related to the triangle around it?

Nancy,

You have to find the radius of your circle (which is called the INCIRCLE). That radius is traditionally denoted by r. To do that you need two different ways of computing the area of a triangle. Such formulas can be found in a reference book or on-line, for example at
http://mathworld.wolfram.com/TriangleArea.html

I would use formula (9) on Wolfram's list (Heron's formula) and set it equal to formula (8), which says that area = rs (for the semiperimeter s = (a+b+c)/2). That gives you a formula for the desired radius r. Then the area of the incircle is pi × r2.

Chris

Warning:

Nancy,

You say that

a user can type in any three numbers they want into the three "side length" boxes, and I have to find the area of the circle that would fit inside the triangle they create from those values.

It is not true that any three numbers can be the side lengths of a triangle. Draw a line of length 5 cm and then try to complete a triangle with the other two sides of length 1 cm each.

In any triangle the length of each side must be no larger than the sum of the lengths of the other two sides. Your software should check this condition before accepting the user's input.

Harley

About Math Central
 

 


Math Central is supported by the University of Regina and The Pacific Institute for the Mathematical Sciences.
Quandaries & Queries page Home page University of Regina PIMS