# Finding third side of non degenarate triangle

Given lengths of two sides of triangles $a$ and $b$, I want to calculate the number of possible integral values of length of third side $c$.

I know that range should be : $a-b<c<a+b$, given $a>b$.

Now this is full range for that third side but it also side which will make degenerate triangle $(Area\le 0)$. How do I exclude those sides which make degenerate triangle ?

• What you have suffices. All we need is for the triangle inequality to hold and your conditions guarantee that all three versions do in fact hold. – lulu Feb 7 '17 at 18:37
• @lulu How does this excludes length of third side that will make degenerate triangles ? – sammy Feb 7 '17 at 18:40
• In order for the triangle to degenerate, you'd need the three vertices to be co-linear. If you draw what that would mean, you'd see that it would require either $c=a+b$ or $c=a-b$ – lulu Feb 7 '17 at 18:42
• Maybe it helps to see how to construct the triangle, given your $a,b,c$. To do it, take a segment of length $c$. draw a circle centered at one endpoint with radius $a$ and another circle centered on the other endpoint with radius $b$. If the circles intersect, we have our third vertex. how can they not intersect? Well, the two circles might be too small (i.e. $c>a+b$) or one circle might entirely contain the other (i.e. $c<a-b$). Both are excluded by your conditions. – lulu Feb 7 '17 at 18:45
• @lulu Thanks for the explanation. I got it now. – sammy Feb 7 '17 at 18:55