home *** CD-ROM | disk | FTP | other *** search
/ The Datafile PD-CD 5 / DATAFILE_PDCD5.iso / utilities / m / moontool / !MoonTool / !Help next >
Text File  |  1993-08-08  |  35KB  |  1,123 lines

  1. /*
  2.                         Moon Tool for the Archimedes
  3.                         ============================
  4.  
  5.            Sun Workstation version ................ John Walker
  6.            Archimedes Risc OS 3.1 port ............ Edouard Poor
  7.  
  8.                    This  program is in the public domain: 
  9.              "Do what thou wilt shall be the whole of the law".
  10.  
  11.  
  12. Introduction
  13. ============
  14.  
  15.    MoonTool is a program designed give you the following infomation:
  16.  
  17.       o  Phase of the Moon
  18.  
  19.       o  Age of the Moon
  20.  
  21.       o  Distance to the moon
  22.  
  23.       o  Dates of the Last and Next New moon as well as the First and
  24.          Last Quarters and the Full Moon.
  25.  
  26.       o  Angle the Moon subtends
  27.  
  28.    In addition it also gives you information about:
  29.  
  30.       o  Time and Date in Julian, Local and Universal (GMT) times.
  31.  
  32.       o  Distance to the Sun
  33.  
  34.       o  Angle the Sun subtends
  35.  
  36.    An invaluable tool for those of you who don't like going outside to look
  37.    at the moon, all the nethack players among you, astronomers who like
  38.    to know when the moon it new and thus the stars are at their best viewing,
  39.    or indeed anyone who just really needs to exactly how far away the moon
  40.    and sun are...
  41.  
  42.  
  43. Interface
  44. =========
  45.  
  46.    The program starts up in it's iconised mode, giving you a simple window
  47.    with a single button displaying a picture of the moon as it appears
  48.    in the sky. You can move the window with its title bar, or click on the
  49.    icon to bring up the full, un-iconised, view.
  50.  
  51.    In un-iconised mode you are presented with all the information about the
  52.    current time, the moons distance and age, the suns distance, and the
  53.    "Moon Phase" icon. Looking to the top right of the window you will see
  54.    that it has a full-size icon; clicking on this will reveal additional
  55.    information about the dates of the phases of the moon (all in UTC, or
  56.    Universal Time).
  57.  
  58.    Clicking again on the "Moon Phase" icon of the moons current appearance
  59.    will put the program back into iconised mode.
  60.  
  61.    Quitting the prgram simply consists of closing the window when it is
  62.    in un-iconised mode.
  63.  
  64.  
  65. Risc OS 3.1 Notes
  66. =================
  67.  
  68.    This program needs both Local Time and Greenwich Mean Time set up
  69.    correctly in your machine. 
  70.  
  71.    This requires two things-- Firstly setting the configured time in your
  72.    machine to Greenwich Mean Time then getting the time correct for
  73.    where you live by setting the Congfiguration Setting 'TimeZone' (you
  74.    can type "help TimeZone" on the command line). This step will probably
  75.    be unnessesary in the UK where you are on GMT anyway...
  76.    Where I live (in New Zealand) I use "configure TimeZone +12:0"
  77.  
  78.    The second step is to do with daylight savings-- Use !Alarm to toggle
  79.    between daylight savings on and off instead of altering the time or
  80.    the TimeZone offset. (Daylight Savings Time or DST is labeled 'BST'
  81.    in !Alarms 'Set Time' window, which stands for British Summer Time,
  82.    because Acorn is Very Good at Internationalisation...)
  83.  
  84.    If you set and maintain the time in the method outlined above, you
  85.    will always be able to have the correct time, and be able to work
  86.    out the time in GMT or UTC as well, as will any program that needs
  87.    to know the time in both local and universal. C programs that use
  88.    localtime() and gmtime(), for example, need this.
  89.    
  90.  
  91. Problems
  92. ========
  93.  
  94.    There are no problems or bugs with this program. It is perfect in every
  95.    way and any difficulties you may experience are one of the three following
  96.    people, or organisation's fault:
  97.  
  98.       o  Yourself
  99.  
  100.       o  Your Acorn Dealer
  101.  
  102.       o  Acorn Computers Limited
  103.  
  104.    For example you might say "When I run !MoonTool on my RO2 machine it
  105.    crashes" - This would be your fault for not purchasing Risc OS 3.1 yet.
  106.  
  107.    You might say "In 256 colour mode the button plinths in, but it also
  108.    inverts as well" - This would be Acorns fault for not having better
  109.    'Kwality Kontrol' on its operating systems.
  110.  
  111.    Also someone might complain "When the moon behind a cloud I can't see it
  112.    but I can still it on my computer. Could you set it up so that it's
  113.    visiability is always the same as the real moon?" - This would be their
  114.    dealers fault for selling a computer to someone whose IQ was obviously
  115.    in the low 70's...
  116.  
  117.    In short, if you havn't worked it out yet, I take no responibility for
  118.    anything at all to do with this program.
  119.  
  120.  
  121. To Be Done
  122. ==========
  123.  
  124.    Well everything is actually about as well done as it's likely to get,
  125.    but if anyone wants to send me any improvments to the address below
  126.    I'd be very grateful, and will release anothr version with your
  127.    modifications and credit.
  128.  
  129.    Also if anyone can design me a better Filer Icon I'd be most happy
  130.    to replace the one I've got at the moment...
  131.  
  132.    If anyone feels like spell checking this !Help file I'm sure hundreds,
  133.    if not thousands, of english speakers around the world would be grateful
  134.    to you :-)
  135.  
  136.  
  137. Author Info (Archimedes Version)
  138. ================================
  139.  
  140.    Send all snail mail/money orders/cheques/cash to:
  141.          Edouard Poor
  142.          15 Stanley Pt Rd
  143.          Devonport
  144.          Auckland
  145.          New Zealand
  146.  
  147.    Email/uu-files may be addressed to:
  148.          epoo1@cs.aukuni.ac.nz    (valid until at least March 1994)
  149.          edouard@nacjack.gen.nz   (not used very often)
  150.  
  151.    Voice line:
  152.          +64 9 4450330
  153.  
  154.  
  155. Bibliography
  156. ============
  157.  
  158.    The algorithms used in this program to calculate the positions Sun and
  159.    Moon as seen from the Earth are given in the book "Practical Astronomy
  160.    With Your Calculator" by Peter Duffett-Smith, Second Edition, Cambridge
  161.    University Press, 1981. Ignore the word "Calculator" in the title; this
  162.    is an essential reference if you're interested in developing software
  163.    which calculates planetary positions, orbits, eclipses, and the like. If
  164.    you're interested in pursuing such programming, you should also obtain:
  165.  
  166.    "Astronomical Formulae for Calculators" by Jean Meeus, Third Edition,
  167.    Willmann-Bell, 1985. A must-have.
  168.  
  169.    "Planetary Programs and Tables from -4000 to +2800" by Pierre Bretagnon
  170.    and Jean-Louis Simon, Willmann-Bell, 1986. If you want the utmost
  171.    (outside of JPL) accuracy for the planets, it's here.
  172.  
  173.    "Celestial BASIC" by Eric Burgess, Revised Edition, Sybex, 1985. Very
  174.    cookbook oriented, and many of the algorithms are hard to dig out of the
  175.    turgid BASIC code, but you'll probably want it anyway.
  176.  
  177.    Many of these references can be obtained from Willmann-Bell, P.O. Box
  178.    35025, Richmond, VA 23235, USA. Phone: (804) 320-7016. In addition to
  179.    their own publications, they stock most of the standard references for
  180.    mathematical and positional astronomy.
  181.  
  182.  
  183. Sun Workstation (Original) Author Info
  184. ======================================
  185.  
  186.    A Moon for the Sun
  187.  
  188.    Release 2.0
  189.  
  190.    Designed and implemented by John Walker in December 1987,
  191.    revised and updated in February of 1988.
  192.  
  193.    This program was written by:
  194.  
  195.        John Walker
  196.        Autodesk, Inc.
  197.        2320 Marinship Way
  198.        Sausalito, CA  94965
  199.        (415) 332-2344 Ext. 829
  200.  
  201.        Usenet: {sun!well}!acad!kelvin
  202.  
  203.    I'd appreciate receiving any bug fixes and/or enhancements, which I'll
  204.    incorporate in future versions of the program. Please leave the original
  205.    attribution information intact so that credit and blame may be properly
  206.    apportioned.
  207.  
  208.  
  209. Source Code
  210. =========== 
  211.  
  212.    Well it was originally compiled with my own personal library "QDD_Lib"
  213.    but it uses very few calls, and they are all, unlike Acorns "RISC_OSLib"
  214.    ones, very easy to read. It should be very easy for anyone with a C
  215.    compiler and any set of wimp libraries to convert this program to
  216.    compile under their own set-up.
  217.  
  218.    Enjoy.
  219.  
  220.  *
  221.  *
  222.  *
  223.  *  Astronomical constants 
  224.  */
  225. #define epoch       2444238.5      /* 1980 January 0.0 */
  226.  
  227. /*
  228.  *  Constants defining the Sun's apparent orbit  
  229.  */
  230. #define elonge      278.833540     /* Ecliptic longitude of the Sun at epoch 1980.0 */
  231. #define elongp      282.596403     /* Ecliptic longitude of the Sun at perigee */
  232. #define eccent      0.016718       /* Eccentricity of Earth's orbit */
  233. #define sunsmax     1.495985e8     /* Semi-maj