Lat-Lon Point是由其他两个Lat-Lon点定义的矩形 [英] Lat-Lon Point is in rectangle defined by two other Lat-Lon points
问题描述
我想确定某个点是否包含在矩形内。 矩形将由经度/纬度坐标(给定西北和东南坐标点)组成......所以基本上这里是参数:
I would like to determine if a certain point is contained within a 'rectangle'. The 'rectangle' will be made up of latitude/longitude coordinates (given northWest and southEast coordinate points)... so basically here are the parameters:
public boolean hasPoint(LatLon northWest, LatLon southEast, LatLon point) {}
LatLon类只有:
双纬度;
双经度;
The LatLon class just has: double latitude; double longitude;
我不知道如何开始这个...任何帮助将不胜感激。
I have no idea how to start this... any help will be appreciated.
推荐答案
假设这个LatLon类只有x和y值。
如果检查你的点x / y是否位于其他2个仓位的x / y之间,那么该怎么办?
Assuming this LatLon class just has an x and y value. How about just checking if your point x/y lies between the x/y from your other 2 positions ?
这篇关于Lat-Lon Point是由其他两个Lat-Lon点定义的矩形的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!