home *** CD-ROM | disk | FTP | other *** search
/ Otherware / Otherware_1_SB_Development.iso / mac / hypercar / fun / sundial.sit / Sundial / stack_-1.xml < prev    next >
Encoding:
Extensible Markup Language  |  1991-04-15  |  3.7 KB  |  26 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>5</cardCount>
  7.     <cardID>3829</cardID>
  8.     <listID>5319</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 calculate
  17. set cursor to 4
  18. repeat with x = 1 to 6
  19. if card field x is empty then put "0" into card field x
  20. end repeat
  21. lock screen
  22. put the value of cd field "LatDeg" into dlat
  23. put the value of cd field "LatMin" into mlat
  24. put the value of cd field "LatSec" into slat
  25. put the value of cd field "LonDeg" into dlon
  26. put the value of cd field "LonMin" into mlon
  27. put the value of cd field "LonSec" into slon
  28. put (dlat + mlat/60 + slat/3600) into lat    -- Calculate latitude
  29. put (lat*pi/180) into lat
  30. put (dlon + mlon/60 + slon/3600) into lon    -- Calculate longitude
  31. put (lon*pi/180) into lon
  32. put (sin(lat)) into sinlat
  33.  
  34. if hilite of card button 6 is true then
  35. repeat with x = 2 to 5   -- Determine time zone chosen
  36. if the hilite of button x is true then put (x-1) into tzone
  37. end repeat
  38. put (60 + tzone*15) into zonelon   -- Determine local time zone longitude
  39. put (zonelon*pi/180) into zonelon
  40. put (zonelon - lon) into deltalon   -- Difference in longitudes
  41. else put 0 into deltalon
  42. put empty into card field 7
  43. doMenu "New Card"
  44. hide menuBar
  45. set lineSize to 2
  46. set textFont to "Geneva"
  47. set textSize to 18
  48. set textStyle to plain
  49. choose rectangle tool
  50. drag from 56,32 to 356,332
  51. put (atan(0.5)) into thmax
  52.  
  53. repeat with x = -5 to 5
  54. choose line tool
  55. put (deltalon + 15*x*pi/180) into timeang   -- Time angle of line
  56. put (atan(tan(timeang)*sinlat)) into hourang   -- Hour angle
  57. put (hourang*180/pi) & return after card field 7 of card "Calculate"
  58. if (abs(hourang) <= thmax) then
  59. put 1 into flag
  60. put round(206 + 300*tan(hourang)) into newx
  61. put 32 into newy
  62. drag from 206,332 to newx,newy   -- Draw hour angle
  63. else
  64. put 0 into flag
  65. put round(206 + 150*abs(hourang)/hourang) into newx
  66. put round(332 - 150/abs(tan(hourang))) into newy
  67. drag from 206,332 to newx,newy   -- Draw hour angle
  68. end if
  69. choose text tool
  70. if flag = 1 then set textAlign to center
  71. else set textAlign to right
  72. if flag = 1 then click at newx,(newy - 14)
  73. else click at (newx + abs(hourang)/hourang*23),newy
  74. if x = -5 then type "VII"
  75. else if x = -4 then type "VIII"
  76. else if x = -3 then type "IX"
  77. else if x = -2 then type "X"
  78. else if x = -1 then type "XI"
  79. else if x = 0 then type "XII"
  80. else if x = 1 then type "I"
  81. else if x = 2 then type "II"
  82. else if x = 3 then type "III"
  83. else if x = 4 then type "IV"
  84. else if x = 5 then
  85. click at (newx + abs(hourang)/hourang*10),newy
  86. set textAlign to left
  87. type "V"
  88. end if
  89. end repeat
  90. click at 410,50
  91. type "Latitude" & return
  92. type dlat && mlat && slat & return & return
  93. type "Longitude" & return
  94. type dlon && mlon && slon & return
  95. if hilite of card button 6 of card "Calculate" is true then type "Mean"
  96. else type "Apparent"
  97. choose browse tool
  98. show bg button 3
  99. end calculate
  100.  
  101. on openStack
  102. hide message box
  103. go to card "Instructions"
  104. end openStack</script>
  105.     <background id="2075" file="background_2075.xml" name="eqn of time" />
  106.     <background id="2783" file="background_2783.xml" name="Sundial" />
  107.     <background id="4400" file="background_4400.xml" name="" />
  108.     <card id="3829" file="card_3829.xml" marked="false" name="Instructions" owner="2783" />
  109.     <card id="5648" file="card_5648.xml" marked="false" name="" owner="2783" />
  110.     <card id="2558" file="card_2558.xml" marked="false" name="Eqn of time" owner="2075" />
  111.     <card id="4119" file="card_4119.xml" marked="false" name="US time zones" owner="4400" />
  112.     <card id="2854" file="card_2854.xml" marked="false" name="Calculate" owner="2783" />
  113. </stack>
  114.