import java.io.*;
class Main{
String str
= br.
readLine(); //x1 y1 x2 y2 x3 y3 xp yp r String[] str1
= str.
split(" "); double[] a = new double[9]; //x1 y1 x2 y2 x3 y3 xp yp r
double[] b = new double[6]; //a1 b1 a2 b2 a3 b3
double d1=0,d2=0,d3=0,s1=0,s2=0,s3=0,flag1=0,flag2=0,flag3=0;
for(int i=0;i<=8;i++){
a
[i
] = Double.
parseDouble(str1
[i
]); }
for(int i=0;i<=4;i+=2){
b[i] = (a[(i+3)%6]-a[i+1])/(a[(i+2)%6]-a[i]); //傾き (y2-y1)/(x2-x1)
b[i+1] = a[i+1]+(-1*(b[i]*a[i])); //切片 y1+(-1*(傾き*x1))
}
//円の中心から各線分までの距離
if(b
[0]!=Double.
POSITIVE_INFINITY && b
[0]!=Double.
NEGATIVE_INFINITY){ d1
= Math.
abs( (a
[6]*b
[0])+(a
[7]*-1)-b
[1] ) / Math.
sqrt(b
[0]*b
[0]+1); }else{
d1 = a[0];
}
if(b
[2]!=Double.
POSITIVE_INFINITY && b
[2]!=Double.
NEGATIVE_INFINITY){ d2
= Math.
abs( (a
[6]*b
[2])+(a
[7]*-1)-b
[3] ) / Math.
sqrt(b
[2]*b
[2]+1); }else{
d2 = a[2];
}
if(b
[4]!=Double.
POSITIVE_INFINITY && b
[4]!=Double.
NEGATIVE_INFINITY){ d3
= Math.
abs( (a
[6]*b
[4])+(a
[7]*-1)-b
[5] ) / Math.
sqrt(b
[4]*b
[4]+1); }else{
d3 = a[4];
}
//各頂点が円の中にあるか外にあるか
if( ((a[0]-a[6])*(a[0]-a[6]) + (a[1]-a[7])*(a[1]-a[7])) >= a[8]*a[8]){
flag1 = 1;
}
if( ((a[2]-a[6])*(a[2]-a[6]) + (a[3]-a[7])*(a[3]-a[7])) >= a[8]*a[8]){
flag2 = 1;
}
if( ((a[4]-a[6])*(a[4]-a[6]) + (a[5]-a[7])*(a[5]-a[7])) >= a[8]*a[8]){
flag3 = 1;
}
//面積の処理をするかしないか
if(a[8]>d1 && flag1==1 && flag2==1){
s1 = AB(d1,a[8]);
}else{
System.
out.
println("線分ABにおける面積はありません"); }
if(a[8]>d2 && flag2==1 && flag3==1){
s2 = BC(d2,a[8]);
}else{
System.
out.
println("線分BCにおける面積はありません"); }
if(a[8]>d3 && flag3==1 && flag1==1){
s3 = CA(d3,a[8]);
}else{
System.
out.
println("線分CAにおける面積はありません"); }
}
public static double AB(double d1,double r){
double l
= Math.
sqrt(r
*r
-d1
*d1
)*2; //弧の底辺の長さ double cosA = ((r*r)+(r*r)-(l*l))/(2*r*r); //余弦定理による角度cosA
double rad
= Math.
acos(cosA
); //アークコサインでラジアン出力 double s
= (0.5)*(r
*r
)*( rad
- Math.
sin(rad
) ); //面積 return s;
}
public static double BC(double d2,double r){
double l
= Math.
sqrt(r
*r
-d2
*d2
)*2; //弧の底辺の長さ double cosA = ((r*r)+(r*r)-(l*l))/(2*r*r); //余弦定理による角度cosA
double rad
= Math.
acos(cosA
); //アークコサインでラジアン出力 double s
= (0.5)*(r
*r
)*( rad
- Math.
sin(rad
) ); //面積 return s;
}
public static double CA(double d3,double r){
double l
= Math.
sqrt(r
*r
-d3
*d3
)*2; //弧の底辺の長さ double cosA = ((r*r)+(r*r)-(l*l))/(2*r*r); //余弦定理による角度cosA
double rad
= Math.
acos(cosA
); //アークコサインでラジアン出力 double s
= (0.5)*(r
*r
)*( rad
- Math.
sin(rad
) ); //面積 return s;
}
}
aW1wb3J0IGphdmEuaW8uKjsKY2xhc3MgTWFpbnsKCXB1YmxpYyBzdGF0aWMgdm9pZCBtYWluKFN0cmluZ1tdIGFyZ3MpdGhyb3dzIEV4Y2VwdGlvbnsKCQlCdWZmZXJlZFJlYWRlciBiciA9IG5ldyBCdWZmZXJlZFJlYWRlcihuZXcgSW5wdXRTdHJlYW1SZWFkZXIoU3lzdGVtLmluKSk7CgkJU3RyaW5nIHN0ciA9IGJyLnJlYWRMaW5lKCk7CQkvL3gxIHkxIHgyIHkyIHgzIHkzIHhwIHlwIHIKCQl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