Index

  1. Introduction
  2. Ball
  3. Beizer
  4. Bifruc
  5. Bihex
  6. Cobweb
  7. Collatz
  8. Lorenz
  9. Shift

Introduction

All these programs were written on either a TI-82 or TI-83 graphing calculators during class.
I made these mostly to explore what the graphing calculator's programming capabilities were.
"->" is the storage function on the calculator.

Ball

An animation of θ bouncing around the screen. The last while loop is to add in some delay.

5->H
5->V
1->A
1->B
While 1
ClrHome
If (H+A>16 or H+A<1)
-1*A->A
If (V+B>8 or V+B<1)
-1*B->B
Output(V,H,"θ")
H+A->H
V+B->V
0->I
While I>15
I+1->I
End
End

Beizer

Draws a Beizer curve with 5 control points

rand*(Xmax-Xmin)+Xmin->L5(1)
rand*(Xmax-Xmin)+Xmin->L5(2)
rand*(Xmax-Xmin)+Xmin->L5(3)
rand*(Xmax-Xmin)+Xmin->L5(4)
rand*(Xmax-Xmin)+Xmin->L5(5)
rand*(Ymax-Ymin)+Ymin->L6(1)
rand*(Ymax-Ymin)+Ymin->L6(2)
rand*(Ymax-Ymin)+Ymin->L6(3)
rand*(Ymax-Ymin)+Ymin->L6(4)
rand*(Ymax-Ymin)+Ymin->L6(5)
"(1-T)^4*L5(1)+4(1-T)^3*T*L5(2)+6(1-T)2*T2*L5(3)+4(1-T)*T^3*L5(4)+T^4*L5(5)"->X1T
"(1-T)^4*L6(1)+4(1-T)^3*T*L6(2)+6(1-T)2*T2*L6(3)+4(1-T)*T^3*L6(4)+T^4*L6(5)"->Y1T
Line(L5(1),L6(1),L5(2),L6(2))
Line(L5(2),L6(2),L5(3),L6(3))
Line(L5(3),L6(3),L5(4),L6(4))
Line(L5(4),L6(4),L5(5),L6(5))
Pause
prgmBEZIER

Bifruc

Draws a bifurcation diagram of the logistic map

Xmin->A
Xmax->B
ClrDraw
(B-A)/94->D
While A<B
A*.25-.001->C
0->I
While I<60
A(C-C2)->C
If I>45
Pt-On(A,C)
I+1->I
End
A+D->A
End

Bihex

Fills the screen with 1s and 0s

ClrHome
1->H
1->V
While V<8
While H<16
Output(V,H,int(rand))
H+1->H
End
1->H
V+1->V
Disp ""
End
While 1
While H<16
Output(8,H,int(rand))
H+1->H
End
1->H
Disp ""
End

Cobweb

Draws a cobweb diagram of the logistic map

ClrDraw
0->Xmin
0->Ymin
1->Xmax
1->Ymax
"X"->Y1
"R(X-X2)"->Y2
Prompt R
Disp "AUTO START 1/0"
Input I
If I:Then
R*.25-.001->S
Else
Prompt S
End
Prompt I
0->A
0->B
While A<I
R(S-S2)->N
Line(S,B,S,N)
N->B
Line(S,N,N,N)
N->S
A+1->A
End

Collatz

Steps through the Collatz conjecture given an integer

Input A
While A>1
If not(fPart(A/2)):Then
A/2->A
Else
3A+1->A
End
Disp A
Pause
End

Lorenz

Draws a lorenz attractor viewed from the X-Z plane

ClrDraw
AxesOff
-20->Xmin
20->Xmax
0->Ymin
50->Ymax
Prompt X
1->Y
Prompt Z
X->A
Y->B
Z->C
10->D
(8/3)->E
28->F
.01->T
DispGraph
While 1
TD(B-A)->U
T(A(F-C)-B)->V
T(AB-EC)->W
Pt-On(A,C)
A+U->A
B+V->B
C+W->C
End

Shift

A 16 bit linear feedback shift register with tap points at bits 4, 10, 11, and 12

16->A
1->I
1->L6(1)
While I<A
I+1->I
0->L6(I)
End
While 1
((L6(4) xor L6(10)) xor L6(11)) xor L6(12)->T
A->I
While I>1
L6(I-1)->L6(I)
I-1->I
End
T->L6(1)
1->I
While I<A
Output(1,I,L6(I))
I+1->I
End
End