![]() |
|
|||||||
| Google Earth Hacks Home | Google Earth Files | Register | FAQ | Members List | Social Groups | Search | Today's Posts | Mark Forums Read |
| Questions/Problems If you are having issues with the game or don't understand how a particular feature is supposed to work, you can post your question in here. |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Member
Join Date: Aug 2005
Posts: 93
|
What unit of measure is the "Actual distance" value in on the Move Army page?
GEwar - Move Army Latitude to travel: 1.5438003199939 Longitude to travel: 1.6974503062317 Distance to travel: 2.2944840313542 Actual distance: 1.2444840313542 Approx travel time: 10 minutes |
|
|
|
|
#2 | |
|
Administrator
Join Date: Jun 2005
Posts: 2,328
|
Quote:
|
|
|
|
|
|
#3 | |
|
Member
Join Date: Aug 2005
Posts: 93
|
Quote:
|
|
|
|
|
|
#4 | |
|
Senior Member
Join Date: Jul 2005
Posts: 459
|
Quote:
|
|
|
|
|
|
#5 | ||
|
Administrator
Join Date: Jun 2005
Posts: 2,328
|
Quote:
Quote:
|
||
|
|
|
|
#6 | |
|
Member
Join Date: Aug 2005
Posts: 93
|
Quote:
Do you have a method that takes: current location, destination and returns new location? All lat, long pairs? Or is just a SQL statement? |
|
|
|
|
|
#7 |
|
Member
Join Date: Aug 2005
Posts: 93
|
public class GreatCircle {
public GreatCircle() { } double r = 6367.0; public double distance( Point2D start, Point2D finish) { double x1, y1, x2, y2; x1 = toRadians( start.getX()); y1 = toRadians( start.getY()); x2 = toRadians( finish.getX()); y2 = toRadians( finish.getY()); double d = r * Math.acos(Math.sin(y1)*Math.sin(y2) +Math.cos(y1)*Math.cos(y2)*Math.cos(x2-x1) ); return d; } public double heading( Point2D start, Point2D finish) { double D = distance( start, finish); double x1, y1, x2, y2; x1 = toRadians( start.getX()); y1 = toRadians( start.getY()); x2 = toRadians( finish.getX()); y2 = toRadians( finish.getY()); double heading = Math.acos( (Math.sin(x1) - (Math.sin(y1) * Math.cos(D))) / (Math.cos(y1) * Math.sin(D))); return heading; } double toRadians( double degrees){ return Math.PI*2.0/360.0; } Point2D move(Point2D start, Point2D destination, double perTurnDistance){ /* Intermediate points on a great circle Suppose the starting point is (lat1,lon1) and the final point (lat2,lon2) and we want the point a fraction f along the great circle route. f=0 is point 1. f=1 is point 2. The two points cannot be antipodal ( i.e. lat1+lat2=0 and abs(lon1-lon2)=pi) because then the route is undefined. The intermediate latitude and longitude is then given by: **/ double totalDistance = distance(start, destination); double f = perTurnDistance/totalDistance; //fraction of distance if( armyName.contains("elk-tamer")) f *= 100; double lat1 = start.getY(); double lat2 = destination.getY(); double lon1 = start.getX(); double lon2 = destination.getX(); double A = Math.sin((1-f)*totalDistance)/Math.sin(totalDistance); double B = Math.sin(f*totalDistance)/Math.sin(totalDistance); double x = A*Math.cos(lat1)*Math.cos(lon1) + B*Math.cos(lat2)*Math.cos(lon2); double y = A*Math.cos(lat1)*Math.sin(lon1) + B*Math.cos(lat2)*Math.sin(lon2); double z = A*Math.sin(lat1) + B*Math.sin(lat2); double lat = Math.atan2(z,Math.sqrt(x*x+y*y)); double lon = Math.atan2(y,x); return new Point2D.Double(lon, lat); } } |
|
|
|
|
#8 | |
|
Senior Member
Join Date: Sep 2005
Posts: 665
|
Quote:
|
|
|
|
|
|
#9 | |
|
Senior Member
Join Date: Aug 2005
Posts: 632
|
Quote:
![]() and that crying smile "smilie" too Oh my good!...
|
|
|
|
|
|
#10 | |
|
Senior Member
Join Date: Jul 2005
Posts: 459
|
Quote:
|
|
|
|
|
|
#11 | |
|
Senior Member
Join Date: Aug 2005
Posts: 632
|
Quote:
|
|
|
|
|
|
#12 | |
|
Member
Join Date: Aug 2005
Posts: 93
|
Quote:
|
|
|
|
|
|
#13 |
|
Senior Member
Join Date: Sep 2005
Posts: 323
|
That's how I would've done it........
|
|
|
|
|
#14 | |||
|
Senior Member
Join Date: Jul 2005
Posts: 459
|
Quote:
|
|||
|
|
|
|
#15 |
|
Senior Member
Join Date: Jul 2005
Posts: 459
|
Suggest moving the thread to alliances/trash talk
;-) |
|
|
| Thread Tools | |
| Display Modes | |
|
|