I'm doing this in Python (3) but this could be a more general question.
Basically what I'm trying to achieve is getting a list of surrounding zip codes, next to a certain zip code, and the range is dynamic. So what zip codes are around say zip code 90210, within a 20 mile radius. And I need to query a SQL DB for my results.
So I need to calculate 2 lat, lang points, that create a rectangular search area (yes its not completely accurate because its not circular but that is not a big deal), so something like this:
P1 (lat, long) -------------------------+
| |
| |
| |
| Original (lat, long) |
| |
| |
| |
-------------------------- P2 (lat, long)
"radius" given = 30 miles
So all we have as input is the lat, long, radius, need to calculate P1 and P2. Since my math is well, in high school, I would love some help with this. Also need to consider that this is in Miles, whatever the formula for Lat, Long is for Miles (not KM)