Download Print this page

Using A Program To Create The Sierpinski Triangle - Texas Instruments TI-82 STATS Manual Book

Graphing calculator
Hide thumbs Also See for TI-82 STATS:

Advertisement

Using a Program to Create the Sierpinski Triangle

Setting up the
Program
Program
This program creates a drawing of a famous fractal, the
Sierpinski Triangle, and stores the drawing to a picture. To
begin, press  ~ ~
then press Í. The program editor is displayed.
PROGRAM:SIERPINS
:FnOff :ClrDraw
:PlotsOff
:AxesOff
:0! ! ! ! Xmin:1! ! ! ! Xmax
:0! ! ! ! Ymin:1! ! ! ! Ymax
:rand! ! ! ! X:rand! ! ! ! Y
:For(K,1,3000)
:rand! ! ! ! N
:If N1 à 3
:Then
:.5X! ! ! ! X
:.5Y! ! ! ! Y
:End
:If 1 à 3 <N and N2 à 3
:Then
:.5(.5+X)! ! ! ! X
:.5(1+Y)! ! ! ! Y
:End
:If 2 à 3 <N
:Then
:.5(1+X)! ! ! ! X
:.5Y! ! ! ! Y
:End
:Pt-On(X,Y)
:End
:StorePic 6
After you execute the program above, you can recall and display
the picture with the instruction
. Name the program
1
Set viewing window.
Beginning of
/
If
Then
/
If
Then
/
If
Then
Draw point.
End of
Store picture.
.
RecallPic 6
Applications 17–7
, and
SIERPINS
group.
For
group
group.
group.
group.
For

Hide quick links:

Advertisement

loading