EasyManua.ls Logo

HP 48GII

HP 48GII
653 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
RPL Programming Examples 2-39
Example: Find the value of x for which X"FX equals 599.5. Use a guess in the vicinity of 1.
Start by keying in X"FX :
@å@é x †O3.7
*x Q3 +4.5 * x Q2
+3.9 *x +5 `
Store the program in X"FX, then enter the program name, the y-value 599.5, and the guess 1, and execute
ROOTR:
O X"FX K
O J %X²FX% `
599.5 ` 1 %ROOTR%
Animating a Graphical Image
Program WALK shows a small person walking across the display. It animates this custom graphical image by
incrementing the image position in a loop structure.
Techniques used in WALK
! Custom graphical image. (Note that the programmer compiles the full information content of the graphical
image before writing the program by building the image interactively in the Graphics environment and then
returning it to the command line.)
! FOR…STEP (definite loop). WALK uses this loop to animate the graphical image. The ending value for
the loop is MAXR. Since the counter value cannot exceed MAXR, the loop executes indefinitely.
WALK program listing
Program: Comments:
"!
>KLS!X!3Q!<V88!
3a883Q883O883a88<V88
R888O338BB88Xa88X888
a388HH883a38HR88!
Puts the graphical image of the
walker in the command line.
(Note that the hexadecimal
p
ortion of the graphics object is a
continuous integer
<V88dddHR88. The
linebreaks do not represent
spaces.)
#!s$u|!
Creates local variable walk
containing the graphics object.
"!
<KBD<!f!g!8(!g!8(!h!
2N6<Y!
Clears PICT, then displays it.

Table of Contents

Other manuals for HP 48GII

Related product manuals