home *** CD-ROM | disk | FTP | other *** search
/ Otherware / Otherware_1_SB_Development.iso / mac / hypercar / fun / astroalm.sit / Almanac / stack_-1.xml < prev    next >
Extensible Markup Language  |  1989-10-15  |  8KB  |  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>15</cardCount>
  7.     <cardID>2966</cardID>
  8.     <listID>11014</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 openStackglobal force,intl,moonif the version < "1.2" thenAsk "This stack requires HyperCard 1.2.1 or newer" with "Drat!"go recent cdend ifput 0 into moonif the short name of second cd is "Occult." then put 1 into moonput 0 into forcehide message boxput the seconds/86400 + 16480.5 + DSTCheck()/24 into jd2put trunc(jd2+24000000) +1 into jdget the dateif it contains "."then put true into intlelse put false into intlconvert it to dateItemsif intl thenrepeat with i=1 to number of chars of itif char i of it = "." then put "," into char i of itend repeatput item 1 of it into dput item 2 of it into melseput item 2 of it into mput item 3 of it into dend ifput false into valif m>4 and m<=10 then put true into valput trunc(jd-7*trunc(jd/7)) into wif m=4 and d>=w-1 then put true into valif m=10 and (d-w)>=25 then put false into valset hilite of bkgnd button "DST" of cd origin to valif val thenput "D" into char 3 of last word of cd fld coords of cd originelseput "S" into char 3 of last word of cd fld coords of cd originend ifpush cdif the short name of this cd is "origin" thenput line 2 of cd fld "Algol" into eclrepeatif ecl > jd2 then exit repeatadd 2.8673075 to eclend repeatset numberFormat to "0.0"put "Next minimum of Algol occurs in" && (ecl-jd2)*24 &&┬¼"hours at JD=" into line 1 of cd fld Algolset numberFormat to "0.###"put ecl+2400000 after line 1 of cd fld Algolput ecl into line 2 of cd fld Algolend ifend openStackfunction nDate Uflag,Jflag,n-- Uflag =0 for no UT, 1 for UT-- Jflag =12 for JT, 0 for no JT-- n = # days after given dateglobal intlget the secondsadd 86400*n+3600*(Jflag+Uflag*DSTcheck()) to itconvert it to long dateif intl thenput char 1 to (offset(".",second word of it)-1) of second word of it ┬¼&& third word of it && last word of it into heelseput char 1 to (offset(",",third word of it)-1) of third word of it ┬¼&& second word of it && last word of it into heend ifreturn heend nDatefunction DSTcheckget first word of line 4 of cd fld Coords of cd originif hilite of bkgnd button "DST" of cd originthen put it-1 into tempelse put it into tempreturn tempend DSTcheckfunction sgn xif x<0 thenget -1else if x=0 thenget 0else if x>0 thenget 1end ifreturn itend sgnfunction sind nreturn sin(n*pi/180)end sindfunction cosd nreturn cos(n*pi/180)end cosdfunction tand nreturn tan(n*pi/180)end tandon dayOfYear-- returns day, dayUT as number of day in yearglobal dayUT,day,daySecs,intlput the date into daysecsif intl thenrepeat with i=1 to number of chars of daysecsif char i of daysecs = "." then put "/" into char i of daysecsend repeatend ifconvert daySecs to secondsput number of chars of the date into ndateput "12/31/" & (char ndate-1 to ndate of the date)-1 into Jan0convert Jan0 to secondsput (daySecs-Jan0)/86400 into dayput (daySecs-Jan0+3600*DSTcheck())/86400 into dayUTend dayOfYearon cheb a,b,cglobal x,xa,xbput 2*x*a-b+c into tempput a into xbput temp into xaend chebon UTglobal day,daySecs,x,xa,xb,mdayOfYear -- gets daySecsget ((the seconds-daySecs)/3600+DSTcheck())mod 24put trunc(it) into hput trunc(60*(it-h)) into mif m<10 then put "0" before mif h=0 then put "0" before hput "Universal Time = "& h &":" & m into line 1 of fld UTput it into line 2 of fld UTend UTon STglobal day,daySecs,x,xa,xb,dayUTdayOfYear -- gets dayput (dayUT-1)/183-1 into xput 0 into aput 0 into bput 7 into irepeat until i=0cheb a,b,word i+1 of cd fld "Sidereal Cheb" of cd originput xa into aput xb into bsubtract 1 from iend repeatput xb into b2cheb a,b,word 1 of cd fld "Sidereal Cheb" of cd originget ((xa-b2)/2+((the seconds-daySecs)/3600+DSTcheck())*1.00273791-┬¼(line 2 of cd fld "coords" of cd origin)/15+24) mod 24put trunc(it) into hput trunc(60*(it-h)) into mif m<10 then put "0" before mif h=0 then put "0" before hput "Sidereal Time = "& h &":" & m into line 1 of fld STput it into line 2 of fld STend STon hm decv,argglobal h,mput trunc(arg) into hput trunc(60*(arg-h)) into mif decv then put abs(m) into mif m<10 then put "0" before mend hmon calc num,forceset cursor to 1001-- calcs ra and dec, force =1 means do it anywayglobal day,daySecs,x,xa,xb,dayUT,it,h,m,modedayOfYear -- gets day,dayUTput pi/180 into facget line 3 of fld UTput line 1 of cd fld "Coords" of cd origin into latif (it=trunc(dayUT) and the optionkey is up) and force=0 thenput line 5 of fld Pos into draput (line 6 of fld Pos) into decput line 3 of fld rise into argelseset cursor to 1002put trunc(dayUT) into line 3 of fld UTput (dayUT+((the seconds-daySecs)/3600+DSTcheck())/24-1)/183-1 ┬¼into xput 0 into aput 0 into bput num into irepeat until i=0set cursor to busycheb a,b,word i+1 of fld "ra cheb"put xa into aput xb into bsubtract 1 from iend repeatput xb into b2cheb a,b,word 1 of fld "ra cheb"get ((xa-b2)/2+48) mod 24put it*15 into draput dra into line 5 of fld Poshm false,itput short name of this cd &" R.A. = "& h &"h " & m &"m"into┬¼line 1 of fld Posput 0 into aput 0 into bput num into irepeat until i=0set cursor to busycheb a,b,word i+1 of fld "dec cheb"put xa into aput xb into bsubtract 1 from iend repeatput xb into b2cheb a,b,word 1 of fld "dec cheb"get (xa-b2)/2put it into decput it into line 6 of fld Posput empty into signif it<0 and it>-1 then put "-" into signif it>0 then put "+" into signhm true,itput short name of this cd&" Dec.  = "&sign&h&"┬░ "&m&"'" ┬¼into line 2 of fld Posif "Sun" is in short name of this cd thenget (-.20791-sind(lat)*sind(dec))/(cosd(lat)*cosd(dec))put abs(atan(sqrt(1-it*it)/it)) into angif -.20791<sind(lat)*sind(dec) then put pi-ang into angput ang/fac/15 into deltaput (dra/15+(line 2 of fld UT)-line 2 of fld 2+24-DSTcheck()) ┬¼mod 24 into argget arg-deltaput it into line 3 of cd fld twilighthm false,itampmput "Twilight begins at "& h &":" & m && mode into line 1 of┬¼cd fld twilightget arg+deltaput it into line 4 of cd fld twilighthm false,itampmput "Twilight ends    at "& h &":" & m && mode into line 2 of ┬¼cd fld twilightend ifget -sind(lat)*sind(dec)/cosd(lat)/cosd(dec)put atan(sqrt(1-it*it)/it) into angif dec>0 thenadd pi to angend ifput ang/fac/15 into deltaput dra/15+line 2 of fld UT-line 2 of fld ST+24-DSTcheck()into argget (arg-delta) mod 24put arg into line 3 of fld riseput it into line 4 of fld risehm false,itampmput short name of this cd && "Rises at "& h &":" & m && mode ┬¼into line 1 of fld riseget (arg+delta) mod 24put it into line 5 of fld risehm false,itampmput short name of this cd && "Sets  at "& h &":" & m && mode into ┬¼line 2 of fld riseset cursor to 1001end if-- calc alt and az of objectput ((360+15*(line 2 of fld ST)-dra) mod 360) into LHAput cosd(LHA)*sind(lat)-tand(dec)*cosd(lat) into denput round(atanq(den,sind(LHA))/fac) into tempput sind(lat)*sind(dec)+cosd(lat)*cosd(dec)*cosd(LHA) into sinaif abs(sina)<1 thenput round(atan(sina/(sqrt(1-sina*sina)))/fac) into altif alt>0 thenput "Az. = "& temp into line 3 of fld Posput "Alt. = " & alt into line 4 of fld Poselseif temp>180then put "W" into temelse put "E" into temput "below " & tem & " horizon" into line 3 of fld Posput empty into line 4 of fld Posend ifelsebeepend ifset cursor to 1end calcfunction atanq x,yget atan(y/x)if x>0 then add pi to itreturn it mod (2*pi)end atanqon ampmglobal h,mode,intlif intl thenput