アットウィキロゴ

AABV

class pro{

double[] x=new double[4];
double[] y=new double[4];

public static void main(String args[]){
pro test=new pro();
}

pro(){

x[1]=1;
x[2]=6;
x[3]=5;
y[1]=3;
y[2]=2;
y[3]=7;

System.out.println(tr(1,2,3));



}
double tr(int m1,int m2,int m3){
double trx,tx3,tx2,ty3,ty2;
tx2=x[m2]-x[m1];
tx3=x[m3]-x[m1];
ty2=y[m2]-y[m1];
ty3=y[m3]-y[m1];
trx=tx2*ty3-tx3*ty2;
trx=(double)trx/2;
return trx;

}
}
最終更新:2011年06月09日 22:26