0
$\begingroup$

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-bb$.

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 ?

  • 2
    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.2017-02-07
  • 0
    @lulu How does this excludes length of third side that will make degenerate triangles ?2017-02-07
  • 0
    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$2017-02-07
  • 2
    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. $c2017-02-07
  • 0
    @lulu Thanks for the explanation. I got it now.2017-02-07
  • 0
    @lulu Is there some case where this condition fails ? Like If $a,b$ are equal ?2017-02-12
  • 0
    Your condition specifies $a>b$. Still, if $a=b$, you're good. Think of the construction. Start with a segment of length $c$ and draw the two circles of radius $a$ centered at the endpoints. These must intersect as $a+b=2a>c$ means that $a>\frac c2$.2017-02-12
  • 0
    @lulu I am getting some answers wrong in finding the range from two numbers $a,b$. So I thought I was missing something,some corner case.2017-02-17
  • 0
    Can you be precise? What input values lead to difficulty?2017-02-17
  • 0
    @lulu Even I don't know those values. All I know is that values of $a,b$ can vary from $2^0$ to $2^{60}$.2017-02-18
  • 0
    Well, what makes you think there's a problem? To be sure, your inequality $a>b$ rules out equilateral triangles....but, as the circle construction shows if you have three strictly positive numbers $(a,b,c)$ and all three triangle inequalities are satisfied (namely $a>b+c,b>a+c,c>a+b$) then there is a triangle with those sides.2017-02-18
  • 0
    @lulu It is possible that $a=b$. It is not always the case but yes it is possible.2017-02-18
  • 0
    Well, you excluded that case when you wrote $a>b$. Of course you can simply extend your criterion to include $a≥b$.2017-02-18

0 Answers 0