HP Forums

Full Version: 32s program help
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

I have a 32s and want to have a program that will slove:

2 times the square root of x squared plus y squared.

I have very little experance with the 32s, so please give me the information one line at a time on one page.

Thanks very much.

Step by step, the following will do what you want.

First, do a master clear:

press the gold shift key, then the back arrow key. This will give you four choices in the display. Press the key under the little arrow under the ALL label (the fourth key from the left, y^x)


Now enter the program:

press shift, then R/S. This executes the shifted PRGM function, to put the calculator in program entry mode. The display should read PRGM TOP


press shift, then 4. This executes the shifted LBL/RTN function to bring up a menu of choices in the display. The display should read LBL RTN PSE


press the square root x key under the little arrow under LBL. The display should read 001 LBL _ (with a little A..Z below that.)


press the square root x key. This chooses the letter A for the program label. You could press any other key that has a letter to its lower right to choose that letter for your label. Assuming you pressed the square root key, the display should read A01 LBL A


press shift, then 7. This executes the shifted P<->RECT function to bring up a menu of choices in the display. The display should read y,x->theta,r theta,r->y,x. (I have substituted "theta" for the greek letter that is actually displayed.) press the square root x key to choose the y,x->theta,r function. The display should read A02 y,x->theta,r


press 2, the display should read A03 2_


press X (the multiplication key), the display should read A04 X


press shift, then 4 to execute the shifted LBL/RTN function. The display should read LBL RTN PSE


press the LN key under the little arrow under RTN to choose the RTN function. The display should read A05 RTN.


press shift, then R/S. (You may alternatively just press the C key.) The display should return to normal. If you followed the above steps exactly, it should read 0.0000 (may vary, depending on your display mode).


To use the program, key in your y value, press enter, then key in your x value. Then press XEQ. The display should read XEQ _, with the little A..Z below that. Press the square root key to choose label A, or the corresponding key if you chose another letter. The program will run and display your answer.


There are a number of methodologies for programming the routine you desired. For example, it could square the x value, then square the y value, then add them, then take the square root. I chose to use the built in polar to rectangular conversion function since it performs those steps in one function and one program step rather than requiring several program steps. Program memory is very limited on the 32S, so it is usually best to use as few steps as possible. My program is 5 steps, 7.5 bytes. A program using the alternative method would be 9 steps, 13.5 bytes.

Hope the above is clear, if not, ask for more help or clarification.


Edited: 4 June 2005, 6:37 p.m.

Jack --

Jeff O. has provided a program in explicit detail, so I won't. I expect that you know how to operate the 32S interactively, but don't have a manual. (A scanned copy of a 32S manual can be purchased on a CD or DVD from this website.)

Programming is of the "recorded keystroke" paradigm, in which a program is basically an entered sequence of keyboard functions that the user would enter outside a program to accomplish the task.

An easy way to calculate the hypotenuse is to use the rectangular-to-polar function, "x,y->theta,R", which is accessible through the "P<->RECT" menu on the "7" key.

Example:

5 
ENTER
12
P<->RECT
(select "x,y->theta,R" by pressing the key it points to)

Read the radius R in the display. (An angle value will be present in the y-register, accesible by using x<>y.)

Thanks to both Jeff and Karl for taking the time to answer my question reguarding programing the 32s.