Recently, I have been working on a map project, the function of electronic fences, to judge whether the point is in the circle
Circle center coordinates {lng: 121.29947, lat: 29.573633} radius 1696.4733268003329 We added 3 points to the web page
var m1 = new BMap.Marker(new BMap.Point(121.29940,29.573600));
var m2 = new BMap.Marker(new BMap.Point(121.29940,29.579600));
var m3 = new BMap.Marker(new BMap.Point(121.29940,29.589600));
M1 and M2 are both within the circle, and M3 is clearly not in the circle
.net/C# The screenshot of the algorithm to determine whether a point is within a circle is as follows:
I translated it from Java code lol
The Marker object code is as follows:
Tourists, if you want to see the hidden content of this post, please Reply
|