Hello. I ask for the help of the collective mind: is it possible to draw a circle on the map, in the center of which will be the current location of the user?
those. we draw a polygon consisting, for example, of 24 points, which are at an equal distance from the center. Maybe someone has an idea how to implement this? Thanks!
This is a complicated task, BUT here’s some starter material!
You’d essentially get your main point of interest, then use the formulas provided in the SO page and loop until you have completed your way around the circle. the formula increments around a fixed location and provides relevant coordinates to do so.
one of these day’s I’ll have to ccreate an example of this! great use cases for sure!
i found the exact problem (and solution) at stackoverflow here .
i got challenged by it so i turned it into a tiny app, with the solution expressed as thunkable function get_zone_latlongs
here’s the output for JFK international (40.6413,- 73.7781) and Paris (48.8566, 2.3522) - half-mile radius for 8 points.
and here’s the link to the project.
main blocks are shown below:
(the list viewer was just for verification and the function show_points -ie. vertices - isn’t actually necessary but it was helpful for checking the plotting of points.)
You are a genius!
During testing, a question arose - if I change the search radius to a value greater than 0.5 - the circle becomes an ellipse … What am I doing wrong?
Please read the link I provided at the start. It’s got something to do with the fact that the earth is not a perfect sphere and the map projection distorts the dimensions as you approach the poles. The formulas have been adjusted to account for these. So it might be the projection process. Perhaps it looks like an ellipse on a flat map on paper (or screen), it may turn out to be a circle when you plot the same points on a globe, I’m just guessing.
This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.