Jan 6, 2013 at 10:08pm
Give me logic to determine if the 3 sides represent a side of a triangle.
Last edited on Jan 6, 2013 at 10:21pm
Jan 6, 2013 at 10:34pm
The logic is given by the triangle inequality.
Given two side lengths a and b, the 3rd side c must satisfy
|a-b| <= c <= a+b
Jan 6, 2013 at 11:41pm
thnks fun2code,
I just found on internet.
It is a series of three inequalities: a+b>c, a+c>b, and b+c>a, if all are true then its a triangle.