My 2nd and 3rd Prime Programs  Printable Version + HP Forums (https://archived.hpcalc.org/museumforum) + Forum: HP Museum Forums (https://archived.hpcalc.org/museumforum/forum1.html) + Forum: Old HP Forum Archives (https://archived.hpcalc.org/museumforum/forum2.html) + Thread: My 2nd and 3rd Prime Programs (/thread254357.html) 
My 2nd and 3rd Prime Programs  Jeff O.  10302013 Perhaps pending more discussion in my "My First Prime Program" thread, it appears that for the time being, I will need two programs for Polar conversions: EXPORT ANG(X,Y)
And: EXPORT MAG(X,Y) The angle routine will require some work to get things in the right quadrant for all inputs, of course.
With the above, converting 3 + i4 (represented as 4 in level 2 and 3 in level 1 of the stack) to polar form requires the following: 4 Is there any way to assign the ANG and MAG programs to two of those temptinglooking blank soft keys at the bottom of the HOME screen?
^{I promise this won't be series where I publish every trivial thing I figure out how to do.} Edited: 30 Oct 2013, 4:15 p.m.
Re: My 2nd and 3rd Prime Programs  Michael de Estrada  10302013 As Tim W pointed out to me, there's really no need to write a polartorectangular program, since the conversions can be done from the keyboard using complex numbers. 1) In home settings set complex number format to (a,b) and check the box for "Allow complex output from real input". 2) Enter the rectangular coordinates x,y as (x,y) into the stack/history. 3) Key in Shift x (angle symbol) to transform the coordinate to polar form (magnitude,angle). 4) Repeat Shift x to return to rectangular form.
For example (3,4) > (5<angle>53.13) assuming angle mode is degrees.
Re: My 2nd and 3rd Prime Programs  Michael de Estrada  10302013 Also, FWIW, I wrote a program to do this before Tim W chimed in as follows:
EXPORT PR_Convert() Re: My 2nd and 3rd Prime Programs  Jeff O.  10302013 Hi Michael, Regarding your PR_convert program, rest assured that I tried it. It works great, but as I indicated in my first post, I'd like to be able to take the values from the stack and return the results to the stack. As far as I can tell, there is no way for me to grab the results from your program for use in a subsequent calculation, is there?
^{edited for typos} Edited: 31 Oct 2013, 7:40 a.m. after one or more responses were posted
Re: My 2nd and 3rd Prime Programs  cyrille de Brébisson  10312013 hello, how about
EXPORT ANG(X,Y)
Re: My 2nd and 3rd Prime Programs  Michael de Estrada  10312013 Quote: You can retrieve them by assigning them to the reserved system real variables X,Y,R,<theta>, i.e. X:=X1*COS(X2) Y:=X1*SIN(X2) R:=sqrt(X1^2+X2^2)
<theta>:=ATAN(X2/X1) Edited: 31 Oct 2013, 3:29 a.m.
Re: My 2nd and 3rd Prime Programs  Jeff O.  10312013 Thanks, I'll try that.
Re: My 2nd and 3rd Prime Programs  Jeff O.  10312013 Even better! Thanks!
