home *** CD-ROM | disk | FTP | other *** search
- <?xml version="1.0" encoding="utf-8" ?>
- <!DOCTYPE stack PUBLIC "-//Apple, Inc.//DTD stack V 2.0//EN" "" >
- <stack>
- <name>in</name>
- <id>-1</id>
- <cardCount>26</cardCount>
- <cardID>3642</cardID>
- <listID>11937</listID>
- <cantModify><false /></cantModify>
- <cantDelete><false /></cantDelete>
- <cantAbort><false /></cantAbort>
- <cardSize>
- <width>512</width>
- <height>342</height>
- </cardSize>
- <script>on OpenStack
- global functionMenu
- global XtickInterval,YtickInterval,userlevel
- global XaxisScale, YaxisScale
- global Yaxis,Xaxis,lineDensity,dataBrush,olduserlevel
- -- Set the userlevel to the proper usage
- put the userlevel into olduserlevel
- if the userlevel < 3 then
- set the userlevel to 3
- end if
- -- Makes sure stack has the essentials
- if the version < 1.2 then
- answer "Please use HyperCard version 1.2 or higher." with "Go Home"
- go home
- end if
- -- These are the routines for the Functions menu
- put NewMenu("Functions","Polynomials","Trigonometric","Exponential",¬
- "Logarithmic","Hyperbolic","Custom") into functionMenu
- -- This seems to prevent the moving button on card 1
- -- from burning a hole in the persons disk by constantly
- -- changing the loc of the button
- set userModify to false
- wait for 5 ticks
- set userModify to true
- if lineDensity is empty then
- set lockscreen to true
- push card
- go to card "Graph Options"
- send "MouseUp" to btn id 19 of card "Graph Options"
- send "MouseUp" to btn id 35 of card "Graph Options"
- pop card
- end if
- if XtickInterval is empty then put 25 into XtickInterval
- if YaxisScale is empty then put 1 into YaxisScale
- if YtickInterval is empty then put 25 into YTickInterval
- if XaxisScale is empty then put 1 into XaxisScale
- end OpenStack
-
- on CloseStack
- global olduserlevel,userlevel,functionMenu
- set the userlevel to olduserlevel
- put DeleteMenu(functionMenu) into functionMenu
- end CloseStack
-
- on SetPaint
- -- Temporarily sets paint tools to the way I want them
- global linesize,oldlinesize
- global brush,oldbrush
- global centered,oldcentered
- put the linesize into oldlinesize
- put the brush into oldbrush
- put the centered into oldcentered
- set the centered to false
- set the linesize to 1
- end SetPaint
-
- on OldSetPaint
- -- Puts the tools back the way I found them
- global linesize,oldlinesize
- global brush,oldbrush
- global centered,oldcentered
- set the brush to oldbrush
- set the linesize to oldlinesize
- set the centered to oldcentered
- end OldSetPaint
-
- on idle
- -- Resets the Functions menubar incase it has been wiped
- global functionMenu, lastTick
- if (the ticks-lastTick)>120 then
- put the ticks into lastTick
- ShowMenu(functionMenu)
- end if
- pass idle
- end idle
-
- on help
- put empty into msg
- hide msg
- answer "What do you need help with?" with¬
- "This Stack" or "HyperCard"
- if it is "This Stack" then
- go to card "H1"
- exit to HyperCard
- else pass help
- end help
-
- on doMenu menuitem
- -- This lets the person choose the custom help cards or Hyp Help
- if menuitem is "Help" then
- answer "What do you need help with?" with¬
- "This Stack" or "HyperCard"
- if it is "This Stack" then
- go to card "H1"
- exit to HyperCard
- else go to stack "Help"
- end if
- if menuitem contains "Delete" then
- play "Awww" tempo 25 "c"
- end if
- if menuitem contains "Info" then
- play "click" tempo 100 "c"
- end if
- if menuitem is "Polynomials" then
- alterPop
- go to card "Polynomials"
- exit to HyperCard
- end if
- if menuitem is "Trigonometric" then
- alterPop
- go to card "Trigonometric"
- exit to HyperCard
- end if
- if menuitem is "Exponential" then
- alterPop
- go to card "Exponential"
- exit to HyperCard
- end if
- if menuitem is "Logarithmic" then
- alterPop
- go to card "Logarithmic"
- exit to HyperCard
- end if
- if menuitem is "Hyperbolic" then
- alterPop
- go to card "Hyperbolic"
- exit to HyperCard
- end if
- if menuitem is "Custom" then
- alterPop
- go to card "Custom"
- exit to HyperCard
- end if
- pass doMenu
- end doMenu
-
- on alterPop
- pop card into temp
- if temp contains "home" then
- push card
- else push temp
- end alterPop
-
- on StartUp
- -- This is a little bit of a band aid function
- -- to make sure the stack works.
- put "function f x" & return & " return x" & return & " end f" into texty
- set the script of background id 2686 to texty
- put "f(x) = x" into cd fld "Function Name" of card "GRaph Paper"
- pass StartUp
- end StartUp
-
- function csc x
- -- This performs the Cosecant function
- global blowup
- if sin(x) = 0 then
- put "The Cosecant is not defined for multiples of Pi." into blowup
- return 9999999999999999999999999999999999999999999999999999
- exit csc
- end if
- return 1/sin(x)
- end csc
-
- function sec x
- -- This performs the Secant function
- global blowup
- if cos(x) = 0 then
- put "The Secant is not defined for multiples of Pi + Pi/2." into blowup
- return 9999999999999999999999999999999999999999999999999999
- exit sec
- end if
- return 1/cos(x)
- end sec
-
- function cot x
- -- This performs the Cotangent function
- global blowup
- if sin(x) = 0 then
- put "The Cotangent is not defined for multiples of Pi." into blowup
- return 9999999999999999999999999999999999999999999999999999
- exit cot
- end if
- return 1/tan(x)
- end cot
-
- function asin x
- -- This performs the ArcSine function
- global blowup
- if abs(x) ≥ 1 then
- put "The ArcSine is not defined for |x| ≥ 1." into blowup
- return 9999999999999999999999999999999999999999999999999999
- exit asin
- end if
- return atan(x/sqrt(1-x^2))
- end asin
-
- function acos x
- -- This performs the ArcCosine function
- global blowup
- if abs(x) ≥ 1 or x=0 then
- put "The ArcCosine is not defined for |x| ≥ 1 or x = 0." into blowup
- return 9999999999999999999999999999999999999999999999999999
- exit acos
- end if
- return atan(sqrt(1-x^2)/x)
- end acos
-
- function acot x
- -- This performs the ArcCotangent function
- global blowup
- if x=0 then
- put "The ArcCotangent is not defined for x = 0." into blowup
- return 9999999999999999999999999999999999999999999999999999
- exit acot
- end if
- return atan(1/x)
- end acot
-
- function acsc x
- -- This performs the ArcCosecant function
- global blowup
- if abs(x) Γëñ 1 then
- put "The ArcCosecant is not defined for |x| ≥ 1 or x = 0." into blowup
- return 9999999999999999999999999999999999999999999999999999
- exit acsc
- end if
- return acot(sqrt(x^2-1))
- end acsc
-
- function asec x
- -- This performs the ArcSecant function
- global blowup
- if abs(x) Γëñ 1 then
- put "The ArcSecant is not defined for |x| ≥ 1 or x = 0." into blowup
- return 9999999999999999999999999999999999999999999999999999
- exit asec
- end if
- return atan(sqrt(x^2-1))
- end asec
-
- function sinh x
- -- Hyperbolic Sine
- -- Good for all values of x
- return (exp(x) - exp(-x))/2
- end sinh
-
- function cosh x
- -- Hyperbolic Cosine
- -- Good for all values of x
- return (exp(x) + exp(-x))/2
- end cosh
-
- function tanh x
- -- Hyperbolic Tangent
- -- Good for all values of x
- return sinh(x)/cosh(x)
- end tanh
-
- function csch x
- -- Hyperbolic Cosecant
- global blowup
- if x = 0 then
- put "The Hyperbolic Cosecant is not defined for x = 0." into blowup
- return 9999999999999999999999999999999999999999999999999999
- exit csch
- end if
- return 1/sinh(x)
- end csch
-
- function sech x
- -- Hyperbolic Secant
- -- Good for all values of x
- return 1/cosh(x)
- end sech
-
- function ctnh x
- -- Hyperbolic Cotangent
- global blowup
- if x = 0 then
- put "The Hyperbolic Cotangent is not defined for x = 0." into blowup
- return 9999999999999999999999999999999999999999999999999999
- exit ctnh
- end if
- return cosh(x)/sinh(x)
- end ctnh
-
- function asinh x
- -- Inverse Hyperbolic Sine
- -- Good for all x
- return ln (x + sqrt(x^2 + 1))
- end asinh
-
- function acosh x
- -- Inverse Hyperbolic Cosine
- global blowup
- if x < 1 then
- put "The Inverse Hyperbolic Cosine is not defined for x < 1." into blowup
- return 9999999999999999999999999999999999999999999999999999
- exit acosh
- end if
- return ln (x + sqrt(x^2 - 1))
- end acosh
-
- function atanh x
- -- Inverse Hyperbolic Tangent
- global blowup
- if abs(x) >= 1 then
- put "The Inverse Hyperbolic Tangent is not defined for |x| > 1." into blowup
- return 9999999999999999999999999999999999999999999999999999
- exit atanh
- end if
- return ln((1+x)/(1-x))/2
- end atanh
-
- function acsch x
- -- Inverse Hyperbolic Cosecant
- global blowup
- if x = 0 then
- put "The Inverse Hyperbolic Cosecant is not defined for x = 0." into blowup
- return 9999999999999999999999999999999999999999999999999999
- exit acsch
- end if
- return ln(1/x+sqrt(1+x^2)/abs(x))
- end acsch
-
- function asech x
- -- Inverse Hyperbolic Secant
- global blowup
- if x ≤ 0 or x ≥ 1 t