Rectangular to Polar on the HP35s « Next Oldest | Next Newest »

 ▼ Howard Boardman Junior Member Posts: 30 Threads: 10 Joined: Jul 2007 07-31-2007, 12:27 PM I have some surveying programs I'm trying to put into the 35s. They were originally written for the 33s. One of the steps is a rectangular to polar conversion. There is no "y,x->è,r" button on the 35s. What is the equivalent sequence of this on the the 35s? I am just confused by the manual. Thanks for your help. ▼ Gene Wright Posting Freak Posts: 1,545 Threads: 168 Joined: Jul 2005 07-31-2007, 12:45 PM The HP35s does not convert P->R and R->P the way previous HP calculators have done. There is no provision that does this exactly the same way. The 35s has a DISPLAY option which changes the 5i5 style complex number (rectangular) to the magnitude THETA angle style complex number (polar). If you're just showing results one way or the other, change the display mode. If you need the magnitude and angle of a rectangular complex number, then the ABS function will grab the magnitude and the ABS function will grab the angle portions of a complex number, even if the display mode is "rectangular". If you need the X and Y coordinates of a polar form complex number, then it is a bit more complicated. First, find the magnitude and angle as described above. Then transform these into the X and Y coordinate as: X = magnitude x COS theta and Y = magnitude x SIN theta Be aware that for arguments VERY close to 90 degrees, the COS function is less accurate than for other angles. Rather than 9, 10+ decimal positions being accurate, it drops to 4 or 5 positions. You can read more about this in the learning module found here: You can see all the learing modules available for the 35s by going here: Miguel Toro Member Posts: 239 Threads: 55 Joined: Sep 2006 07-31-2007, 01:00 PM You can use this handy routine written by Les Wright. Miguel ▼ Howard Boardman Junior Member Posts: 30 Threads: 10 Joined: Jul 2007 07-31-2007, 01:15 PM Thanks! That should help... what is REGZ in the program? ▼ Gene Wright Posting Freak Posts: 1,545 Threads: 168 Joined: Jul 2005 07-31-2007, 01:36 PM It is essentially a RCL stack level Z instruction. You enter it by pressing: EQN then RDN (the roll down key) and then move the cursor under the Z stack level and press ENTER. ▼ Alain Mellan Member Posts: 55 Threads: 5 Joined: Jul 2007 07-31-2007, 05:08 PM I didn't know about that (should have RTFM :-), so I entered REGZ as EQN RCL R RCL E RCL G RCL Z ENTER ... and it works. I would seem that equations are really parsed. So I tried entering RE and IMG without much success. :-) But who knows? there may be some hidden function there? -- alain. Les Wright Posting Freak Posts: 1,368 Threads: 212 Joined: Dec 2006 08-01-2007, 10:44 PM Despite my little routine, I really lament the lack of a fully range of commands to handle complex numbers and rectangular-polar conversions. Restoring the familiar P->R and R->P commands would be a good start. xiy to rthetaa display change is nice, and the abs and arg commands can let you get the r and theta values of the vector in polar form. It is also easy enough to create the required complex number from elements of the stack--if Re(z) is in y and Im(z) in x, i * + does the trick. So this sequence would replicate the 33s y,x -> @, r command. ```x<>y i * + ARG LASTx ABS ``` But there seems to be no easy way to create a polar form complex number from stack elements that I can feed into my little routine to give the real and imaginary components of the rectangular form. One seems to have to enter it manually. For example, if I want to create 5@60, I have to enter 5 theta 60. I can't put 5 ENTER 60 on the stack and automate the procedure easily to do it for me. In the 42S, I would simply make sure I was in polar mode and execute 5 ENTER 60 COMPLEX. If anyone has a painless way to replicate the @,r -> y,x conversion from the 33s, I would be grateful! I really would vote for a more logical command set in this regard in the 35sii. If ROM is a premium, the calc can really afford to lose those keyboard clogging metric/imperial conversions. Les ▼ Les Wright Posting Freak Posts: 1,368 Threads: 212 Joined: Dec 2006 08-01-2007, 11:02 PM Actually, I revisited my basic complex analysis books and I think I have a solution for the @,r -> y,x conversion. This assumes the angle is in the y register and modulus in the x, just as it would be for the 33s function: ```x<>y COS LASTx SIN i * + * (send off to my little routine or hopefully a better one to decompose to Re and Im, returns Re in y register, Im in x) x<>y (to put x component in x register and y in y, as is done on 33s) ``` This alternative assumes the calc is in degree mode: ```x<>y ->RAD i * e^x * (decompose to Re and Im as you wish) x<>y ``` Let's say the first one is under LBL P. I try this in degree mode: 3 ENTER 4 / ATAN 5 XEQ P ENTER and I get 4 returned in the x register, 3 in the Y, exactly as it should be! Cumbersome, but the programs involved are very short, and it seems to work except when rounding error or the damned cosine bug compromises accuracy in certain cases. Les ▼ Les Wright Posting Freak Posts: 1,368 Threads: 212 Joined: Dec 2006 08-01-2007, 11:51 PM Actually, that last one was way to complicated. I prefer this: ```x<>y COS LASTx SIN REGZ * x<>y LASTx * ``` There is no point in computing the modulus and argument back and forth when you have it in the first place! In short the following two little subroutines, which I put under the same label P, replicate the 33S polar-rectangular conversions, and I think most succinctly answer the OP's question: ```(P001) LBL P x<>y i * + ARG LASTx ABS (P009) RTN (P010)x<>y COS LASTx SIN REGZ * x<>y LASTx * (PO19) RTN ``` Examples (in degrees mode): 4 ENTER 3 / ATAN 25 XEQ P002 returns 20 in the y register, 15 in the x. 8 ENTER 6 XEQ P010 returns 53.130123542 (degrees) in the y register, 10 in the x--exactly what you would expect for a Pythagorean triple of 6-8-10. I think the absence of the well loved conversion routines will inspire most serious users of the 35s to have subroutines like these in memory, and I hope that revisions of the machine rectify this. And, of course, that nuisance cosine bug! Les Edited: 2 Aug 2007, 2:00 a.m. after one or more responses were posted ▼ Howard Boardman Junior Member Posts: 30 Threads: 10 Joined: Jul 2007 08-02-2007, 01:58 AM Thanks to all for the subroutine advice. So far I did a little modification of the little subroutine and it seems to work fine. I'm doing surveying programs for traversing, area by coordinates and so on. The following seems to work quite well for rect. to polar, although I get a negative azimuth when in the 4th quadrant (-x,y) which is entirely fine: S001 LBL S S002 i S003 * S004 + S005 ABS S006 LASTx S007 ARG S008 360 S009 RMDR S010 90 S011 - S012 +/- S013 x<>y S014 RTN A few extra steps I realize but for the programs I had created it was easier to modify this one than to modify the others. Atleast HP had the sense to allow XEQ and GTO within programs. Its hard to make a calculator to please all professions, but at least with subroutines we can be creative and work around short-commings. Edited: 2 Aug 2007, 2:00 a.m. ▼ db (martinez, ca.) Posting Freak Posts: 1,322 Threads: 115 Joined: Jul 2005 08-02-2007, 11:32 PM Howard; Tight stuff man. WAY better than mine and my favorite here so far. Leave it to a surveyor. You going polar to rectangular next? Walter B Posting Freak Posts: 4,587 Threads: 105 Joined: Jul 2005 08-02-2007, 01:21 AM Quote: I really would vote for a more logical command set in this regard in the 35sii. If ROM is a premium, the calc can really afford to lose those keyboard clogging metric/imperial conversions. Fully agreed! :) There are by far more important functions on the waiting list for keyboard space. Trent Moseley Senior Member Posts: 406 Threads: 47 Joined: Jul 2005 07-31-2007, 10:25 PM NT Reth Senior Member Posts: 556 Threads: 9 Joined: Jul 2007 08-02-2007, 03:07 AM Here is my version :) cheers, reth

 Possibly Related Threads... Thread Author Replies Views Last Post HP35s Program Four Slings Lift Calculation Jean-Marc Biram (Australia) 2 1,820 12-16-2013, 07:21 PM Last Post: Jean-Marc Biram (Australia) HP35s Calculator Max Rope Tension Program Jean-Marc Biram (Australia) 10 3,630 12-12-2013, 12:03 AM Last Post: Jean-Marc Biram (Australia) HP 35s polar/rectangular conversion CD Dodds 6 2,240 11-28-2013, 02:39 PM Last Post: Dieter Rectangular to Polar, Polar to Rectangular – One more time Jeff O. 0 868 11-06-2013, 11:32 AM Last Post: Jeff O. More programs for polar-rectangular conversion on HP Prime Michael de Estrada 4 1,587 11-04-2013, 12:43 AM Last Post: Michael de Estrada OT--Hyperbolic Polar<-->Rectangular Coordinates Matt Agajanian 2 979 09-30-2013, 08:53 PM Last Post: Matt Agajanian Trouble entering a HP35s program line Arno 2 1,247 04-05-2013, 06:28 PM Last Post: Arno HP35s scientific calculator GREG W THOMAS 4 1,549 03-22-2013, 06:49 AM Last Post: Thomas Radtke [WP 34s] Polar & Rectangular Number Display Jeff O. 9 2,362 01-12-2013, 05:08 AM Last Post: fhub HP35s "MEMORY CLEAR" flashes Mark Paris 1 1,216 08-31-2012, 07:35 PM Last Post: Bart (UK)

Forum Jump: