Post Reply 
(50g) Speed Complex entry (42s way)
03-16-2016, 09:54 PM (This post was last modified: 03-18-2016 03:20 PM by Vtile.)
Post: #1
(50g) Speed Complex entry (42s way)
Hello,
Got so accustomed on the HP35s complex entry that 50g parenthesis and comma separation not to mention alpha+Rshift+6 started to feel painfull so I created these two small programs to allow automatic creation of complex number from the parts entered to the stack.

First application is independent, but the 2nd aplication/macro is calling the first one.
Code:
<< i * SWAP + >> 'Re±Im' STO
You enter in RPN: Re [SPC] Im [Re±Im]
.. and it creates a complex number representation from rectangular entry, but shown in the mode you have chosen.

Code:
<< DUP2 COS * UNROT SIN * Re±Im >> 'YɑX' STO
You enter in RPN: ABS [SPC] ARG [YɑX]
.. and it creates a complex number representation from polar entry, but shown in the mode you have chosen. Note that I haven't tested it in the radian mode almost at all, but it seems to work also in radians flawlessly (why not).

I also suggest creating a polar <-> rectangular toggler.

All bug reports and improvement suggestions are welcome.

(03-18-2016 02:20 PM)Vtile Wrote:  Late at yesterday I were watching some HP50g video on the net and noticed a program which put values from the stack to complex number, I figured out that it looks up which mode the calc is and builds the complex number based on that information so I made something similar.

Edit. It seems that the R→C command found in the PRG/TYPE is making only rectangular representation of the complex no matter which mode the calculator is in. Program below is using that now command for Cplx creation, else is the MODE wrapper so the type is based on the coordinate mode the calc is in (polar/rect) so you can type both polar and rect form and chose which one you need / want to enter by selecting coordination system with coordinate toggler program.

Code:
«
«
-16 FS? -15 FS? -103 FS? → Y X C
    «
  IF 'C==0' THEN
     "Not in Complex mode, Exit." MSGBOX
  ELSE
   IF 'Y==0' THEN 
      R→C // command in PRG/TYPE i just found.
   ELSE 
        IF 'X==0' THEN
           DUP2 COS * UNROT SIN *
          R→C // command in PRG/TYPE i just found.
        ELSE 
      "Spherical, error." MSGBOX
      END
   END
  END
   »
» 'MKE-C' STO

Toggler program (copied somewhere on the net, propably from 'rolinychupetin' homepage I accidentally did find somewhere at time.)
Code:

« -16 FS? → X 
  « IF 'X==0' THEN
      CYCLIN
    ELSE
      RECT
   END
 »
» 'R↔Po' STO
Find all posts by this user
Quote this message in a reply
03-17-2016, 04:52 AM
Post: #2
RE: (50g) Speed Complex entry (42s way)
Very nice! On the second program,
Code:

<< DUP2 COS * UNROT * SIN * Re±Im >> 'XɑY' STO
I think you want
Code:

<< DUP2 COS * UNROT  SIN * Re±Im >> 'XɑY' STO

I think X and Y may be swapped (if Y is the angle)?

~Mark
Find all posts by this user
Quote this message in a reply
03-17-2016, 12:36 PM (This post was last modified: 03-17-2016 12:58 PM by Vtile.)
Post: #3
RE: (50g) Speed Complex entry (42s way)
(03-17-2016 04:52 AM)mfleming Wrote:  Very nice! On the second program,
Code:

<< DUP2 COS * UNROT * SIN * Re±Im >> 'XɑY' STO
I think you want
Code:

<< DUP2 COS * UNROT  SIN * Re±Im >> 'XɑY' STO

I think X and Y may be swapped (if Y is the angle)?

~Mark
Y is the angle yes, it seems I made a typo last night in code. Now when you mention it, I do notice that my original naming of the polar form program doesn't follow much logic, yes I swap the X & Y to fit in stack naming style. (The code is in correct order, as it is more natural to enter ABS ARG, than ARG ABS atleast for my left to right reading OCR brains Smile )

Indeed good catch, thx.

-Vtile
Find all posts by this user
Quote this message in a reply
03-17-2016, 02:28 PM
Post: #4
RE: (50g) Speed Complex entry (42s way)
Yes indeed. I named your second program 'R (symbol plus/minus)(symbol theta)' to match the intent of your first program. Sorry to spell out the symbols, I don't know how to insert them here.

Both programs are now in my shortcut folder Smile

~Mark
Find all posts by this user
Quote this message in a reply
03-18-2016, 02:20 PM (This post was last modified: 03-18-2016 03:20 PM by Vtile.)
Post: #5
RE: (50g) Speed Complex entry (42s way)
Late at yesterday I were watching some HP50g video on the net and noticed a program which put values from the stack to complex number, I figured out that it looks up which mode the calc is and builds the complex number based on that information so I made something similar.

Edit. It seems that the R→C command found in the PRG/TYPE is making only rectangular representation of the complex no matter which mode the calculator is in. Program below is using that now command for Cplx creation, else is the MODE wrapper so the type is based on the coordinate mode the calc is in (polar/rect) so you can type both polar and rect form and chose which one you need / want to enter by selecting coordination system with coordinate toggler program.

Code:
«
«
-16 FS? -15 FS? -103 FS? → Y X C
    «
  IF 'C==0' THEN
     "Not in Complex mode, Exit." MSGBOX
  ELSE
   IF 'Y==0' THEN 
      R→C // command in PRG/TYPE i just found.
   ELSE 
        IF 'X==0' THEN
           DUP2 COS * UNROT SIN *
          R→C // command in PRG/TYPE i just found.
        ELSE 
      "Spherical, error." MSGBOX
      END
   END
  END
   »
» 'MKE-C' STO

Toggler program (copied somewhere on the net, propably from 'rolinychupetin' homepage I accidentally did find somewhere at time.)
Code:

« -16 FS? → X 
  « IF 'X==0' THEN
      CYCLIN
    ELSE
      RECT
   END
 »
» 'R↔Po' STO
Find all posts by this user
Quote this message in a reply
Post Reply 




User(s) browsing this thread: 1 Guest(s)