+Deneye Posted June 15, 2005 Share Posted June 15, 2005 basic navigation stuff.... Given a lat & long coordinate, how can i calculate a second lat & long coord knowing a distance traveled and direction? eg: N 30° 32.768 W 100° 45.222 distance travelled: 15.25 Km heading: 145° ...what are the endpoint coordinates? I've found online calculators that can calculate distances and directions given sets of waypoints, but i can't seem to put my finger on one that can answer my question...if need be though, i'm pretty good with a handheld calculator Quote Link to comment
+Gambrinus & Crew Posted June 15, 2005 Share Posted June 15, 2005 (edited) The Washington State Geocaching Association website has some great utilities you can use for this sort of thing. Edited to add, look at the Waypoint Projector under Links and Resources and then under Lat/Lon Conversions and Calculations Edited June 15, 2005 by Gambrinus & Crew Quote Link to comment
+AtoZ Posted June 15, 2005 Share Posted June 15, 2005 First convert to coordinates to UTM change distance to meters. Easting = Starting Easting + sin(deg)*distance Northing = Starting Northing + cos(deg)*distance At 15.25km you have an error of approximately +/- 0.01km or about 33 feet so now asd this to your 30foot error for the GPSr and you have 60+foot error to contend with. THa is why it sux to do projections ofver long distances. You can also project the waypoint using your GPSr Project a waypoint function but agian your have a good degree of error. cheers Quote Link to comment
+Cardinal Red Posted June 15, 2005 Share Posted June 15, 2005 Great Circle Calculator Check out the second calculator: Compute lat/lon given radial and distance from a known point Also quite good after I figured out how to get it to work: GeoCalc Converting to UTM can be a problem if you have to cross from one Zone into the next one. Quote Link to comment
GoldenDaze Posted June 15, 2005 Share Posted June 15, 2005 Assuming that the distance is small enough that degrees of longitude are not of significantly different lengths over the latitude range of interest, you can use this: lat2 = lat1 + cos(hdg) * dist * (360/40000) lon2 = lon1 + sin(hdg) * dist * (360/40000) / cos(lat1) Be sure to convert your lat/lon values into the units needed by your trig functions. For example, in Excel, you'll need to convert degrees to radians. Basically, this uses the "flat earth" model, and assumes that lines of longitude are parallel. It isn't perfect, but it's a whole lot simpler than great circle calculations and it'll get you pretty close. If pretty close isn't good enough, or if your distance is too large, you'll need to go with the great circle calculations. Of course, you can trial-and-error this by just doing a whole lot of iterations with one of those online calculators you mention, until you get a distance and bearing answer that look like what you want. Quote Link to comment
robertlipe Posted June 15, 2005 Share Posted June 15, 2005 The formulas given so far assume the earth is flat. To the dismay of cartographers everywhere, it's only flat if you consider a suitably small component of it. :-) Since we've now all dragged out our trig books, let me offer the mor general purpose approach from the excellent Aviation Forumulary: Lat/lon given radial and distance A point {lat,lon} is a distance d out on the tc radial from point 1 if: lat=asin(sin(lat1)*cos(d)+cos(lat1)*sin(d)*cos(tc)) IF (cos(lat)=0) lon=lon1 // endpoint a pole ELSE lon=mod(lon1-asin(sin(tc)*sin(d)/cos(lat))+pi,2*pi)-pi ENDIF This algorithm is limited to distances such that dlon <pi/2, i.e those that extend around less than one quarter of the circumference of the earth in longitude. A completely general, but more complicated algorithm is necessary if greater distances are allowed: lat =asin(sin(lat1)*cos(d)+cos(lat1)*sin(d)*cos(tc)) dlon=atan2(sin(tc)*sin(d)*cos(lat1),cos(d)-sin(lat1)*sin(lat)) lon=mod( lon1-dlon +pi,2*pi )-pi If you don't own a pocket protector, I have to go with the advice of using a program written by someone that does own one and does the great circle math for you. Geocalc is one such. The projection feature that's probably in your GPS is hopefully another. Quote Link to comment
+EScout Posted June 15, 2005 Share Posted June 15, 2005 Your GPSr probably has a waypoint projection feature. This is the quickest and easiest, especially if you are in the field. Read your manual, and if you can't find it, let us know what model you have and someone can help. Just a matter of a few button pushes to get the new waypoint, then you can save it and goto it. Quote Link to comment
+fizzymagic Posted June 15, 2005 Share Posted June 15, 2005 First convert to coordinates to UTMchange distance to meters. Easting = Starting Easting + sin(deg)*distance Northing = Starting Northing + cos(deg)*distance At 15.25km you have an error of approximately +/- 0.01km or about 33 feet Nope. The error of the calculation as you described it is about 778 feet, not 33 feet. Using your UTM method, you get a result of: 14R E 340528 N 3368120, or N 30 26.079, W 100 39.638. Doing the projection properly, you get N 30 26.005, W 100 39.759. That is partly because you did not correct for grid north, but also because UTM is unsuitable for projections. Repeat: NEVER use UTM to do projections! The question the OP asked is more complicated than it may seem. Does he want a geodesic (minimum-distance) projection? That would be a "great circle" projection on a sphere, but is more complicated for the ellipsoid. Or does he want a rhumb line projection, which is a path of constant heading? For the great-circle and geodesic projections, you can use a free little program I wrote called GeoCalc. It does a better job at projections than most GPS units. But let me reiterate: DO NOT use UTM to do projections! Quote Link to comment
+AtoZ Posted June 15, 2005 Share Posted June 15, 2005 (edited) First convert to coordinates to UTMchange distance to meters. Easting = Starting Easting + sin(deg)*distance Northing = Starting Northing + cos(deg)*distance At 15.25km you have an error of approximately +/- 0.01km or about 33 feet Nope. The error of the calculation as you described it is about 778 feet, not 33 feet. Using your UTM method, you get a result of: 14R E 340528 N 3368120, or N 30 26.079, W 100 39.638. Doing the projection properly, you get N 30 26.005, W 100 39.759. That is partly because you did not correct for grid north, but also because UTM is unsuitable for projections. Repeat: NEVER use UTM to do projections! The question the OP asked is more complicated than it may seem. Does he want a geodesic (minimum-distance) projection? That would be a "great circle" projection on a sphere, but is more complicated for the ellipsoid. Or does he want a rhumb line projection, which is a path of constant heading? For the great-circle and geodesic projections, you can use a free little program I wrote called GeoCalc. It does a better job at projections than most GPS units. But let me reiterate: DO NOT use UTM to do projections! This not true it depends upon the distance. Typically for less then 16 mile the results are insignifinate. Yes if your a pilot and flying 1000s of miles then you need to use a great circle caculations but for most the stuff geocachers do using UTM within a zone is sufficant. That or all the caches I have found doing it have been just PURE luck. cheers Edited June 15, 2005 by AtoZ Quote Link to comment
+EScout Posted June 15, 2005 Share Posted June 15, 2005 Projecting in a Meridian,using 145 degrees true: 30 26.021 100 39.744 Quote Link to comment
+fizzymagic Posted June 15, 2005 Share Posted June 15, 2005 Projecting in a Meridian,using 145 degrees true: 30 26.021 100 39.744 Those are exactly the results you would expect using a Great Circle calculation for a spherical Earth. They are only off by about 125 feet from the more-accurate ellipsoidal calculations. Quote Link to comment
+fizzymagic Posted June 15, 2005 Share Posted June 15, 2005 (edited) But let me reiterate: DO NOT use UTM to do projections! This not true it depends upon the distance. Typically for less then 16 mile the results are insignifinate. Incorrect. The main problem here is that grid north (the direction you would travel by increasing only the northing part of your UTM coordinates) is not the same as true north. So by using UTM without correcting for grid north, you are heading in the wrong direction! Me, I would consider an error of almost 800 feet over 16 km unacceptably large; your mileage may differ. In any case, telling people that such an error is "insignificant" is just plain wrong. By the way, to clarify some things from the earlier post: The geodesic projection is the path you would travel if you shot a laser beam in your initial direction and followed it. Because of the curvature of the Earth, the beam would end up above your head, but if you stayed directly under it, you would follow the geodesic. The great circle path is the geodesic path for a sphere. Since the Earth is not exactly a sphere, describing the path is pretty complicated, but it is meant as an approximation to the geodesic path. The rhumb line projection is the path you would follow if you walked looking at your GPS and keeping the heading the same as your initial heading. The actual shape of the path is a spiral (if you walk for a suitably long time along a rhumb line, you end up at one of the poles). On polar Mercator projections, rhumb lines look straight. On UTM projections, rhumb lines are generally not straight (with the singular exception of the central meridian). In fact, the actual shape of what looks like a straight line on UTM projection is very complicated. Lots of people believe that USGS topo maps are UTM projections, but that is not true. Most are Lambert conformal conic (LCC) projections, which have the property that the scale is constant along a chosen parallel. My main point here is that geodesy (the measurement of distance on the durface of the Earth) is by no means simple. The plain fact is that the Earth is not a simple shape! For any projection further than about 500 feet, the shape of the Earth simply must be accounted for. Edited June 15, 2005 by fizzymagic Quote Link to comment
+Deneye Posted June 16, 2005 Author Share Posted June 16, 2005 Your GPSr probably has a waypoint projection feature. This is the quickest and easiest, especially if you are in the field. Read your manual, and if you can't find it, let us know what model you have and someone can help. Just a matter of a few button pushes to get the new waypoint, then you can save it and goto it. Thanks, but it's not accurate enough. It's hard enough trying keep it still enough to hold a bearing, let alone trying to push a button to lock it there for a projection. If the distance I need to cover was only a few hundred meters or less, then this is the method i'd choose...but since i have to project over about 11,000 meters, it won't even get me into the ball park i'm afraid. which is why i'm looking fo the mathematical answer. To the rest, thanks muchly for the help. It's a fascinating discussion and I appreciate the help. I'll check out those online links and get back to you. Quote Link to comment
+Deneye Posted June 16, 2005 Author Share Posted June 16, 2005 I'm sorry to say but the link for The Washington State Geocaching Association provided by Gambrinus & Crew didn't help me...might have been a browser conflict with the calculator. Hit the calc button and nothing would happen. so I tried Cardinal Red's Great Circle Calculator and it did the job for me. And can I say holy crap! I plug the projected coordinate into my GPSr and away I went. It took me within 20 meters of exactly where I needed to be! (ok, so I read the decrypted hint...it was dark and I wasn't sure if I was going to even be in the right spot...) It was amazing. Sadly enough though, it was pitch frickin' dark in the bush and so I couldn't find the cache...but you can bet i'll be back there at first light hunting for it. Thanks very much for the help. For the curious, the cache is GCKPBY Quote Link to comment
+Cardinal Red Posted June 16, 2005 Share Posted June 16, 2005 Glad you're on the right track, but take a look on the Cache Page just below the Difficulty and Terrain Stars. And the word Geocalc is an actual link. Of course you have to download it (very easy). But it runs offline, without the need for an internet connection. Perfect for field work with a Laptop. The cache is not at the posted location. It is within 3km. You can work out the projected landing zone of the alien bio-pod from the comfort of your home. I used Geocalc and a spreadsheet for the caclulations. And then just above the hint: Special Thanks to Gorak for help on the container cammo! Calculated using 'High Accuracy' Formula This would have given you the same results as the Great Circle Calculator. Give it a try sometime. It was written by a Geocacher (fizzymagic), and he makes it available to us for free. Thanks Fizzy. Note: When you read the posts in this thread, that's him with the purple triangle avatar. It was not 100% intuitive to me at first. But it's quite logical when you finally get the hang of it. If you need some help figuring it out, send me an e-mail. Good Luck. P.S. Be glad the Washington State Link didn't work for you. It worked for me, but gives results equivilent to Great Circle Geocalc instead of High Accuracy Geocalc. It's all a little confusing. Quote Link to comment
+Deneye Posted June 16, 2005 Author Share Posted June 16, 2005 (edited) Glad you're on the right track, but take a look on the Cache Page just below the Difficulty and Terrain Stars. And the word Geocalc is an actual link. I don't run Windows so that program is useless to me. Hence the reason for not using it. (besides, the online method has been a helluva lot more fun!) Edited June 16, 2005 by Deneye Quote Link to comment
+fizzymagic Posted June 16, 2005 Share Posted June 16, 2005 Glad you're on the right track, but take a look on the Cache Page just below the Difficulty and Terrain Stars. And the word Geocalc is an actual link. I don't run Windows so that program is useless to me. Hence the reason for not using it. The source code for the calculations done by GeoCalc is cross-platform. You might enjoy building yourself a command-line application from it. I don't do Java, unfortunately, for a number of reasons, and the GUI in windows was painful enough! The GPL-licensed C++ cource code is here. Quote Link to comment
+EScout Posted June 16, 2005 Share Posted June 16, 2005 QUOTE (EScout @ Jun 15 2005, 12:12 PM) Your GPSr probably has a waypoint projection feature. This is the quickest and easiest, especially if you are in the field. Read your manual, and if you can't find it, let us know what model you have and someone can help. Just a matter of a few button pushes to get the new waypoint, then you can save it and goto it. Thanks, but it's not accurate enough. It's hard enough trying keep it still enough to hold a bearing, let alone trying to push a button to lock it there for a projection. If the distance I need to cover was only a few hundred meters or less, then this is the method i'd choose...but since i have to project over about 11,000 meters, it won't even get me into the ball park i'm afraid I don't think you understand. I did the calculation in my GPSr, wtih the info you gave, here many miles from you. It does not require taking a bearing, keeping still or even a GPS position fix. It takes the waypoint you enter, and calculates your projection based on the distance and bearing numbers you enter. As mentioned above it is a great circle calculation. Quote Link to comment
+Deneye Posted June 16, 2005 Author Share Posted June 16, 2005 I don't think you understand. I did the calculation in my GPSr, wtih the info you gave, here many miles from you. It does not require taking a bearing, keeping still or even a GPS position fix. It takes the waypoint you enter, and calculates your projection based on the distance and bearing numbers you enter. As mentioned above it is a great circle calculation. Ok, allow me to rephrase... The only waypoint projection that my GPSr allows is for you to lock it on a direction (based on the electronic compass which bounces around a lot and really needs to be level & stationary.....and whole degrees only, unless you are in mils) and then punch in a distance with an accuracy of 0.1 ..miles or kilometers....the margin for error involved for an 11 kilometer projection is quite unpalatable... Thanks for trying to help though....please keep in mind that what your GPSr can do is not always the same as what others can do. Besides...it's all moot anyway. I found the online resource that does it for me just fine. Quote Link to comment
+Deneye Posted June 16, 2005 Author Share Posted June 16, 2005 The GPL-licensed C++ cource code is here. thanks fizzymagic....maybe i'll delve into it and get something going here. Quote Link to comment
+Wacka Posted June 17, 2005 Share Posted June 17, 2005 If you have Cachemate, when you are on a cache page, there is a menu option called Project waypoint under Calc in the menu. Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.