great-circle

If I am here and heading towards there and I've covered this much ground, where am I?

I need help writing the following method: def get_new_location(current_location, target_location, distance_travelled): ... ... return new_location where all locations are (lat,long) I realize that there are different models for the earth (WGS-84, GRS-80, ...) which take into account the fact that the earth is an ellipsoid...

MySQL Great Circle Distance (Haversine formula)

Hello All, I've got a PHP script that gets Longitude and Latitude values...then inputs them into a MySQL query. I'd really like to make it solely MySQL. Live site can be found at http://MotoListr.com Here's my current PHP Code: if ($distance != "Any" && $customer_zip != "") { //get the great circle distance //get the origin zip ...

Great Circle Distance question

I am familiar with the formula to calculate the Great Circle Distance between two points. i.e. <?php $theta = $lon1 - $lon2; $dist = sin(deg2rad($lat1)) * sin(deg2rad($lat2)) + cos(deg2rad($lat1)) * cos(deg2rad($lat2)) * cos(deg2rad($theta)); $dist = acos($dist); $dist = rad2deg($dist); //convert degrees to distance depending on u...

Distance from Point To Line great circle functino not working right. Need help

Howdy. I need to get the distance from a lat/lng point to a line. Of course needs to follow the Great Circle. I found a great article on this at http://www.movable-type.co.uk/scripts/latlong.html but the code is not working right. Either I am doing something wrong or there is something missing. Here is the function in question. See t...

Is it possible to implement the Haversine formula in Objective-C and call it from SQLite?

As I understand, SQLite doesn't have the math functions to properly implement the Haversine formula in straight SQL. I'm thinking this should be possible using an external function, with the implementation being in C. The goal is to have a SQLite database in an iPhone, and to be able to sort by the distance to the user's current locati...

complex math with great circle formula

I have a from location (latitude, longitude) and to location (latitude, longitude). After calculating, it should show me what would be the nearest way to go from using a compass. The following is PHP code to do that, but its showing the wrong direction, I need little help on this. function GreatCircleDirection ($OrigLat, $DestLat, $Orig...

Great Circle & Rhumb line intersection

I have a Latitude, Longitude, and a direction of travel in degrees true north. I would like to calculate if I will intersect a line defined by two more Lat/Lon points. I figure the two points defining the line would create my great circle and my location and azimuth would define my Rhumb line. I am only interested in intersections tha...

Minimum bounding rectangle of a circle on a sphere

What R packages are available to calculate the minimum bounding box for a great circle? For example: box <- polycirc( c( longitude, latitude ), distance=35 ) This would return the bounding box for the circle with a radius of 35 kilometres from the central point at the given coordinates (on Earth). Where: box.longitude_min = The l...

Need a standalone Java library for performing spatial calculations on lat/lon data

I'm looking for a Java library that is capable of performing spatial calculations on sets of lat/lon data. Here are some of the functions that I'm looking for: Calculate the Great Circle distance between two points Determine if a point lies within a simple closed polygon, where the polygon is defined by an ordered list of points Dete...

Weird Great Circle Distance calculation

Hi, I have some problems with a great circle distance calculation using a map. Context: http://airports.palzkill.de/search/ The map is supposed to work as a great circle distance search map - you move the circles center marker or the radius marker, and the circle gets smaller or larger. For debug purposes, the boxes title field shows ...