/* 数学题 套公式就行 */ #define LOCAL #include<iostream> #include<cstdio> #include<cmath> #include<cstring> #include<cstdlib> #include<iomanip> #include<string> #include<algorithm> #include<ctime> #include<stack> #include<queue> #include<vector> #define N 10005 using namespace std; double getedge(double x1,double y1,double z1,double x2,double y2,double z2) {return sqrt((x1-x2)*(x1-x2)+(y1-y2)*(y1-y2)+(z1-z2)*(z1-z2));} int main() { #ifdef LOCAL freopen("input.txt","r",stdin); freopen("output.txt","w",stdout); #endif double x1,y1,z1,x2,y2,z2,x3,y3,z3,a,b,c,r,R,p,s; while(cin>>x1>>y1>>z1>>x2>>y2>>z2>>x3>>y3>>z3) { a=getedge(x1,y1,z1,x2,y2,z2); b=getedge(x1,y1,z1,x3,y3,z3); c=getedge(x2,y2,z2,x3,y3,z3); p=(a+b+c)/2.0; s=sqrt(p*(p-a)*(p-b)*(p-c)); r=s/p; R=a*b*c/(4*s); cout<<setprecision(3)<<setiosflags(ios::fixed)<<r*r/(R*R)<<endl; } return 0; }
#include<iostream> #include<cstdio> #include<cmath> #include<cstring> #include<cstdlib> #include<iomanip> #include<string> #include<algorithm> #include<ctime> #include<stack> #include<queue> #include<vector> #define N 10005 using namespace std; double getedge(double x1,double y1,double z1,double x2,double y2,double z2) {return sqrt((x1-x2)*(x1-x2)+(y1-y2)*(y1-y2)+(z1-z2)*(z1-z2));} double getsinc(double a,double b,double c) {double ans=(a*a+b*b-c*c)/(2*a*b);return sqrt(1-ans*ans);} int main() { #ifdef LOCAL freopen("input.txt","r",stdin); freopen("output.txt","w",stdout); #endif double x1,y1,z1,x2,y2,z2,x3,y3,z3,a,b,c,r,R,p,s,sinc; while(cin>>x1>>y1>>z1>>x2>>y2>>z2>>x3>>y3>>z3) { a=getedge(x1,y1,z1,x2,y2,z2); b=getedge(x1,y1,z1,x3,y3,z3); c=getedge(x2,y2,z2,x3,y3,z3); p=(a+b+c)/2.0; s=sqrt(p*(p-a)*(p-b)*(p-c)); r=s/p; sinc=getsinc(a,b,c); R=c/(2*sinc); cout<<setprecision(3)<<setiosflags(ios::fixed)<<r*r/(R*R)<<endl; } return 0; }