可能重复: How用他们的经度和纬度值计算两个位置之间的距离
Possible Duplicate: How to calculate distance between two locations using their longitude and latitude value
在你们给我在地球怎么不是一个完美的球体,这一切的变化,当你接近极点,这似乎是所有我可以在网络上找到一些教育。并要求我的父亲是谁是一个多才多艺的地理学家和我的叔叔谁是量子物理学家谁的作品为美国航天局和我是一个卑微的电脑程序员之前,我想请你们先!
Before you all give me some education on how the earth is not a perfect sphere and it all changes when you get closer to the poles, which seems to be all I can find on the net. And before asking my father who is an accomplished geographer and my uncle who is a Quantum Physicist who works for NASA and me being a lowly computer programmer, I’d like to ask you guys first!
我只需要一个棒球场公里的距离为乌鸦从电话飞到为720平方公里pre填充位置的列表,这样的变化并不重要。
I only need a ball park Km distance as the crow flies from a phone to a list of pre populated locations for an area of 720 square kilometers, so variations are not important.
这是我的权利,请不要在我身上掉落任何东西。
This is me right now, please don’t drop anything on me.
mLatitude=-38.3533177 mLongitude=144.9127674
这是我十分钟前的直线距离,
And this is me ten minutes ago approximately 3kms away as the crow flies,
mLatitude=-38.3444385 mLongitude=144.9374762
我应该怎么计算,要得到3公里?
How do I calculate that to get 3km?
我是很新的Java,所以我不知道什么内置数学函数可以用,我不知道该计算是什么?
I’m quite new to Java so I’m not sure what built in Math functions are available and I have no idea what the calculation is?
干杯,
麦克。
推荐答案您可以使用distanceTo()对位置类方法来得到两个locatins之间的距离。
You can use distanceTo() method of Location class to get distance between two locatins.
更多推荐
两个位置之间的Android计算距离
发布评论