home *** CD-ROM | disk | FTP | other *** search
- -- stack: in
- -- format: 8 (HyperCard 1)
- -- flags: 0x1000 (none)
- -- protect password hash: 0
- -- maximum user level: 5 (scripting)
- -- window: Rect(x1=0, y1=0, x2=0, y2=0)
- -- screen: Rect(x1=0, y1=0, x2=0, y2=0)
- -- card dimensions: w=0 h=0
- -- scroll: x=0 y=0
- -- background count: 7
- -- first background id: 3368
- -- card count: 26
- -- first card id: 3642
- -- list block id: 11937
- -- print block id: 0
- -- font table block id: 0
- -- style table block id: 0
- -- free block count: 3
- -- free size: 8224 bytes
- -- total size: 139264 bytes
- -- stack block size: 10240 bytes
- -- created by hypercard version: 0x01208000
- -- compacted by hypercard version: 0x01228000
- -- modified by hypercard version: 0x01228000
- -- opened by hypercard version: 0x01228000
- -- patterns[0]: 0x0000000000000000
- -- patterns[1]: 0x8000000008000000
- -- patterns[2]: 0x8800220088002200
- -- patterns[3]: 0x8888222288882222
- -- patterns[4]: 0x88AA22AA88AA22AA
- -- patterns[5]: 0xCCAA33AACCAA33AA
- -- patterns[6]: 0xEEAABBAAEEAABBAA
- -- patterns[7]: 0xEEBBBBEEEEBBBBEE
- -- patterns[8]: 0xFFBBFFEEFFBBFFEE
- -- patterns[9]: 0xFFBBFFFFFFBBFFFF
- -- patterns[10]: 0x8010022001084004
- -- patterns[11]: 0xFFFFFFFFFFFFFFFF
- -- patterns[12]: 0x8822882288228822
- -- patterns[13]: 0x1122448811224488
- -- patterns[14]: 0xC4800C6843023026
- -- patterns[15]: 0xB130031BD8C00C8D
- -- patterns[16]: 0x8888888888888888
- -- patterns[17]: 0x8822552288225522
- -- patterns[18]: 0x8855225588552255
- -- patterns[19]: 0x77DD77DD77DD77DD
- -- patterns[20]: 0x8000000000000000
- -- patterns[21]: 0xAA55AA55AA55AA55
- -- patterns[22]: 0x038448300C020101
- -- patterns[23]: 0x8244394482010101
- -- patterns[24]: 0x8814224188412214
- -- patterns[25]: 0x8080413E080814E3
- -- patterns[26]: 0x22048C7422179810
- -- patterns[27]: 0xBE808808EB088880
- -- patterns[28]: 0x25C8328964244C92
- -- patterns[29]: 0xA29C41BE2AC914EB
- -- patterns[30]: 0x40A00000040A0000
- -- patterns[31]: 0x8040200002040800
- -- patterns[32]: 0xAA00800088008000
- -- patterns[33]: 0xFF80808080808080
- -- patterns[34]: 0x081C22C180010204
- -- patterns[35]: 0xFF808080FF080808
- -- patterns[36]: 0xF87422478F172271
- -- patterns[37]: 0xBF00BFBFB0B0B0B0
- -- patterns[38]: 0xFF7FBE5DA2418000
- -- patterns[39]: 0xFAF5FAF5A050A050
- -- checksum: 0x0
- ----- HyperTalk 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 then
- put "The Inverse Hyperbolic Secant is not defined for x Γëñ 0 or x > 1." into blowup
- return 9999999999999999999999999999999999999999999999999999
- exit asech
- end if
- return ln((1+sqrt(1-x^2))/x)
- end asech
-
- function actnh x
- -- Inverse Hyperbolic Cotangent
- global blowup
- if abs(x) Γëñ 1 then
- put "The Inverse Hyperbolic Cotangent is not defined for |x| Γëñ 1." into blowup
- return 9999999999999999999999999999999999999999999999999999
- exit actnh
- end if
- return ln((x+1)/(x-1))/2
- end actnh
-
- function log x
- global blowup
- if x <= 0 then
- put "The Logarithm cannot take nonpositive numbers!" into blowup
- return 9999999999999999999999999999999999999999999999999999
- exit log
- end if
- return .4342944819*ln(x)
- end log
-
-