## Sunday, August 4, 2024

### TI-84 Plus CE Python: Drawing Shapes with the ti_plotlib module

TI-84 Plus CE Python: Drawing Shapes with the ti_plotlib module

Introduction

Here are four scripts to draw shapes:

RECT8: rectangles and squares centered at (0, 0)

ELLIPSE8: ellipses and circles centered at (0, 0)

POLYGON8: polygons given the vertex points and number of vertices

INVFUNC8: draws a function f(x) and it’s inverse f^-1(x). Define the function is defined in the f(x) subroutine in the program.

The plot window is sized in sync with the TI-84’s screen size (320 pixels x 220 pixels) so that squares look like squares and circles look like circles. The window parameters are set as such:

Xmin = -16, Xmax = 16

Ymin = -10.5, Ymax = 10.5

TI-84 PLUS CE Python Script: RECT8.py

import ti_plotlib as plt

from math import *

# draw an rectangle using ti_plqtlib

# get parameters

print("Press [clear] to \nexit the graph.")

print("x:[-16,16] \ny:[-10.5,10.5]")

a=eval(input("horiz. length? "))

b=eval(input("vert. length? "))

# plot routine

plt.cls()

plt.title("Rectangle")

plt.window(-16,16,-10.5,10.5)

plt.axes("on")

plt.grid(1,1,"dot")

# color: blue

plt.color(0,0,192)

# pen size

plt.pen("medium","solid")

plt.line(-a/2,b/2,a/2,b/2,"")

plt.line(-a/2,-b/2,a/2,-b/2,"")

plt.line(-a/2,-b/2,-a/2,b/2,"")

plt.line(a/2,-b/2,a/2,b/2,"")

plt.show_plot()

TI-84 PLUS CE Python Script: ELLIPSE8.py

import ti_plotlib as plt

from math import *

# draw an ellipse using ti_plqtlib

# get parameters

print("Press [clear] to \nexit the graph.")

print("x:[-16,16] \ny:[-10.5,10.5]")

a=eval(input("x axis? "))

b=eval(input("y axis? "))

# plot routine

plt.cls()

plt.title("Ellipse")

plt.window(-16,16,-10.5,10.5)

plt.axes("on")

plt.pen("medium","solid")

plt.grid(1,1,"dot")

# color: green

plt.color(0,192,0)

for i in range(128):

x=a*cos(i*pi/64)

y=b*sin(i*pi/64)

plt.plot(x,y,"o")

plt.show_plot()

TI-84 PLUS CE Python Script: POLYGON8.py

import ti_plotlib as plt

from math import *

# draw an rectangle using ti_plqtlib

# get parameters

print("Press [clear] to \nexit the graph.")

print("x:[-16,16] \ny:[-10.5,10.5]")

n=int(input("# of vertices? "))

a=eval(input("x1? "))

b=eval(input("y1? "))

x=[a]

y=[b]

for i in range(n-1):

print("vertex ",i+2)

c=eval(input("x? "))

d=eval(input("y? "))

x.append(c)

y.append(d)

x.append(a)

y.append(b)

# plot routine

plt.cls()

plt.title("Polygon")

plt.window(-16,16,-10.5,10.5)

plt.axes("on")

plt.grid(1,1,"dot")

plt.color(75,0,130)

plt.pen("medium","solid")

for i in range(n):

x0=x[i]

y0=y[i]

x1=x[i+1]

y1=y[i+1]

plt.line(x0,y0,x1,y1,"")

plt.show_plot()

TI-84 PLUS CE Python Script: INVFUNC8.py

Define f(x) in the def f(x) function routine. The math module is imported.

import ti_plotlib as plt

from math import *

# f(x) and f**-1(x)

# define f(x)

def f(x):

return x**2+6

# plot routine

plt.cls()

plt.title("f(x) and its inverse")

plt.window(-16,16,-10.5,10.5)

plt.axes("on")

plt.grid(1,1,"dot")

plt.pen("medium","solid")

for i in range(320):

x=-16+i*32/320

y=f(x)

plt.color(0,0,192)

plt.plot(x,y,"o")

plt.color(255,165,0)

plt.plot(y,x,"o")

plt.show_plot()

Eddie

All original content copyright, © 2011-2024. Edward Shore. Unauthorized use and/or unauthorized distribution for commercial purposes without express and written permission from the author is strictly prohibited. This blog entry may be distributed for noncommercial purposes, provided that full credit is given to the author.

