Contents

delphimoon

               Moon component

TMoon                Algorithms                History                

Top  Next

 

Unit

Moon

 

Description

The unit Moon.pas contains a collection of astronomical algorithms together with a visual component tmoon which can be used to easily show the moon pictore io various applications.

 

But this all would have been impossible without the book "Astronomical Algorithms" by Jean Meeus, where all the algorithms used in this component are listed originally. So if you want to get a deeper understanding in how the calculations work, what are the limits of it, want to find more algorithms, etc., this book is highly recommended.

 

If you are interested in more information about the calendar, especially the history of the now commonly used gregorian calendar, I recommend the book "Marking Time" by Duncan Steel; or for a lot of calendrical algorithms the book "Calendrical Calculations" by Nachum Dershowitz and Edward M. Reingold.

 

For updates and a listing of bugs (often with patches or work-arounds), a more complete bibliography, various internet resources, etc., check the moon webpage. This software comes as freeware, you may use it any way you like. However there is no warranty whatsoever, I can only promise I did my best to avoid bugs. If you want to redistribute this component only do it completely with all the files in the archive. Finally if you like this component all I ask you to do is send me a nice postcard of your hometown - other presents are also welcome but a postcard is enough.

 

Component Usage

There are two ways to install the components - either you use the ready-made package file (be sure to use the one fitting to your Delphi version), or you can install manually into your favourite package (in Delphi 1 and 2 there is only one component library). Select "Install Component" in the menu and then open the file moon_reg.pas. You well then see this component in the "Custom" tab of the component list, so you can easily drop it onto your application. The component itself is in the unit mooncomp.pas.

Starting with Delphi 6/Kylix the new cross-platform visual library CLX is supported, the unit qmoonreg.pas makes the component available for this library as well.

 

Algorithm Usage

There is a big seiection of astronomical algorithms included in the unit moon.pas, both for the functions originally included in the Moontool, as well as plenty of additional ones very useful for both astronomical as well as calendarical applications. These can be used independent from the component.

 

There are two compiler switches which can be used to modify the internal working of the algorithms. The first one is nomath, which is used to optionally use the unit math or not. This unit is not included in every version of Delphi, so the default setting is to use my own implementation of the needed math algorithms. If you have the unit math and wish to use it instead, you need to remove the following line from the header of the unit ah_math:

 

(*$define nomath *)

 

The second one is the switch called meeus used for the calculation of the sun position by the VSOP planetary theory as well as the ELP moon theory. Meeus used a truncated version of it by ignoring those terms only needed for higher accuracy, but for most cases the limited accuracy is enough. In case you want to use the full VSOP instead you can switch off the compiter switch meeus in the vsop unit. Note that this will increase the size of your executable quite a bit, it will increase the calculation times sometimes noticeably, and it's not possible for Delphi 1 due to the limited site of the data segment.

 

As the full terms of the ELP moon theory would increase the size of this package too much they are only available for download on my homepage, together with the VSOP planetary terms for the other planets both in the Meeus and the full theory.

 

Thanks

A great number of people contributed to this component by reporting bugs, suggesting enhancements or even sending code I just needed to include. So instead of listing those names I can still remember and forgetting many others I just thank everybody who wrote me, and hope you will apologize me if I didn't answered your email...