时间:2021-07-01 10:21:17 帮助过:3人阅读
$arr = [
[
'lat' => 29.080832
'lng' => 119.068514
'stid' => 20914
],
.......
];
现在给定一个范围 ```
$range = [
'minLng' => 119.0832423,
'maxLng' => 119.0934235,
'minLat' => 29.090978,
'maxLat' => 29.329833
]```
用二分法计算出所有落在$range范围内的坐标,代码?
需求这样,目前有 2000多个点的坐标,数组$arr = [
[
'lat' => 29.080832
'lng' => 119.068514
'stid' => 20914
],
.......
];
$arr的坐标是有序排序的,按坐标从小到大排序,
并且
$arr共有2000多个子数组
现在给定一个范围 ```
$range = [
'minLng' => 119.0832423,
'maxLng' => 119.0934235,
'minLat' => 29.090978,
'maxLat' => 29.329833
]```
用二分法计算出所有落在$range范围内的坐标,代码?