int[][][] GMAT_SUBS; void getGMAT_SUBS(){ BufferedReader reader; String singleline; GMAT_SUBS = new int[6][3][12]; reader = createReader("GMATdetail.txt"); for(int i=0;i<6;i++){ for(int j=0;j<3;j++){ try { singleline = reader.readLine(); }catch (IOException e) { singleline = null; e.printStackTrace(); } if(singleline!=null){ String[] pieces = split(singleline, TAB); for(int k=0;k<12;k++){ GMAT_SUBS[i][j][k] = int(pieces[k]); } } } } } void detailGMAT(){ int maxSub = max(GMAT_SUBS[pos_x][0]); float ratio = 250.f / maxSub; strokeWeight(8); for(int i = 0;i < 3; i++){ stroke(subColor[i]); for(int j = 0;j < 12;j++){ float revlength = 250.f - GMAT_SUBS[pos_x][i][j] * (ratio - 0.2); float angle = PI/6 * (j - 3) + PI / 18 * i ; line(250*cos(angle),250*sin(angle),revlength*cos(angle),revlength*sin(angle)); float d = dist(mouseX,mouseY,trancenter_x,trancenter_y); if(d >= revlength - 2.f && d <= 252.f){ if(abs(sin(angle)*(mouseX-trancenter_x)-cos(angle)*(mouseY-trancenter_y)) <= 3 && samesign(250*cos(angle),mouseX-trancenter_x) && samesign(250*sin(angle),mouseY-trancenter_y)){ textFont(f2); fill(255); text(GMAT_SUBS[pos_x][i][j] + "",mouseX- trancenter_x, mouseY - trancenter_y - 5); } } } } translate(-trancenter_x,-trancenter_y); textFont(f2); textAlign(RIGHT); noStroke(); int wx = 1110; for(int j = 2;j >= 0;j--){ fill(subColor[j]); text(subNameGMAT[j],wx, 40); wx -= (textWidth(subNameGMAT[j]) + 50); } }