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.
Rectangular to Polar on the HP35s


« Next Oldest  Next Newest »

▼
07312007, 12:27 PM
▼
07312007, 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:
07312007, 01:00 PM
You can use this handy routine written by Les Wright. Miguel ▼
07312007, 01:15 PM
Thanks! That should help... what is REGZ in the program? ▼
07312007, 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. ▼
07312007, 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.
08012007, 10:44 PM
Despite my little routine, I really lament the lack of a fully range of commands to handle complex numbers and rectangularpolar 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 stackif 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 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 ▼
08012007, 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 This alternative assumes the calc is in degree mode:
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
▼
08012007, 11:51 PM
Actually, that last one was way to complicated. I prefer this:
x<>y 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 polarrectangular conversions, and I think most succinctly answer the OP's question:
(P001) LBL P 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 xexactly what you would expect for a Pythagorean triple of 6810. 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 ▼
08022007, 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 shortcommings.
Edited: 2 Aug 2007, 2:00 a.m.
08022007, 01:21 AM
Quote:Fully agreed! :) There are by far more important functions on the waiting list for keyboard space.
07312007, 10:25 PM
NT
08022007, 03:07 AM
Here is my version :) 