body main banner  
torso

TANIMATE.8xp

Purpose: Show lines tangent to a graph.

Download TANIMATE.8xp

Source Code

:Func
:Normal
:Full
:Radian
:round(X,2)X
:PlotsOff
:FnOff
:FnOn 1
:StorePic Pic6
:StoreGDB GDB6
:XminA
:XmaxC
:Lbl B
:ClrHome
:Menu("MODE?","STATIC",M,"DYNAMIC",A,"PLOT CHANGE",S,"PLOT CHNG W/Y1",O,"GRAPH OPTIONS",U,"QUIT",Q)
:Lbl U
:DispG
:round(X,2)X
:StorePic Pic6
:StoreGDB GDB6
:Pause
:ClrHome
:Menu("GRAPH OPTIONS?","NEW Y1",C,"NEW WINDOW",D,"ZBox",E,"Zoom In",I,"Zoom Out",N,"MODE MENU",B)
:Lbl E
:ZBox
:Goto U
:Lbl I
:Zoom In
:Goto U
:Lbl N
:Zoom Out
:Goto U
:Lbl C
:ClrHome
:Disp "ENTER FUNCTION"
:Disp "BETWEEN QUOTES"
:Disp "IN TERMS OF X."
:Disp " "
:Input "Y1=",Y1
:Goto U
:Lbl D
:ClrHome
:Disp "WINDOW"
:Input " Xmin=",Xmin
:Input " Xmax=",Xmax
:Input " XScl=",XScl
:Input " Ymin=",Ymin
:Input " YMax=",YMax
:Input " YScl=",YScl
:Goto U
:Lbl A
:XminA
:XmaxC
:ClrHome
:Menu("SAMPLING RATE?","LOW",1,"MEDIUM",2,"HIGH",3)
:Lbl 1
:5F
:Goto 4
:Lbl 2
:2F
:Goto 4
:Lbl 3
:1F
:Lbl 4
:0P
:0T
:Menu("DISPLAY OPTIONS?","TANGENT ONLY",F,"TANGENT/POINTS",G,"POINTS ONLY",H)
:Lbl G
:1P
:1T
:Goto Y
:Lbl F
:1T
:Goto Y
:Lbl H
:1P
:Lbl Y
:1I
:ClrListL1,L2
:RecallGDB GDB6
:FnOn 1
:1E20E
:Text(0,0,"LEFT ENDPOINT")
:Trace
:XS
:ClrDraw
:If SC
:Goto R
:Text(0,40,"RIGHT ENDPOINT")
:Trace
:XE
:ClrDraw
:If E
C
:Goto R
:If ES
:Goto R
:For(X,S,E,X*F)
:nDeriv(Y1,X,X)M
:If T=1
:Line(A,B,C,D,0)
:If T=1
:RecallPic Pic6
:Y1(X)Y
:M(A-X)+YB
:M(C-X)+YD
:If T=1
:Line(A,B,C,D)
:XL1(I)
:ML2(I)
:If P=1
:Pt-On(X,M)
:I+1I
:End
:If T=1
:Line(A,B,C,D,0)
:RecallPic Pic6
:If P=1
:Then
:For(T,1,I-1)
:Pt-On(L1(T),L2(T))
:End
:End
:Pause
:Goto B
:Lbl R
:If SE
:Then
:Disp "X START MUST BE"
:Disp "LESS THAN X END"
:Else
:Disp "WINDOW OUT OF"
:Disp "RANGE, TRY AGAIN"
:End
:Pause
:Goto B
:Lbl M
:ClrListL1,L2
:Input "X-VALUES?",K
:If K<0 or K>99
:Then
:ClrHome
:Disp "X-VALUE MUST BE"
:Disp "BETWEEN 0 and 99"
:Pause
:Goto M
:End
:XminA
:XmaxC
:ClrHome
:0T
:0P
:Menu("DISPLAY OPTIONS?","TANGENT ONLY",J,"TANGENT/POINTS",K,"POINTS ONLY",L)
:Lbl K
:1P
:1T
:Goto Z
:Lbl J
:1T
:Goto Z
:Lbl L
:1P
:Lbl Z
:RecallGDB GDB6
:FnOn 1
:For(I,1,K)
:Trace
:nDeriv(Y1,X,X)M
:If T=1
:Line(A,B,C,D,0)
:RecallPic Pic6
:Y1(X)Y
:M(A-X)+YB
:M(C-X)+YD
:If T=1
:Line(A,B,C,D)
:Text(10,0,"M=",round(M,2))
:XL1(I)
:ML2(I)
:If P=1
:Pt-On(X,M)
:End
:If T=1
:Line(A,B,C,D,0)
:RecallPic Pic6
:If P=1
:Then
:For(T,1,K)
:Pt-On(L1(T),L2(T))
:End
:End
:Pause
:Goto B
:Lbl S
:ClrHome
:Menu("WINDOW?","SAME AS Y1",5,"RESCALE",6)
:Lbl 5
:0G
:Goto 7
:Lbl 6
:1G
:Lbl 7
:If G=1 and min(L2)=max(L2)
:Then
:ClrHome
:Disp "DATA IS NOT"
:Disp "APPROPRIATE FOR"
:Disp "GRAPH. WINDOW"
:Disp "SETTINGS RESET."
:Pause
:0G
:End
:RecallGDB GDB6
:FnOff
:PlotsOff
:Plot1Scatter ,L1,L2,[Box])
:If G=0
:DispG
:If G=1
:ZoomStat
:Trace
:Pause
:PlotsOff
:Goto B
:Lbl O
:RecallGDB GDB6
:PlotsOff
:FnOn 1
:Plot1Scatter ,L1,L2,[Box])
:Trace
:Pause
:PlotsOff
:Goto B
:Lbl Q
:PlotsOff
:ClrHome
:

Generated by
SourceCoder, 2005 Cemetech>Source Code