Latitude & Longitude Conversion
#1

Greetings;

I am using an hp 48gx. Is there any built in function that will allow me to convert latitude and longitude values easily?

By convert I mean from decimal degrees to degrees minutes seconds and back again.

Thanks in advance for any help.

Cheers,

#2

Hi, Robin;

the HP48 has two converting tools that will surely help:

[->HMS] and [HMS->]
I'm not with my own HP48 in hands right now, but you could, please, have a look at both TIME menus: [left-shift][TIME] and [right-shift][TIME]. If I am not wrong, in one of the pages you'll find both converting commands.

(PLease, consider that the characters -> are, in fact, a whole right arrow).

Let us know if you found what you want.

Best regards.

Luiz (Brazil)

#3

Hello Luiz;

You are correct, left shift time on the second page.

I am going to assume [->HMS] is from decimal to hours, minutes, etc. And [HMS->] is from hours, minutes, etc to decimal.

I would like to clarify the formatiing if anyone knows. If I input 55.975056 decimal degrees and use [->HMS] the output is 55.58302016. I believe this translates to 55 degrees 58 minutes 30.2016 seconds. Is this correct? It certainly seems to make sense.

I really appreciate all the help.

Cheers.

#4

Yup. That is the correct format. If you want, it is pretty easy to write a little program that will add in o ' " for display purposes should you want to use it in a fancy display.

TW

#5

Hi, Luiz, good direction on HMS. (RE: HP49G+ HP 48GX )Do you happen to have either the equations or knowledge of an algorithm to work with surface navigation. Conversion from short distance dead reckoning to great circle, etc,? I use short cut math estimating the distance in nautical miles between longitudes as in the vicinity of cos(latitude). While this is good enough for tracking hurricanes at home, the compounding errors for headings and distance when sailing could lose the race.

I plan to research the internet like in "Ask Dr. Math" for equations, but decided to follow up to see if you happened to have anything all ready to share.

Thanks in advance,

Ron

#6

Maybe try a search at http://www.hpcalc.org/.

Regards,
James

#7

Ron,

What kind of "formulas" do you want?

Navigation on the surface of the Earth is no more complicated than applications of spherical trigonometry. A book with MORE than you ever will want to know about this stuff is "Textbook on Spherical Astronomy" by Smart.

