HP Prime: Ways to use the INPUT command (Version.My next blog entry will have several more example programs using PCalc. RPN Mode Off: r is displayed, press the x~y key to get the angle RPN Mode On: r is displayed on the X stack, angle on the Y stack RPN Mode Off: y, x~y key, x, f(x) key, select Rect > Polar RPN Mode On: y, enter key, x, f(x) key, select Rect > Polar Set Y To R1 \\ angle is now in register Y, end of program Set X To R0 \\ Label (II) - r is now in register X Skip 2 If Y=0 \\ block if x=0 \\ block if x=0 Skip 5 If X!=0 \\ skip the next 5 steps if x≠0 - Goto (I) Set R1 To Y \\ start calculation for angle R0 To The Power of 1/2 \\ Inverse Power command, R0 = r Set R0 to X \\ start calculating r = √(x^2 + y^2) These are for notes only and are not entered. The angle is shown in degrees and ranges from -180° to 180°, similar to most scientific calculators with this function.Ĭomments are followed by a double backwards slash characters ( \\ ). The result will have r in the X register and the angle in the Y register. The next program, Rect > Polar, will be an example of this.Ĭonvert Rectangular Coordinates to Polar CoordinatesĮnter the y coordinate then the x coordinate. When all the calculations are finished, I store the results into X, Y, and permanent memory registers (if necessary). I use temporary registers to store and execute immediate calculations. In more complex programs, I start by making copies of X, Y, and any other required registers into temporary registers. If we treat Earth as a sphere, it's volume would approximately be 260,711,882,973.332 cubic miles. Test example: The radius of Earth is approximately 3,963 miles. Multiply X By Pi (scroll down the possible list of values to select π). Please pay careful attention to the order of the program steps. This program takes the radius in the X register and calculate the volume of the radius. The volume of a sphere is V = 4/3 * π * r^3, where r is the radius. You can stop, even invoke the error condition at any time by inserting a Stop or Error command, respectively. There are no loop commands in PCalc (as of this blog post). It may take practice to get the Skip commands correct. There is a plain Skip command to arbitrarily skip a number of commands. Skip (number of steps if the comparison is true) Value (register or value that is compared) Skipping Functions: PCalc allows for Boolean comparisons of values.Ĭommand: Skip (what has to happen for the next commands to be skipped) Let A and B be registers, B can also be a value.Ī To Power Of 1/B: Bth root of A stored in A (principal root) Value (value of a designed register or specified value) Two Argument Commands: This is the arithmetic operations, power commands, and the Set command. x must be positive, but does not have to be an integer. (INTG/IP)įactorial: The factorial function (x!). Truncate: Takes the integer part of the value of the register. Invert: Takes the reciprocal of the value of the designated register. This also includes several number operations: This includes trigonometric and logarithmic commands. One Argument Commands: A command operates on a register and stores the result in that register. This includes angle setting (Degrees Mode, Radians Mode) and base setting (Decimal Mode, Octal Mode, Binary Mode, Hexadecimal Mode). Mode Commands: they change the mode of PCalc. PCalc also has 10 permanent memory registers (labeled Memory 0 through Memory 9), 16 temporary registers (labeled Register 0 through Register 9, then Register A through Register F), and a tax register.Įverything is done in a sequential manner. The Y register is the second display register. The X register is the primary display register. A red Delete box will appear as an indicator of confirmation. You can delete programs by pressing the red circle with a minus sign next to the program name. To create a new program, select the Plus (+) symbol on the upper right hand corner of the screen. To edit an existing program, just select it. This will cause a red circle to appear next to "User" and any other customized categories.ģ. Select Edit (lower left corner of the dialogue box). To get it, you have to purchase either the full PCalc iOS app (usually sold for $9.99), or make an in-app purchase of the appropriate add-on.Ģ. ** Note, PCalc Lite app will not have this functionality. This blog entry is an introduction to programming the PCalc iOS App by James Thomson.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |