日期:2014-05-20 浏览次数:20827 次
float offset(String section) { int H,W,t; float area,static_moment; String[] size = section.split("[\\D]+"); for(int i=1;i<=3;i++){ System.out.println(size[i]); } H = Integer.parseInt(size[1]); W = Integer.parseInt(size[2]); t = Integer.parseInt(size[3]); area = (H-t)*t + W*t; static_moment = (float) ((H-t)*t*(H-t)/2.0 + W*t*(H-t/2.0)); if(area==0){ return -1; } return static_moment/area; }