HP Forums
DMS conversion in geometry numeric view - Printable Version

+- HP Forums (https://www.hpmuseum.org/forum)
+-- Forum: HP Calculators (and very old HP Computers) (/forum-3.html)
+--- Forum: HP Prime (/forum-5.html)
+--- Thread: DMS conversion in geometry numeric view (/thread-2332.html)



DMS conversion in geometry numeric view - rls43185 - 10-24-2014 04:08 PM

Why won't this expression produce an angular value in HMS from the GEOMETRY NUMERIC VIEW on the HP Prime?
>HMS(ORDINATE(POLAR-COORDINATES(GA-GC)))
GA and gc are valid and the equation produces the correct answer in decimal degrees.


RE: DMS conversion in geometry numeric view - Tim Wessman - 10-24-2014 05:06 PM

The geometry application is essentially a front end to CAS commands. The CAS does not have nor understand DMS values. You have to use other angular units up until the final display moment or else it won't work for you.


RE: DMS conversion in geometry numeric view - rls43185 - 10-26-2014 10:17 PM

My mistake Tim and apologies. I referred to you as Joe. Thanks and see below for a cheap patch. Your response is understood. HMS has always been a display conversion rather than a working unit since day one( 1973?). I own too many HP RPN units too list here and I fully understand that part so I'll try to rephrase the question. In a CAS how do I input/convert and convert back/output to hexigesimal format. I have worked up a lengthy expression (basically FP/60 twice) that works but outputs the IP(degrees), FP( MINUTES), FP/FP (seconds) all as interger values. I'll post the expression if you are interested.
Back to the problem: How do we convert from decimal values to hexigesimal and back in a CAS? The RPN way is to hit a button, rpl is a HMS conversion command, the 35s is a button however I have written an equation for polar to rectangular that is a bit more practical than the decimal only display format. It almost seems like HP has ignored that many professionals actually work in hexigesimal. Any thoughts are greatly appreciated. Thanks!


RE: DMS conversion in geometry numeric view - Marcus von Cube - 10-27-2014 07:01 PM

(10-26-2014 10:17 PM)rls43185 Wrote:  Back to the problem: How do we convert from decimal values to hexigesimal and back in a CAS?

I see two ways (to be implemented in the firmware):
  1. Add a conversion function that returns a string. The inverse would accept a string and return a floating point number.
  2. Add some formatting commands similar to printf/scanf with special DMS format codes.

The first option might even be implemented in user code.


RE: DMS conversion in geometry numeric view - rls43185 - 10-27-2014 09:44 PM

Thanks Marcus. In the NUM screen of Geometry app I have added the following:
DEGREES (label)
450-((IP(ordinate(polar_coordinates(GA-GC)))) MOD 360)

MINUTES (label)
ABS(IP(FP(ordinate(polar_coordinates(GA-GC)))*60))

SECONDS (label)
ABS(FP(FP(ordinate(polar_coordinates(GA-GC)))*60)*60)

This provides a conversion but looks sloppy as it lacks the proper symbology. It works none the less and does show up in plot view which is nice. It does convert from argand plane to 360 north azimuth. just assume some coordinates for points GA and GC.