private boolean isContain(double center_lng, double center_lat, List<Map<String, Double>> array_points) {
double total_angle = 0;
for (int i = 0; i < array_points.size(); i++) {
Map<String, Double> point = array_points.get(i);
Map<String, Double> next_point = null;
if (i < array_points.size() - 1) {
next_point = array_points.get(i + 1);
} else {
next_point = array_points.get(0);
}
double angle = getAngle(center_lng, center_lat, point.get("lng"), point.get("lat"), next_point.get("lng"), next_point.get("lat"));
total_angle = total_angle + angle;
}
if ((int) (total_angle * 100) == (int) (2 * Math.PI * 100)) {
return true;
} else if (total_angle == 0) {
ret
判断点在凸多边形内(基于经纬度坐标)
最新推荐文章于 2025-06-04 14:57:57 发布