lat2: =ASIN(SIN(lat1)*COS(d/ER) + COS(lat1)*SIN(d/ER)*COS(br
lon2: =lon1 + ATAN2(COS(d/ER)-SIN(lat1)*
Main Topics
Browse All TopicsI need a pair of T-SQL functions that look something like the attached code snippet. Essentially, my aim is to create a bounding box 200m around a known lat/lng so I need to get the co-ordinates 200m due east and due north from the known point. I have a function for calculating the distance between two known Latitudes/Longitudes (that was easy to find on the web) but not being a mathematician, I don't know how to refactor the equation for this purpose.
The reason I need this is a little convoluted but I'll gladly explain if asked. Ideally, the solution would use the same mathematics as my existing distance calculator function, just re-organised to get the lat/lng values instead of the distance, but I'll take any solution that works ;)
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
>> lon2: =lon1 + ATAN2(COS(d/ER)-SIN(lat1)*
shouldn't that be :
lon2: =lon1 + ATAN2(SIN(brng)*SIN(d/ER)*
since atan2 takes the y coordinate first, and then the x coordinate (some applications decided to do it the other way around against common convention though).
Business Accounts
Answer for Membership
by: deightonPosted on 2008-11-25 at 08:33:19ID: 23035783
assuming circumference of earth is 40030km
then 200m north is increase in latitude of
.2 / 40030 * 360 = .001799 degrees
for longitude it depends on latitude you're at
.2 * 360 / (cos(latitude) * 40030)
that's what I think, there might be refinements due to the fact earth is not a perfect sphere
I'm working in degrees there, not radians