Basically, if you imagine a triangle drawn on the surface of the Earth, then you can describe the angles between adjacent sides (i.e. where the sides meet) as A, B, and C (other than being on the surface of the sphere, these angles are the same as the interior angles of a plane triangle - i.e. the angles you would measure with a protractor). Opposite each of these interior angles is a portion of a great circle, of arc length respectively a, b, and c (where a, b, and c are opposite the relevant angles, and the angular value is the angle that the portion of the great circle subtends as viewed from the center (inside) of the sphere.

Then, the relations between angles and sides are

sin a sin b sin c
------- = ------- = ------- (the "sine" formulae),
sin A sin B sin C

and cos a = (cos b)*(cos c) + (sin b)*(sin c)*(cos A)

(the "cosine" formulae, with appropriate permutations).

Some practice in envisioning and drawing spherical triangles relevant to the problem at hand is necessary. For starters, imagine a spherical triangle defined by the North Pole, a point on the equator at longitude zero, and a point on the equator at longitude 90 degrees. Then, the interior angles will all be 90 degrees and the lengths of the sides will also all be 90 degrees.

For navigation in general, you probably know your current location (in latitude and longitude) and your destination (also in latitude and longitude) and want to know what direction you need to go in order to reach your destination in the quickest possible manner (ignoring windage, current, etc. - i.e. what is the heading of your destination) and how far away is your destination.

The side of the triangle between you and your destination is then the interesting one. Its length (in angular measure, converted to linear measure via the radian formula) and direction (i.e. angle between it and due north) are what you need to calculate.

To do this, draw a spherical triangle with corners at the north pole, your current location, and your destination. Then, the interior angle at the top (A) will be the difference on longitudes of your current location and destination, and two of the sides (b and c) will have angular lengths that are 90 degrees minus the latitudes.

From the cosine formula above, you can then find the length (a) of the third side: you know A and b and c. Convert a from angular measure to linear distance (the distance to your destination) using the radius of the Earth as (approximately!) 6370 km.

Once you know a, you can find your desired heading by finding the angle b (assuming you are now at the point which is the junction of sides a and c.

Be careful when taking inverse trig functions!

These instructions are specifically a bit incomplete in that I hope you will draw some triangles and derive the relevant results!

Note that you can also accomplish much of this with vector products. For instance, the dot product (done with unit vectors) will give you the angle between two points on the Earth: convert your lat, lon (of both current position and destination) to x,y,z coordinates

x = cos(lat) * cos(lon)
y = cos(lat) * sin(lon)
z = sin(lat)

and take the dot product to get the cosine of the angular separation. use the radius of the Earth, as above, to then get the distance to your destination.

All of this assumes a truly spherical Earth, which ain't quite the case, but close enough unless you are trying to land ballistic missiles on the bad guys a continent away (in which case you may miss by 20-40 kilometers)!!

#8

I forgot about the formatting conventions!

The "sine" formulas should have

sin a

over

sin A


and similarly for b,B and c,C.

Also, I should have said:

"Once you know a, you can find your desired heading by finding the angle B ..." (angles are capitals!)

#9

[quote]
Ron,

What kind of "formulas" do you want?

*************************************

Don't recall using the word "formulas" or "formulae." The nearest I recall was equations.

I do appreciate the time you took to expound on what must be your favorite subject, math in general, trig in particular. I continue in my efforts to communicate better the first time, but have a tendency to cut the corners a little close to the line. What I intended to convey when I approached the forum was that I could use an algorithm suitable for use in the 49g+ to quickly calculate heading and distance based on the spherical model of the earth. My experience with forums has been based on something like a barter economy - I exchange a service I can perform to members who contribute to others who borrow from others, etc............ So far I have had tremendous success exchanging ideas and services in photography and math (mathcad). I figured (no pun) that after 30 years making good use of programable calculators, beginning with the TI-59, my experience might contain some trick or treat here or there that just might be the "thing" (formula maybe?) to contribute in exchange for all the favors I am likely to request.

Thanks for your response. I will see if I can reduce it to an algorithm or two. If I perform a complete analysis of the ballistics problem you offered I would expect the need to solve at least one differential equation to account for drag in the atmosphere, right?

Ron

PS you like oxymorons? I saw a car today with conflicting chrome labels on the trunk "Limited" "Infinity"

#10

Sorry, I didn't notice this thread earlier. The answer is easy: see Ed Williams' Aviation Formulary, at http://williams.best.vwh.net/avform.htm. I've successfully used the equations there to implement C++ and Java classes for use in flight planning and navigation programs.

Best,

--- Les

[http://www.lesbell.com.au]

#11

WOW!

Thank you, Les! Everything I wanted to see plus a whole course in navigation. I'm sure the translations will go smoothly and I can reduce what I want to 48 and 49 g+. Should be fun.

For the benefit of others who might need some of this, the basic file is previewed as 32 pages, but at first glance might expand with several imbedded urls. Looks to me like a complete course, excuse the play on words.

Thanks again, Les

Ron

#12

Quote:
PS you like oxymorons? I saw a car today with conflicting chrome labels on the trunk "Limited" "Infinity"

Well, in calculus, functions often have limits as they approach infinity... :-)

#13

here is a homemade equation to evaluate the distance between two given coordinates

dist=pi*6371*asin(sqrt(sq(6371*sin(lat2-lat1))+sq(6371*cos(lat2-lat1)*sin(lon2-lon1)))/6371)/180

the "6371" is the average earth radius in kilometers. you can change it for miles (make an if() if you wish ;)

can anyone estimate the precision of this equation?

i am working on a formula to consider the diff between the polar and equatorial radius.

#14

the irony of the superior technical/math training in Japan and a "limited" infinity was enjoyable to say the least. Yes, we do have the limits of the errors of our calculus which gives me cause to wonder if the differential doesn't have something to do with "chaos" as it creeps into such things as turbulence and jets. At least most of us seem satisfied with "Close enough for all practical purposes." I still want my jets limited before they approach infinity.

Thanks for the thoughts and chuckles,

Ron



Possibly Related Threads…
Thread Author Replies Views Last Post
  HP 35s polar/rectangular conversion CD Dodds 6 2,597 11-28-2013, 02:39 PM
Last Post: Dieter
  [WP 34s] Pressure Conversion Factors Timothy Roche 8 3,083 11-04-2013, 07:17 PM
Last Post: Dave Shaffer (Arizona)
  More programs for polar-rectangular conversion on HP Prime Michael de Estrada 4 1,935 11-04-2013, 12:43 AM
Last Post: Michael de Estrada
  HP Prime: Conversion factors Paul Townsend (UK) 19 4,869 08-27-2013, 09:19 AM
Last Post: Nigel J Dowrick
  WP34S conversion, yet another but with a difference Geoff Quickfall 23 5,818 06-22-2012, 02:54 PM
Last Post: Marcus von Cube, Germany
  [WP-34s] Conversion proposal Alexander Oestert 19 4,689 06-15-2012, 05:36 AM
Last Post: fhub
  [WP-34s] IR conversion of 20b Alexander Oestert 3 1,503 05-18-2012, 05:38 PM
Last Post: Harald
  FWIW - km to miles conversion factor on a four-banger calculator Gerson W. Barbosa 37 8,364 10-19-2011, 03:49 PM
Last Post: Martin Pinckney
  [WP34S] [Manual] Units conversion question E.Lub_EU 9 2,473 09-22-2011, 11:24 PM
Last Post: Marcus von Cube, Germany
  Degrees conversion for trigonometric function Beth Snipes 2 1,069 08-30-2011, 03:32 PM
Last Post: Beth Snipes

Forum Jump: