Program: Sierpinski Triangle - Texas Instruments TI-86 Manual Book

Graphing calculator
Hide thumbs Also See for TI-86:
Table of Contents

Advertisement

260
Chapter 19: Applications

Program: Sierpinski Triangle

This program creates a drawing of a widely known fractal, the Sierpinski Triangle, and
stores the drawing to the picture variable
Select
EDIT
from the
PRGM
PROGRAM:SIERP
:FnOff :ClDrw
:PlOff
:AxesOff
Sets viewing
:0¶xMin:1¶xMax
:0¶yMin:1¶yMax
window
:rand¶X:rand¶Y
Begins
:For(K,1,3000)
For
:rand¶N
group
:If N(1 à 3 )
:Then
If
à
Then
group
:.5X¶X
:.5Y¶Y
:End
On the home screen, select
and press b to run the program, which may run for several
minutes before completion.
After you run the program, you can recall and display the picture
by executing
RcPic TRI
.
TRI
menu, enter
SIERP
at the
Draws point
End of
Stores picture
SIERP
from the
PRGM NAMES
.
Name=
prompt, and then enter this program.
:If N>(1à3) and N(2à3)
:Then
If
à
Then
:.5(.5+X)¶X
group
:.5(1+Y)¶Y
:End
:If N>(2 à 3 )
:Then
If
à
Then
:.5(1+X)¶X
group
:.5Y¶Y
:End
:PtOn(X,Y)
For
:End
:StPic TRI
menu

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Ti-86 - viewscreen calculator

Table of Contents