## Saturday, August 3, 2024

### HP 71B: Basic Expanded RPN Program (RPNT)

HP 71B: Basic Expanded RPN Program (RPNT)

Introduction

This program is an expansion of RPNBASIC that was posted on May 12, 2024. See the original program here (which is itself re-posted from 2016):

Changes:

* All registers are now represented with single letter variables.

* Added functions: trigonometric and inverse trigonometric functions, random numbers, factorial of positive integers, degree/radian conversion, polar/rectangular conversion, memory-plus function (M+)

* Code fixed to take the lesser memory bytes possible.

Memory Used:

U = temporary register

X = x stack

Y = y stack

Z = z stack

T = t stack

L = last x register

M = memory register

Keys

Stack Operation

[ END LINE ]: Enters a number. The number is placed on the X stack while everything else is pushed up one level. Note: The key string code for END LINE is #38.

[ ↑ ]: Swap: swaps the contents of X and Y stacks. The key string code for ↑ is #50.

[ ↓ ]: Roll Down: brings the stack contents down one level (T to Z, Z to Y, Y to X, X wraps around to T). The key string code for ↓ is #51.

[ f ] [ ↓ ] (-LINE): Drop: Drops the stack down, Y replaces X, Z goes to Y, and T is copied to Z. This is effectively erasing the contents of stack X, and is similar to the HP 48’s DROP command. The key string code for -LINE is #107.

[ f] [ ) ] (COPY): Duplicate: Duplicates the contents of the X stack to the Y stack, after Y transfer to Z and Z transfers to T. This command is similar to the HP 48’s DUP command. The key string code for COPY is f) (small F, right parenthesis).

[ P ]: Pi (Ï€): Enters the numeric constant Ï€ to the X stack and pushes everything else up. The contents of the T stack are lost.

[ M ]: Stores the contents of X into the memory register.

[ S ]: Adds the contents of X to the memory register (M+).

[ g ] [ M ] (m): Recalls the contents of the memory register to the X stack and pushes everything else up. The contents of the T stack are lost.

[ f ] [ END LINE ] (RES): Recalls the contents of the last X register to the X stack and pushes everything else up. The contents of the T stack are lost. The key string code for RES is #94.

[ N ]: Negate: changes the sign of the X stack. This is the change sign key.

Arithmetic and Two-Argument Operations

All these operations update the Last X register. The contents of the Z register get copied to the Y register, then the contents of T gets copied to Z.

[ + ]: Addition: Y + X.

[ - ]: Subtraction. Y – X.

[ * ]: Multiplication. Y * X

[ / ]: Division: Y / X

[ g ] [ / ] (^) : Power: Y^X

[ g ] [ 5 ] (%): Modulus. mod(Y,X)

One-Argument Operations

All these operations update the Last X register. No other stack levels are affected.

[ f ] [ / ] (SQR): Principal (positive) Square Root of X. The key string code for SQR is f/ (small f, division).

[ U ]: Square of X. (X^2 = X * X).

[ I ]: Reciprocal of X. (1/X)

[ F ]: Fractional part of X.

[ g ] [ F ] (f): Integer part of X.

[ f ] [ - ] (LOG): Natural logarithm of X. ln(X) The key string code for LOG is f- (small f, subtraction).

[ f ] [ * ] (EXP): Exponential of X. e^X (e is about 2.71828...) The key string code for EXP is f* (small f, multiplication).

[ f ] [ 4 ] (SIN): Sine of X.

[ f ] [ 5 ] (COS): Cosine of X

[ f ] [ 6 ] (TAN): Tangent of X

[ f ] [ 1 ] (ASIN): Arc-sine of X

[ f ] [ 2 ] (ACOS): Arc-cosine of X

[ f ] [ 3 ] (ATAN): Arc-tangent of X

[ D ]: Change to Degrees mode

[ g ] [ D ] (d): Convert X from radians to degrees

[ R ]: Change to Radians mode

[ g ] [ R ] (r): Convert X from degrees to radians

