import java.util.Scanner;
class Main {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
//int i = (int)'1';
Scanner sc =new Scanner(System.in);
double [] x = new double[3];
double [] y = new double[3];
double[] side = new double[3];
while(sc.hasNext()) {
for (int i =0; i<3 ;i++) {
x[i] = sc.nextDouble();
y[i] = sc.nextDouble();
}
side[0] = Math.pow(x[0]-x[1],2) +Math.pow(y[0]-y[1],2);
side[0] = Math.sqrt(side[0]);
side[1] = Math.pow(x[2]-x[1],2) +Math.pow(y[2]-y[1],2);
side[1] = Math.sqrt(side[1]);
side[2] = Math.pow(x[2]-x[0],2) +Math.pow(y[2]-y[0],2);
side[2] = Math.sqrt(side[2]);
double d = 0.5 * (side[0] + side[1] + side [2]);
//System.out.println(side[1] + " " + side[2] + " " + side [0]);
double area = Math.sqrt(d* (d-side[0]) * (d-side[1]) * (d-side[2]));
//System.out.println(area);
double rad = (side[1] * side[2] * side[0]) / (4*area);
//System.out.println("radius is " + rad);
double res = 3.141592653589793 * rad * 2.0;
System.out.printf("%.2f\n", res);
//System.out.println(i);
}
}
}
class Main {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
//int i = (int)'1';
Scanner sc =new Scanner(System.in);
double [] x = new double[3];
double [] y = new double[3];
double[] side = new double[3];
while(sc.hasNext()) {
for (int i =0; i<3 ;i++) {
x[i] = sc.nextDouble();
y[i] = sc.nextDouble();
}
side[0] = Math.pow(x[0]-x[1],2) +Math.pow(y[0]-y[1],2);
side[0] = Math.sqrt(side[0]);
side[1] = Math.pow(x[2]-x[1],2) +Math.pow(y[2]-y[1],2);
side[1] = Math.sqrt(side[1]);
side[2] = Math.pow(x[2]-x[0],2) +Math.pow(y[2]-y[0],2);
side[2] = Math.sqrt(side[2]);
double d = 0.5 * (side[0] + side[1] + side [2]);
//System.out.println(side[1] + " " + side[2] + " " + side [0]);
double area = Math.sqrt(d* (d-side[0]) * (d-side[1]) * (d-side[2]));
//System.out.println(area);
double rad = (side[1] * side[2] * side[0]) / (4*area);
//System.out.println("radius is " + rad);
double res = 3.141592653589793 * rad * 2.0;
System.out.printf("%.2f\n", res);
//System.out.println(i);
}
}
}
No comments :
Post a Comment