So I'm loading KML files to my google map, they are shown as convex polygons on the map.
I also have the user location , basically i want to know if the user is located on one of the polygon's edges (which is a convex polygon).
and because location services aren't 100% accurate, if the location is close (the edge is 15m far)- that's good :)
My solution is to find the function y=f(x) that passes between 2 vertices, then check if the user location is below f(x)+a and above f(x)-a.
I feel like I'm missing something and there should be a better (and more accurate) way to solve my issue or even maybe a java library for android that already tackle this.
Thanks :)