[ g ] [ 3 ] (#): Generate a random number between 0 and 1.

[ f ] [ = ] (FACT): Factorial of X. X must be a positive integer.

[ f ] [ , ] ( > ): Convert rectangular to polar. X: x-coordinate to radius, Y: y-coordinate to angle

[ f ] [ . ] ( < ): Convert polar to rectangular. X: radius to x-coordinate, Y: angle to y-coordinate

HP 71B Basic Program Code: RPNT

Memory: 1253 bytes

10 DESTROY U,X,Y,Z,T,M,L,K\$

15 DIM U,X,Y,Z,T,M,L,K\$

20 DISP “RPN BASIC” @ WAIT 1

22 DISP “EXIT = E” @ WAIT 1

25 DELAY 0,0

30 DISP “X: “; X

35 K\$ = KEY\$

40 IF K\$=”E” THEN DISP “THANK YOU.” @ STOP

60 IF K\$=”#38” THEN 300

62 IF K\$=”#50” THEN U=X @ X=Y @ Y=U

64 IF K\$=”#51” THEN U=X @ X=Y @ Y=Z @ Z=T @ T=U

66 IF K\$=”#107” THEN X=Y @ Y=Z @ Z=T

68 IF K\$=”f)” THEN T=Z @ Z=Y @ Y=X

70 IF K\$=”P” THEN U=PI @ GOTO 304

72 IF K\$=”M” THEN M=X

73 IF K\$=”S” THEN M=X+M

74 IF K\$=”m” THEN U=M @ GOTO 304

76 IF K\$=”#94” THEN U=L @ GOTO 304

78 IF K\$=”N” THEN X=-X

80 IF K\$=”+” THEN U=Y+X @ GOTO 310

82 IF K\$=”-” THEN U=Y-X @ GOTO 310

84 IF K\$=”*” THEN U=Y*X @ GOTO 310

86 IF K\$=”/” THEN U=Y/X @ GOTO 310

88 IF K\$=”^” THEN U=Y^X @ GOTO 310

90 IF K\$=”%” THEN U=MOD(Y,X) @ GOTO 310

100 IF K\$=”f/” THEN L=X @ X=SQR(X)

102 IF K\$=”U” THEN L=X @ X=X^2

104 IF K\$=”A” THEN L=X @ X=ABS(X)

106 IF K\$=”I” THEN L=X @ X=1/X

108 IF K\$=”F” THEN L=X @ X=FP(X)

110 IF K\$=”f” THEN L=X @ X=IP(X)

112 IF K\$=”f-” THEN L=X @ X=LOG(X)

114 IF K\$=”f*” THEN L=X @ X=EXP(X)

116 IF K\$=”f4” THEN L=X @ X=SIN(X)

118 IF K\$=”f5” THEN L=X @ X=COS(X)

120 IF K\$=”f6” THEN L=X @ X=TAN(X)

122 IF K\$=”f1” THEN L=X @ X=ASIN(X)

124 IF K\$=”f2” THEN L=X @ X=ACOS(X)

126 IF K\$=”f3” THEN L=X @ X=ATAN(X)

128 IF K\$=”D” THEN DEGREES

132 IF K\$=”d” THEN L=X @ X=DEG(X)

134 IF K\$=”r” THEN L=X @ X=RAD(X)

136 IF K\$=”#” THEN L=X @ U=RND @ GOTO 304

138 IF K\$=”f=” THEN L=X @ X=FACT(X)

140 IF K\$=”>” THEN L=X @ X=SQR(L^2+Y^2) @ Y=ANGLE(L,Y)

142 IF K\$=”<” THEN L=X @ X=L*COS(Y) @ Y=L*SIN(Y)

199 GOTO 30

300 INPUT “NUMBER? “; U

302 ! STACK

304 T=Z @ Z=Y @ Y=X @ X=U

306 GOTO 30

310 ! 2 ARG

312 L=X @ X=U @ Y=Z @ Z=T

314 GOTO 30

Example Calculations

1. Find the percent change from 8000 to 12000. Formula: (12000 – 8000) / 8000 * 100

Keystrokes:

[END LINE] 12000 [END LINE]

[END LINE] 8000 [END LINE]

[ - ]

[ f ] [END LINE] (RES) <LASTx>

[ / ]

[END LINE] 100 [END LINE]

[ * ]

Result: 50 (50%)

2. e^(2*Ï€ – 1)

Keystrokes:

[END LINE] 2 [END LINE]

[ P ] <enter Ï€ to the stack>

[ * ]

[END LINE] 1 [END LINE]

[ - ]

[ f ] [ * ] (EXP) <exp(x) =e^x>

Result: 196.996371

3. 1/(1/9 + ln 11 + 8^2)

