Hardik Trivedi wrote:Yea I have person's current location. I would like to know about the algorithm
You're kidding, right??? Have you tried visualizing the situation using example long/lats for the box, and log/lat for a user who is inside and not inside the box? Draw it out on a piece of paper if you need to. Or take a simpler case with a simple graph using X and Y coordinates using vertical and horizontal lines and the person being a point inside or outside the box. Of course, this ignores the possibility that the box encompasses either the north or the south pole, then the algorithm gets more complex.
The title says "given pairs of lat long", so I assumed that Hardik had two longitudes and two latitudes, which then described a rectangle (or at least, as close to a rectangle that you can be on a sphere). Of course, if that is not what Hardik wanted, then I guess my comments don't really help!