coor[][]是三個點的經緯度和高程前兩列分別是經度和緯度,可是在 result[o][p]=Math.sqrt(Math.pow(coor[i][0]-sta[m][1],2)+Math.pow(coor[i][1]-sta[m][2],2));行出現了標題中的問題,請問應該怎么改。我是java初學者,希望大家能幫幫忙。import java.io.*;public class Dis5{public static void main(String args[]){try{double [][] coor= new double[3][3];double [][] result= new double[3][3];int [] ori=new int[9];int i=0,j;int m=0,n;int o,p;double [][] sta={{1,363855.75,4039483.23},{2,363314.52,4039455.38},{3,364354.27,4039395.10}};for(o=0;o<=2;o=o+1){ for(p=0;p<=2;p=p+1){ result[o][p]=Math.sqrt(Math.pow(coor[i][0]-sta[m][1],2)+Math.pow(coor[i][1]-sta[m][2],2));System.out.println(result[o][0]+"\t"+result[o][1]+"\t"+result[o][2]);}m=m+1;}i=i+1;fr.close();fw.close();}catch (Exception e){System.out.println("出現錯誤");e.printStackTrace();}}}
添加回答
舉報
0/150
提交
取消