Keystrokes:

[END LINE] 9 [END LINE]

[ I ] <1/x>

[END LINE] 11 [END LINE]

[ f ] [ - ] (LOG) <ln(x)>

[ + ]

[END LINE] 8 [END LINE]

[ U ] <x^2>

[ + ]

[ I ]

Result: 1.50355576541E-2

4. Use the memory register to calculate: 3 * 18 + 8 * 17

Keystrokes:

[END LINE] 3 [END LINE]

[END LINE] 18 [END LINE]

[ * ]

[ M ] <store into memory>

[END LINE] 8 [END LINE]

[END LINE] 17 [END LINE]

[ * ]

[ S ] <add to memory>

[ g ] [ M ] (m) <recall memory>

Result: 190

5. Find the arc-sin of 0.5 in degrees and radians

Keystrokes:

[ D ] <set degrees mode>

[END LINE] 0.5 [END LINE]

[ f ] [ ) ] (COPY) < copies 0.5 to Y >

[ f ] [ 1 ] (ASIN) < Result: 30 degrees >

[ ↑ ] < swap >

[ R ] < set radians mode, RAD indicator is on >

[ f ] [ 1 ] (ASIN) < Result: 0.523598775598 radians >

6. Calculate | 99 – 164 * 1.03^3 |

Keystrokes:

[END LINE] 99 [END LINE]

[END LINE] 164 [END LINE]

[END LINE] 1.03 [END LINE]

[END LINE] 3 [END LINE]

[ g ] [ / ] (^)

[ * ]

[ - ]

[ A ] < absolute value >

Result: 80.207228

7. Convert Rectangular to Polar with X = 4, Y = 5. Calculate the angle in degrees mode.

Keystrokes:

[ D ] <set degrees mode>

[END LINE] 5 [END LINE] <enter y first>

[END LINE] 4 [END LINE] <enter x next>

[ g ] [ , ] ( > ) < rectangular to polar>

[ ↑ ] <swap>

Display: 51.3401917459 (angle)

8. Convert Polar to Rectangular with R = 11, Î¸ = 60°.

Keystrokes:

[ D ] <set degrees mode>

[END LINE] 60 [END LINE] <enter Î¸ first>

[END LINE] 11 [END LINE] <enter r next>

[ g ] [ . ] ( < ) <polar to rectangular>

Display: 5.5 (x)

[ ↑ ]

Display: 9.52627944162

Eddie

All original content copyright, © 2011-2024. Edward Shore. Unauthorized use and/or unauthorized distribution for commercial purposes without express and written permission from the author is strictly prohibited. This blog entry may be distributed for noncommercial purposes, provided that full credit is given to the author.

## Sunday, July 28, 2024

### More Updates: HP 15C Collector's Edition and Swiss Micros DM42

Thanks to Museum of HP Calculators Forums:

HP 15C Collector's Edition (SAMBA software and the HP 15C Connectivity cable required)

*  Key bounce issue is addressed

*  Decimal display mode in HP 16C mode corrected

Where to buy the required cable:

Calculator Store (Europe):  https://www.thecalculatorstore.com/

HP Supply (United States/Canada, per forum, available in August 2024):  https://hpofficesupply.com

Swiss Micros DM42 - v.3.23 DCMP 3.25

*  Software updated to match Free42 firmware 3.1.8

Swiss Micros Post:  https://forum.swissmicros.com/viewtopic.php?p=33058#p33058

Firmware Page:  https://technical.swissmicros.com/dm42/firmware/

Eddie

All original content copyright, © 2011-2024. Edward Shore. Unauthorized use and/or unauthorized distribution for commercial purposes without express and written permission from the author is strictly prohibited. This blog entry may be distributed for noncommercial purposes, provided that full credit is given to the author.

## Saturday, July 27, 2024

### Spotlight: Texas Instruments TI-30 ECO RS: The Solar TI-30Xa

Spotlight: Texas Instruments TI-30 ECO RS: The Solar TI-30Xa

Quick Facts

Model: TI-30 ECO RS

Company: Texas Instruments

