如何将距离(英里)转换为度? [英] How to convert Distance(miles) to degrees?

查看:223
本文介绍了如何将距离(英里)转换为度?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Spatial数据处理应用程序。在这里,我需要找到从质心到点的距离。可以知道如何在Java中将英里转换为度数?

解决方案

最终修改:调查大圆距离 Geodesics 来发现你在这个问题中真正要求的复杂性。这当然是出于我对数学的熟悉。



[由于历史原因,留下原创建议。虽然件可能会帮助你,他们不会直接回答你的问题。]



请参阅 https://stackoverflow.com/a/1253545/1964221 为这个问题的答案。


Latitude:1经度:1度= 111.320 * cos(纬度)km


$ b $为了走向另一个方向,我想知道我们是否可以做到这一点(我的代数是生锈的):

纬度:1 km = 1 deg / 110.54 km < b
经度:1 km = 1 deg /(111.320 * cos(纬度)km)
$ b 应用



您的距离总是严格的东西或南北?如果是这样,你应该可以这样说:

  Integer latTraveledMiles = 100; 
Double latTraveledKM = 100 * 0.621371;
Double latTraveledDeg =(1 / 110.54)* latTraveledKM;

  Double currentLat = 74.0064; 
Integer longTraveledMiles = 100;
Double longTraveledKM = 100 * 0.621371;
Double longTraveledDeg =(1 /(111.320 * Math.cos(currentLat)))* longTraveledKM;

很可能,您需要知道南北和东西方向的距离(并把它带入不直截了当的领域。你可以看看毕达哥拉斯定理你知道三角形(c ^ 2)的长边,可以计算出经度(a ^ 2)和纬度(b ^ 2)。

你应该能够应用我以前的代码片段的一部分来找出

c = sqrt(a ^ 2 + b ^ 2)。

好好运。


I am working on an application with Spatial data. Here I need to find the distance from the centroid to a point. Can know how to convert miles to degrees in Java?

解决方案

Final Edit: Look into Great Circle Distance and Geodesics to discover the complexities of what you were really asking in this question. This is admittedly well out of my familiarity with mathematics.

[Leaving original suggestions in for historical reasons. Though pieces may help you, they will not directly answer your question.]

See https://stackoverflow.com/a/1253545/1964221 for the answer to this question.

Latitude: 1 deg = 110.54 km

Longitude: 1 deg = 111.320*cos(latitude) km

To go the other direction, I wonder if we can do this(my algebra is rusty):

Latitude: 1 km = 1 deg / 110.54 km
Longitude: 1 km = 1 deg / (111.320*cos(latitude) km)

Application

Is your distance always strictly East-West or North-South? If so, you should be able to say:

Integer latTraveledMiles = 100;
Double latTraveledKM = 100 * 0.621371;
Double latTraveledDeg = (1 / 110.54) * latTraveledKM;

or

Double currentLat = 74.0064;
Integer longTraveledMiles = 100;
Double longTraveledKM = 100 * 0.621371;
Double longTraveledDeg = (1 / (111.320 * Math.cos(currentLat))) * longTraveledKM;

More than likely, you will need to know distance in both North-South and East-West directions(and takes this into the realm of "not straight-forward). You could look at the Pythagorean Theorem. You know the "long side" of the triangle(c^2) and can calculate for longitude(a^2) and latitude(b^2).

You should be able to apply portions of my previous code snippets to figure out
c = sqrt(a^2 + b^2).

Good luck.

这篇关于如何将距离(英里)转换为度?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