HP35s Entering complex number arguments - Printable Version +- HP Forums (https://www.hpmuseum.org/forum) +-- Forum: HP Calculators (and very old HP Computers) (/forum-3.html) +--- Forum: General Forum (/forum-4.html) +--- Thread: HP35s Entering complex number arguments (/thread-4550.html) HP35s Entering complex number arguments - Merwedv - 08-20-2015 10:41 PM I feel that I am missing something, but I am struggling to enter non-trivial arguments for complex numbers in RPN mode on the HP35s. For example, how would I enter something like "5 theta pi"? When I try it the obvious way, I get a syntax error. Or if I would like to do something like "2*2 + 4i"? Is there a way to use the value of the stack registers as the arguments for complex numbers? I am also not able to use stored values for the arguments for complex numbers. I really hope there is a simple way to do this, and that I do not have to write programs to do simple things like this, something that I am completely unfamiliar with. BR, RE: HP35s Entering complex number arguments - Dieter - 08-21-2015 05:58 AM (08-20-2015 10:41 PM)Merwedv Wrote:  For example, how would I enter something like "5 theta pi"? When I try it the obvious way, I get a syntax error. Or if I would like to do something like "2*2 + 4i"? I do not have a simple solution for the theta case, but the latter is simple and rather straightforward: 2 [ENTER] 2 [x] 4 [i] [+]. Assuming the calculator is set to RPN mode. In ALG mode you simply type "2x2+4i". ;-) (08-20-2015 10:41 PM)Merwedv Wrote:  Is there a way to use the value of the stack registers as the arguments for complex numbers? Sure. If the real and complex parts are in Y and X, simply press [i] [x] [+] to get y+ix. (08-20-2015 10:41 PM)Merwedv Wrote:  I am also not able to use stored values for the arguments for complex numbers. This can be done in the same way: [RCL] B [i] [x] [RCL] A [+] Or, saving one stack register: [i] [RCL][x] B [RCL][+] A. Dieter RE: HP35s Entering complex number arguments - Merwedv - 08-21-2015 09:05 PM Hi Dieter, Thanks so much for your response. It does seem very obvious now that you clarified. I was regarding "i" as a operand, rather than an actual number, albeit complex, and that completely threw me off the right track. (led astray by the xiy notation). As for "r /_ theta", since it is merely a shorthand of r*e^(j*theta), it is neither an operand nor a "number"(like i) and cannot be treated as such. I spend some time learning how to program the thing (not as difficult as I anticipated), and did the following to be able to use the X and Y registers to enter a complex number in the r /_ theta notation: Code: ``` A001 LBL A A002 REGYxCOS(REGX) A003 ixREGZxSIN(REGY) A004 + A005 RTN``` So it will take the Y-reg as the magnitude, and the X-reg as the angle, and place the complex result in X-reg, in either rectangular or polar notaion, depending on the diplay mode. Cheers, Merwe RE: HP35s Entering complex number arguments - Dieter - 08-21-2015 10:03 PM (08-21-2015 09:05 PM)Merwedv Wrote:   Code: ```A001 LBL A A002 REGYxCOS(REGX) A003 ixREGZxSIN(REGY) A004 + A005 RTN``` Why don't you simply put it on a single line (and save one stack register)? Code: `REGY*COS(REGX)+i*REGY*SIN(REGX)` You may also define this as an equation, so a simple EQN ENTER will turn X and Y into a complex number. However, I would prefer a stack drop like this: Code: ```T          T Z   XEQ A  T Y    =>    Z X         (complex number)``` Which may be implemented in a short program this way: Code: ```LBL A R↓ REGX*COS(REGT)+i*REGX*SIN(REGT) X<>Y CLx + RTN``` Dieter RE: HP35s Entering complex number arguments - Merwedv - 08-24-2015 09:14 AM Yeah, your way is much better. Thanks again.