Timeline: 2015 – present (Europe

Type: Scientific calculator

Power: Solar

Display: One line, 10 digits, 2 digit exponents

Introduction

The TI-30 ECO RS is a European all-solar powered version of the battery-powered, specifically the LR44 battery, powered TI-30Xa.

Why did I get the TI-30 ECO RS? Truth be told, I am partial to solar-powered scientific calculators. I still dream of the day a solar powered (even if it is hybrid with battery) graphing calculator, that’s yet to happen. Blue is my favorite color.

Per Texas Instruments, the TI-30 ECO RS was awarded the Blue Angel award, which is a certification for the product being environmental friendly. Along with the calculator being completely solar powered, the TI-30 ECO RS is made from recycled plastic.

Features

The TI-30 ECO RS is a standard and simple scientific calculator that follows the classic TI-30 line:

* One line display, up to 10 digits. Display modes include floating pint, fixed decimal, scientific notation, and engineering notation.

* Arithmetic, powers, roots, exponential and logarithm functions

* Trigonometric functions and inverses

* Hyperbolic functions and inverses

* Fraction calculations, including fraction/decimal conversions. The maximum denominator is 999.

* One-variable statistics including mean, standard deviation, sums

* Combinations, permutations, and factorial of positive integers (up to 69)

* Polar/Rectangular and Decimal/Decimal-Minute-Second conversions

* Three memory registers (M1, M2, M3)

The TI-30 ECO RS follows the algebraic operating system and the standard order of operations is followed with a maximum of four pending operations. There is no implied multiplication.

The calculator uses postfix notation, where some one-number operations are entered after the number. For example, to calculate the sine of 30 degrees, press 30 [ SIN ] (in degrees mode). For the anti-log of 2.6, press 2.6 [ 2nd ] [ LOG ] <10^x>.

TI-30 ECO RS vs. TI-30Xa

Even though the feature set of the TI-30 ECO RS and the TI-30Xa are the same, there are some minor differences.

* The TI-30 ECO RS is solar powered and will never require a separate battery. This is not the first time Texas Instruments implemented the solar only design, as previous models include the TI-108, TI-31, TI-30 SLR+, the classic one-line TI-36X Solar, the classic TI-36 Solar, and the BA-Solar from 1987 are some examples. In the 1980s and 1990s, Texas Instruments used technology named Anylite Technology (TM).

* Pressing the [ON/AC] button clears everything including the memory and statistics registers and resets the calculator to Degrees mode. This is consistent with classic one-line TI solar powered calculators. If you intend to store constants long-term, you may want to consider the battery-powered TI-30Xa instead.

* Calculations on the solar powered TI-30 ECO RS are slightly slower than the TI-30Xa. I am guessing that it is due to the power source.

* Since 2015, both the TI-30 ECO RS and the TI-30Xa are free the logarithm bug (Datamath).

* The TI-30 ECO RS is sold in Europe. Outside of Europe, we have to buy a TI-30 ECO RS online. I was fortunately enough to buy one from an e-bay seller in Virginia.

Source

Woerner, Joerg. “Texas Instruments TI-30 ECO RS (2015)” Datamath Calculator Museum.

Updated May 17, 2016. Accessed June 6, 2024. http://www.datamath.org/Sci/Modern/TI-30ecRS_2015.htm

“Scientific calculator TI-30 ECO RS” Texas Instruments Calculators. 1995-2024. Accessed June 7, 2024. The page is in German. https://education.ti.com/de/produkte/taschenrechner/wissenschaftliche-rechner/ti-30-eco-rs

Eddie

All original content copyright, © 2011-2024. Edward Shore. Unauthorized use and/or unauthorized distribution for commercial purposes without express and written permission from the author is strictly prohibited. This blog entry may be distributed for noncommercial purposes, provided that full credit is given to the author.

## Friday, July 26, 2024

### Update: Swiss Micros DM41X Version 2.2

Update:  Swiss Micros DM41X Version 2.2

Special thanks to Bob Prosperi of the Museum of HP Calculators.

Highlights include:

*  Bug fixes with display

*  Special characters are now displayed correctly in the program editor

*  The volume of the screenshot sound is increased

We are in calculator update season!

Eddie

All original content copyright, © 2011-2024. Edward Shore. Unauthorized use and/or unauthorized distribution for commercial purposes without express and written permission from the author is strictly prohibited. This blog entry may be distributed for noncommercial purposes, provided that full credit is given to the author.

### TI-84 Plus CE Python: Drawing Shapes with the ti_plotlib module

TI-84 Plus CE Python: Drawing Shapes with the ti_plotlib module Introduction Here are four scripts to draw shapes: RECT8: rec...