10-02-2015, 02:49 PM
Post: #1
 Tim Wessman Senior Member Posts: 2,293 Joined: Dec 2013
Had an unusual support request come in today. An elderly gentleman wrote a program for his 20S a long time ago and the unit recently died. He got a 35s which he seems happy with, but isn't sure how to translate "his program" to it...

I'd be appreciative if someone could aid. I am not knowledgeable enough about the 20S to be much help... :-(

Of the top of my head I'd guess it is a polar/rect conversion thing???

Many thanks.

Quote:PRGM
LBL A
1
Input
RCL 2
R->
Swap
Input
RCL1
R->
Swap
Input
RCL2
Sin
P<-
+
RCLO
=
R->
Swap
Input
RCL2
Cos
X
RCL1
Sin
P<-
Swap
Acos
RTN
Prgm

Sto 0 ….
Sto 1 …
Sto 2…
XEG

Lab A 1. Result
Swap 2. Result

TW

Although I work for HP, the views and opinions I post here are my own.
10-02-2015, 05:39 PM
Post: #2
 Dave Britten Senior Member Posts: 2,321 Joined: Dec 2013
It appears to be doing something like this.

A couple of notes:

- This is 32S code. The 35S doesn't have proper rectangular/polar conversion functions.
- Registers 0, 1, and 2 have been replaced with A, B, and C respectively.
- I'm making the assumption that "R->" and "P<-" are referring to "RShift, ->R" and "LShift, ->P", the to-rectangular and to-polar conversion functions.
- Without any test cases, I can't be certain that this is actually working as intended (I don't have my 20S with me at the moment to feed arbitrary figures into and compare results).
- The 20S takes its arguments in the order x, y or r, θ (and returns them in that order, with y or θ in the display). Thus I may have messed up a swap somewhere.

Code:
LBL A RCL C 1 θ,r->y,x RCL B x<>y θ,r->y,x RCL C SIN x<>y y,x->θ,r x<>y RCL A + x<>y θ,r->y,x RCL C COS RCL B SIN * x<>y y,x->θ,r ACOS RTN
10-02-2015, 06:13 PM
Post: #3
 Thomas Klemm Senior Member Posts: 2,115 Joined: Dec 2013
I'll give it a try though I could be completely wrong:

Code:
COS(C)*COS(B)+i*SIN(C) ABS LASTx ARG RCL+ A REGY*COS(REGX)+i*COS(C)*COS(B) ARG LASTx ABS ACOS

As with Dave's program for the HP-32S the registers A, B and C are used.

Example:
30 STO A
40 STO B
50 STO C
R/S

84.96
60.38

Does this make sense?

Cheers
Thomas
10-02-2015, 07:30 PM (This post was last modified: 10-02-2015 07:32 PM by Tim Wessman.)
Post: #4
 Tim Wessman Senior Member Posts: 2,293 Joined: Dec 2013
Thanks. It does make sense. I will pass it on to the gentleman and see if it helps. Much appreciated!

Maybe someone should have put r<=>p conversions into the 35s... :-P

TW

Although I work for HP, the views and opinions I post here are my own.
 « Next Oldest | Next Newest »

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