News for hackers. Stuff that matters.
Re:Ask YC: Want to learn about GPS/Location Based Programmin... by icey on Thursday June 12, 2008 @01:41PM (#216116)
I can give you a teeny tiny head start. Here is the logic for determining the distance (in miles) between two points.

    sqrt((power(69.1 * (latitude1 - latitude2),2) + power(69.1 * (longitude1 - longitude2) * cos(latitude1 / 57.3), 2)))
This is coming from SQL server... it took a little fidgeting to get the actual distances right because of the weird curvature of the earth issue; but it should get you close for reasonable distances.

The Yahoo! geocoding API is pretty nice for getting lats and longs for addresses in the US:

http://developer.yahoo.com/maps/rest/V1/geocode.html

Re:Ask YC: Want to learn about GPS/Location Based Programmin... by icky on Friday June 13, 2008 @06:05AM (#216660)
> it took a little fidgeting to get the actual distances right because of the weird curvature of the earth issue; but it should get you close for reasonable distances.

Probably can't tell you how we solve it at work, but the very much publicly-available book Computational Geometry: Algorithms and Applications, Third Edition by de Berg, Cheong, et al., mentions something about the robustness of geometric algorithms using inexact (floating point) vs. exact arithmetic. :-)

Re:Ask YC: Want to learn about GPS/Location Based Programmin... by icey on Friday June 13, 2008 @02:53PM (#217043)
I can never tell the appropriate way to say thank you to a poster here. Should I upvote? Should I leave a comment? In this case, I'll do both.

Thanks for the recommendation, most of the maths work I do these days is financial, so geometry is a nice diversion. I hadn't seen this text before so I've got it bookmarked for some reading now.

As an aside, is this something I would have gotten some exposure to if I'd been a college grad? Any time I see things like this, I worry there are large swaths of text I've missed in self-study.

Re:Ask YC: Want to learn about GPS/Location Based Programmin... by icky on Friday June 13, 2008 @03:31PM (#217082)
> As an aside, is this something I would have gotten some exposure to if I'd been a college grad?

You might have had some exposure to the subject, but probably as part of other problems, i.e. not under the name Computational Geometry. For me, the most valuable thing was learning that this was an actual field with a name, which gave me a starting point for self-study.

Also check out Computational Geometry in C, Second Ed., by O'Rourke. It goes into more low-level implementation details (the first book I mentioned is a good high-level introduction to reasoning about geometric algorithms, so you should read that first).

Re:Ask YC: Want to learn about GPS/Location Based Programmin... by shafqat on Thursday June 12, 2008 @01:43PM (#216120)
Wow, cool. This is the kind of stuff I'm looking for. Tips and tricks to help me start coding and experiment. Thanks!