x1, y1 and radius are given - can anything be assumed about x2, y2?

189 Views Asked by At

I have a list of lat/lng coordinates. Given the coordinates x1, y1, and a radius r -- is there anything I can assume about the coordinates that fall within the radius of x1, y1? For example, can I compute a min and max value for x2 and y2?

Basically, I want to get from the list of lat/lng coordinates all those that are within the radius of x1, y1. Normally, I would use the haversine formula to compute the distance between the two points and see if it falls within the radius. However, I do not have that option at this point due to the programming environment I am currently in (this is for a website that returns a list of companies within an area).

1

There are 1 best solutions below

0
On BEST ANSWER

$x_2$ and $y_2$ need to satisfy the following inequality:

$\sqrt {(x_1-x_2)^2 + (y_1-y_2)^2} \leq r$