2009-08-03 07:39:11來源不明

我要最小值

作法 : 數學

提供者 : teching

數學名詞 : 費瑪點

證明 : http://www.math15.com/wiki/index.php?doc-view-202.html

公式 : PA+PB+PC={√[a^2+b^2+c^2+4*(√3)S]}/(√2)

S是三角形面積

/*********************************************************/

#include<stdio.h>  
#include<stdlib.h>  
#include<math.h>  
main()  
{  
 int a,b,c;
 while(scanf("%d %d %d",&a,&b,&c)==3)
   {
     if(a==0&&b==0&&c==0) break;
     double s=(a+b+c)/2.0,S;
     S=sqrt(s*(s-a)*(s-b)*(s-c));
     printf("%.2lf\n",sqrt(a*a+b*b+c*c+4*sqrt(3)*S)/sqrt(2));
   }
 return 0;     
}  

/*
PA+PB+PC={√[a^2+b^2+c^2+4*(√3)S]}/(√2)
*/

上一篇:快算面積

下一篇:良心何在