两个位置之间的Andr​​oid计算距离

编程入门 行业动态 更新时间:2024-10-20 07:57:53
本文介绍了两个位置之间的Andr​​oid计算距离的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

可能重复:   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.

更多推荐

两个位置之间的Andr​​oid计算距离

本文发布于:2023-11-12 20:21:11,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1582441.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:距离   位置   两个   Andr   oid

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!