请在以下人员建议的链接的帮助下检查我尝试编写的代码。请告诉我我是否正确实施了逻辑。我已将数据粘贴到excel工作表中,以查看其在http://www.copypastemap.com/map.php上的绘图 `
import java.io.File;
import java.io.IOException;
import jxl.Workbook;
import jxl.write.WritableSheet;
import jxl.write.WritableWorkbook;
import jxl.write.WriteException;
import jxl.write.biff.RowsExceededException;
public class FindingLatLongAlongACircle {
static double latitude= 35.306614;
static double longitude= -80.7444093;
//static double circumofEarth= 40075000;
static double R=20;
public static void main(String[] args) throws IOException {
File f= new File("C:\\Users\\Manu Chaudhary\\Desktop\\LatongAroundaPoint.xls");
WritableWorkbook myexcel= Workbook.createWorkbook(f);
WritableSheet mysheet= myexcel.createSheet("mysheet",0);
int YAxis1=0;
int YAxis2=0;
// Added now
jxl.write.Label k1;
jxl.write.Label k2;
double angle=0;
double angleRadian=0;
// double changeInLat;
//double changeInLong;
double dx;
double dy;
double final_latitude=0;
double final_longitude=0;
double delta_longitude;
double delta_latitude;
while(angle<360){
angle=angle+15;
angleRadian= Math.toRadians(angle);
dx= R* Math.sin(angleRadian);
dy= R* Math.cos(angleRadian);
//changeInLat= (distance* Math.cos(angleRadian))/(circumofEarth* Math.cos(lat1));
//changeInLong= (distance*Math.sin(angleRadian))/circumofEarth;
//newLatitude= lat1+changeInLat;
//newLongitude=long1+ changeInLong;
delta_longitude= dx/(111320* Math.cos(latitude));
delta_latitude= dy/110540;
final_latitude= latitude+ delta_latitude;
final_longitude=longitude+ delta_longitude;
YAxis1++;
YAxis2++;
k1= new jxl.write.Label(0,YAxis1,Double.toString(final_latitude));
k2= new jxl.write.Label(1,YAxis2,Double.toString(final_longitude));
try {
mysheet.addCell(k1);
} catch (RowsExceededException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (WriteException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
try {
mysheet.addCell(k2);
} catch (RowsExceededException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (WriteException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
System.out.println("The value of latitude at "+ angle + " angle is"+ final_latitude);
System.out.println("The value of longitude at "+ angle + " angle is"+ final_longitude);
}
myexcel.write();
try {
myexcel.close();
} catch (WriteException e) {
e.printStackTrace();
System.out.println("Finish");
}
}
}
`假设我知道一个点的纬度和经度。如果我知道间隔距离,是否可以计算该点(大约16个点)周围的经纬度?我搜索了stackoverflow,发现了两个有用的链接。
为使问题更清楚,请参阅所需的纬度和经度。请帮我用python中的代码。
答案 0 :(得分:0)
这只是基本的触发:
θ=通过将外部点连接到中心点,然后从中心点水平延伸90º线直到高度可以连接两条先前绘制的线而形成的三角形的仰角
ec =地球的周长
距离•cos(θ)/(ec•cos(纬度))=Δlong
距离•sin(θ)/ ec =Δlat
请尝试一些代码,此网站不能让别人做您的作业。