home *** CD-ROM | disk | FTP | other *** search
/ Otherware / Otherware_1_SB_Development.iso / mac / misc / math / mathgrap.sit / MathGrapher / stack_-1.xml < prev    next >
Encoding:
Extensible Markup Language  |  1989-07-28  |  8.0 KB  |  16 lines

  1. <?xml version="1.0" encoding="utf-8" ?>
  2. <!DOCTYPE stack PUBLIC "-//Apple, Inc.//DTD stack V 2.0//EN" "" >
  3. <stack>
  4.     <name>in</name>
  5.     <id>-1</id>
  6.     <cardCount>26</cardCount>
  7.     <cardID>3642</cardID>
  8.     <listID>11937</listID>
  9.     <cantModify><false /></cantModify>
  10.     <cantDelete><false /></cantDelete>
  11.     <cantAbort><false /></cantAbort>
  12.     <cardSize>
  13.         <width>512</width>
  14.         <height>342</height>
  15.     </cardSize>
  16.     <script>on OpenStack
  17. global functionMenu
  18. global XtickInterval,YtickInterval,userlevel
  19. global XaxisScale, YaxisScale
  20. global Yaxis,Xaxis,lineDensity,dataBrush,olduserlevel
  21. -- Set the userlevel to the proper usage
  22. put the userlevel into olduserlevel
  23. if the userlevel < 3 then
  24. set the userlevel to 3
  25. end if
  26. -- Makes sure stack has the essentials
  27. if  the version < 1.2 then
  28. answer "Please use HyperCard version 1.2 or higher." with "Go Home"
  29. go home
  30. end if
  31. -- These are the routines for the Functions menu
  32. put NewMenu("Functions","Polynomials","Trigonometric","Exponential",┬¼
  33. "Logarithmic","Hyperbolic","Custom") into functionMenu
  34. -- This seems to prevent the moving button on card 1
  35. --  from burning a hole in the persons disk by constantly
  36. --   changing the loc of the button
  37. set userModify to false
  38. wait for 5 ticks
  39. set userModify to true
  40. if lineDensity is empty then
  41. set lockscreen to true
  42. push card
  43. go to card "Graph Options"
  44. send "MouseUp" to btn id 19 of card "Graph Options"
  45. send "MouseUp" to btn id 35 of card "Graph Options"
  46. pop card
  47. end if
  48. if XtickInterval is empty then put 25 into XtickInterval
  49. if YaxisScale is empty then put 1 into YaxisScale
  50. if YtickInterval is empty then put 25 into YTickInterval
  51. if XaxisScale is empty then put 1 into XaxisScale
  52. end OpenStack
  53.  
  54. on CloseStack
  55. global olduserlevel,userlevel,functionMenu
  56. set the userlevel to olduserlevel
  57. put DeleteMenu(functionMenu) into functionMenu
  58. end CloseStack
  59.  
  60. on SetPaint
  61. -- Temporarily sets paint tools to the way I want them
  62. global linesize,oldlinesize
  63. global brush,oldbrush
  64. global centered,oldcentered
  65. put the linesize into oldlinesize
  66. put the brush into oldbrush
  67. put the centered into oldcentered
  68. set the centered to false
  69. set the linesize to 1
  70. end SetPaint
  71.  
  72. on OldSetPaint
  73. -- Puts the tools back the way I found them
  74. global linesize,oldlinesize
  75. global brush,oldbrush
  76. global centered,oldcentered
  77. set the brush to oldbrush
  78. set the linesize to oldlinesize
  79. set the centered to oldcentered
  80. end OldSetPaint
  81.  
  82. on idle
  83. -- Resets the Functions menubar incase it has been wiped
  84. global functionMenu, lastTick
  85. if (the ticks-lastTick)>120 then
  86. put the ticks into lastTick
  87. ShowMenu(functionMenu)
  88. end if
  89. pass idle
  90. end idle
  91.  
  92. on help
  93. put empty into msg
  94. hide msg
  95. answer "What do you need help with?" with┬¼
  96. "This Stack" or "HyperCard"
  97. if it is "This Stack" then
  98. go to card "H1"
  99. exit to HyperCard
  100. else pass help
  101. end help
  102.  
  103. on doMenu menuitem
  104. -- This lets the person choose the custom help cards or Hyp Help
  105. if menuitem is "Help" then
  106. answer "What do you need help with?" with┬¼
  107. "This Stack" or "HyperCard"
  108. if it is "This Stack" then
  109. go to card "H1"
  110. exit to HyperCard
  111. else go to stack "Help"
  112. end if
  113. if menuitem contains "Delete" then
  114. play "Awww" tempo 25 "c"
  115. end if
  116. if menuitem contains "Info" then
  117. play "click" tempo 100 "c"
  118. end if
  119. if menuitem is "Polynomials" then
  120. alterPop
  121. go to card "Polynomials"
  122. exit to HyperCard
  123. end if
  124. if menuitem is "Trigonometric" then
  125. alterPop
  126. go to card "Trigonometric"
  127. exit to HyperCard
  128. end if
  129. if menuitem is "Exponential" then
  130. alterPop
  131. go to card "Exponential"
  132. exit to HyperCard
  133. end if
  134. if menuitem is "Logarithmic" then
  135. alterPop
  136. go to card "Logarithmic"
  137. exit to HyperCard
  138. end if
  139. if menuitem is "Hyperbolic" then
  140. alterPop
  141. go to card "Hyperbolic"
  142. exit to HyperCard
  143. end if
  144. if menuitem is "Custom" then
  145. alterPop
  146. go to card "Custom"
  147. exit to HyperCard
  148. end if
  149. pass doMenu
  150. end doMenu
  151.  
  152. on alterPop
  153. pop card into temp
  154. if temp contains "home" then
  155. push card
  156. else push temp
  157. end alterPop
  158.  
  159. on StartUp
  160. -- This is a little bit of a band aid function
  161. -- to make sure the stack works.
  162. put "function f x" & return & "   return x" & return & " end f" into texty
  163. set the script of background id 2686 to texty
  164. put "f(x) = x" into cd fld "Function Name" of card "GRaph Paper"
  165. pass StartUp
  166. end StartUp
  167.  
  168. function csc x
  169. -- This performs the Cosecant function
  170. global blowup
  171. if sin(x) = 0 then
  172. put "The Cosecant is not defined for multiples of Pi." into blowup
  173. return 9999999999999999999999999999999999999999999999999999
  174. exit csc
  175. end if
  176. return 1/sin(x)
  177. end csc
  178.  
  179. function sec x
  180. -- This performs the Secant function
  181. global blowup
  182. if cos(x) = 0 then
  183. put "The Secant is not defined for multiples of Pi + Pi/2." into blowup
  184. return 9999999999999999999999999999999999999999999999999999
  185. exit sec
  186. end if
  187. return 1/cos(x)
  188. end sec
  189.  
  190. function cot x
  191. -- This performs the Cotangent function
  192. global blowup
  193. if sin(x) = 0 then
  194. put "The Cotangent is not defined for multiples of Pi." into blowup
  195. return 9999999999999999999999999999999999999999999999999999
  196. exit cot
  197. end if
  198. return 1/tan(x)
  199. end cot
  200.  
  201. function asin x
  202. -- This performs the ArcSine function
  203. global blowup
  204. if abs(x) ΓëÑ 1 then
  205. put "The ArcSine is not defined for |x| ΓëÑ 1." into blowup
  206. return 9999999999999999999999999999999999999999999999999999
  207. exit asin
  208. end if
  209. return atan(x/sqrt(1-x^2))
  210. end asin
  211.  
  212. function acos x
  213. -- This performs the ArcCosine function
  214. global blowup
  215. if abs(x) ΓëÑ 1 or x=0 then
  216. put "The ArcCosine is not defined for |x| ΓëÑ 1 or x = 0." into blowup
  217. return 9999999999999999999999999999999999999999999999999999
  218. exit acos
  219. end if
  220. return atan(sqrt(1-x^2)/x)
  221. end acos
  222.  
  223. function acot x
  224. -- This performs the ArcCotangent function
  225. global blowup
  226. if x=0 then
  227. put "The ArcCotangent is not defined for x = 0." into blowup
  228. return 9999999999999999999999999999999999999999999999999999
  229. exit acot
  230. end if
  231. return atan(1/x)
  232. end acot
  233.  
  234. function acsc x
  235. -- This performs the ArcCosecant function
  236. global blowup
  237. if abs(x) Γëñ 1 then
  238. put "The ArcCosecant is not defined for |x| ΓëÑ 1 or x = 0." into blowup
  239. return 9999999999999999999999999999999999999999999999999999
  240. exit acsc
  241. end if
  242. return acot(sqrt(x^2-1))
  243. end acsc
  244.  
  245. function asec x
  246. -- This performs the ArcSecant function
  247. global blowup
  248. if abs(x) Γëñ 1 then
  249. put "The ArcSecant is not defined for |x| ΓëÑ 1 or x = 0." into blowup
  250. return 9999999999999999999999999999999999999999999999999999
  251. exit asec
  252. end if
  253. return atan(sqrt(x^2-1))
  254. end asec
  255.  
  256. function sinh x
  257. -- Hyperbolic Sine
  258. -- Good for all values of x
  259. return (exp(x) - exp(-x))/2
  260. end sinh
  261.  
  262. function cosh x
  263. -- Hyperbolic Cosine
  264. -- Good for all values of x
  265. return (exp(x) + exp(-x))/2
  266. end cosh
  267.  
  268. function tanh x
  269. -- Hyperbolic Tangent
  270. -- Good for all values of x
  271. return sinh(x)/cosh(x)
  272. end tanh
  273.  
  274. function csch x
  275. -- Hyperbolic Cosecant
  276. global blowup
  277. if x = 0 then
  278. put "The Hyperbolic Cosecant is not defined for x = 0." into blowup
  279. return 9999999999999999999999999999999999999999999999999999
  280. exit csch
  281. end if
  282. return 1/sinh(x)
  283. end csch
  284.  
  285. function sech x
  286. -- Hyperbolic Secant
  287. -- Good for all values of x
  288. return 1/cosh(x)
  289. end sech
  290.  
  291. function ctnh x
  292. -- Hyperbolic Cotangent
  293. global blowup
  294. if x = 0 then
  295. put "The Hyperbolic Cotangent is not defined for x = 0." into blowup
  296. return 9999999999999999999999999999999999999999999999999999
  297. exit ctnh
  298. end if
  299. return cosh(x)/sinh(x)
  300. end ctnh
  301.  
  302. function asinh x
  303. -- Inverse Hyperbolic Sine
  304. -- Good for all x
  305. return ln (x + sqrt(x^2 + 1))
  306. end asinh
  307.  
  308. function acosh x
  309. -- Inverse Hyperbolic Cosine
  310. global blowup
  311. if x < 1 then
  312. put "The Inverse Hyperbolic Cosine is not defined for x < 1." into blowup
  313. return 9999999999999999999999999999999999999999999999999999
  314. exit acosh
  315. end if
  316. return ln (x + sqrt(x^2 - 1))
  317. end acosh
  318.  
  319. function atanh x
  320. -- Inverse Hyperbolic Tangent
  321. global blowup
  322. if abs(x) >= 1 then
  323. put "The Inverse Hyperbolic Tangent is not defined for |x| > 1." into blowup
  324. return 9999999999999999999999999999999999999999999999999999
  325. exit atanh
  326. end if
  327. return ln((1+x)/(1-x))/2
  328. end atanh
  329.  
  330. function acsch x
  331. -- Inverse Hyperbolic Cosecant
  332. global blowup
  333. if x = 0 then
  334. put "The Inverse Hyperbolic Cosecant is not defined for x = 0." into blowup
  335. return 9999999999999999999999999999999999999999999999999999
  336. exit acsch
  337. end if
  338. return ln(1/x+sqrt(1+x^2)/abs(x))
  339. end acsch
  340.  
  341. function asech x
  342. -- Inverse Hyperbolic Secant
  343. global blowup
  344. if x Γëñ 0 or x ΓëÑ 1 t