438 - The Circumference of the Circle
Solution Description : 2D geometry Problem First, compute a,b,c where a,b,c are the length of Triangle side Find S where S is (a+b+c)/2 (1/2 of triangle’s circumference) Find L =sqrt(s*(s-a)*(s-b)*(s-c)) Compute r:=(a*b*c)/(4*L) (R= half diameter of the circle) Output (2*Pi*r) (the circumference of circle) Use Pi = acos(-1.0) |
||||||||||