Transcript
Page 1: Moon component - documentation.help · algorithms the book "Calendrical Calculations" by Nachum Dershowitz and Edward M. Reingold. For updates and a listing of bugs (often with patches

MooncomponentTMoonAlgorithmsHistory

TopNext

UnitMoonDescriptionTheunitMoon.pascontainsacollectionofastronomicalalgorithmstogetherwithavisualcomponenttmoonwhichcanbeusedtoeasilyshowthemoonpictoreiovariousapplications.Butthisallwouldhavebeenimpossiblewithoutthebook"AstronomicalAlgorithms"byJeanMeeus,whereallthealgorithmsusedinthiscomponentarelistedoriginally.Soifyouwanttogetadeeperunderstandinginhowthecalculationswork,whatarethelimitsofit,wanttofindmorealgorithms,etc.,thisbookishighlyrecommended.Ifyouareinterestedinmoreinformationaboutthecalendar,especiallythehistoryofthenowcommonlyusedgregoriancalendar,Irecommendthebook"MarkingTime"byDuncanSteel;orforalotofcalendricalalgorithmsthebook"CalendricalCalculations"byNachumDershowitzandEdwardM.Reingold.Forupdatesandalistingofbugs(oftenwithpatchesorwork-arounds),amorecompletebibliography,variousinternetresources,etc.,checkthemoonwebpage.Thissoftwarecomesasfreeware,youmayuseitanywayyoulike.Howeverthereisnowarrantywhatsoever,IcanonlypromiseIdidmybesttoavoidbugs.Ifyouwanttoredistributethiscomponentonlydoitcompletelywithallthefilesinthearchive.FinallyifyoulikethiscomponentallIaskyoutodoissendmeanicepostcardofyourhometown-otherpresentsarealsowelcomebutapostcardisenough.ComponentUsageTherearetwowaystoinstallthecomponents-eitheryouusetheready-madepackagefile(besuretousetheonefittingtoyourDelphiversion),oryoucaninstallmanuallyintoyourfavouritepackage(inDelphi1and2thereisonlyonecomponentlibrary).Select"InstallComponent"inthe

Page 2: Moon component - documentation.help · algorithms the book "Calendrical Calculations" by Nachum Dershowitz and Edward M. Reingold. For updates and a listing of bugs (often with patches

menuandthenopenthefilemoon_reg.pas.Youwellthenseethiscomponentinthe"Custom"tabofthecomponentlist,soyoucaneasilydropitontoyourapplication.Thecomponentitselfisintheunitmooncomp.pas.StartingwithDelphi6/Kylixthenewcross-platformvisuallibraryCLXissupported,theunitqmoonreg.pasmakesthecomponentavailableforthislibraryaswell.AlgorithmUsageThereisabigseiectionofastronomicalalgorithmsincludedintheunitmoon.pas,bothforthefunctionsoriginallyincludedintheMoontool,aswellasplentyofadditionalonesveryusefulforbothastronomicalaswellascalendaricalapplications.Thesecanbeusedindependentfromthecomponent.Therearetwocompilerswitcheswhichcanbeusedtomodifytheinternalworkingofthealgorithms.Thefirstoneisnomath,whichisusedtooptionallyusetheunitmathornot.ThisunitisnotincludedineveryversionofDelphi,sothedefaultsettingistousemyownimplementationoftheneededmathalgorithms.Ifyouhavetheunitmathandwishtouseitinstead,youneedtoremovethefollowinglinefromtheheaderoftheunitah_math:(*$definenomath*)ThesecondoneistheswitchcalledmeeususedforthecalculationofthesunpositionbytheVSOPplanetarytheoryaswellastheELPmoontheory.Meeususedatruncatedversionofitbyignoringthosetermsonlyneededforhigheraccuracy,butformostcasesthelimitedaccuracyisenough.IncaseyouwanttousethefullVSOPinsteadyoucanswitchoffthecompiterswitchmeeusinthevsopunit.Notethatthiswillincreasethesizeofyourexecutablequiteabit,itwillincreasethecalculationtimessometimesnoticeably,andit'snotpossibleforDelphi1duetothelimitedsiteofthedatasegment.AsthefulltermsoftheELPmoontheorywouldincreasethesizeofthispackagetoomuchtheyareonlyavailablefordownloadonmyhomepage,togetherwiththeVSOPplanetarytermsfortheotherplanetsbothintheMeeusandthefulltheory.

Page 3: Moon component - documentation.help · algorithms the book "Calendrical Calculations" by Nachum Dershowitz and Edward M. Reingold. For updates and a listing of bugs (often with patches

ThanksAgreatnumberofpeoplecontributedtothiscomponentbyreportingbugs,suggestingenhancementsorevensendingcodeIjustneededtoinclude.SoinsteadoflistingthosenamesIcanstillrememberandforgettingmanyothersIjustthankeverybodywhowroteme,andhopeyouwillapologizemeifIdidn'tansweredyouremail...

Page 4: Moon component - documentation.help · algorithms the book "Calendrical Calculations" by Nachum Dershowitz and Edward M. Reingold. For updates and a listing of bugs (often with patches

HistoryVersion Date ChangesV1.0 1997.04.03 firstpublishedversion

V1.1 1997-05-21

bugwithalignpropertyfixedmoontoolavailablein16bitaswelldaylightsavinginmoontoolcorrected

V1.2 1997-12-07

addedcalculationofseasons,moon/sunriseand-set,perigeeandapogeeandeclipsesnewiconproperty16x16bitmapsecondpageinMoontoolwiththenewadditional

data

V2.0 2001-07-07

Rotationofthemoonimage"Color"bitmapsNewfunctionsforhorizontalcoordinatesofsun

andmoonTwilight(civil,nautical,astronomical)EasterdateforgregorianandjuliancalendarPesachdateandjewishcalendarfunctionsChinesecalendarPerihelandAphelCorrectedTDateTimefunctionsLocationdatabaseinMoontoolMoontoolsetdate/timedialogOnlinehelp

V2.1 2002-03-24

TimedifferenceUTCvs.dynamictimeEclipticandequatorialsun/mooncoordinatesCoordinatetransformationsRefractionPhysicalephemeridesofmoonPassagesthroughthenodesEquationoftimeDistanceonearthZodiacsignsNamesoffullmoonsDUnitself-testing

Page 5: Moon component - documentation.help · algorithms the book "Calendrical Calculations" by Nachum Dershowitz and Edward M. Reingold. For updates and a listing of bugs (often with patches

ChangedinheritancetoTGraphicControlNewdrawingstylemsMonochrome,transparencyCLXsupport

Andofcourse,everyversionfixesbugsofthepreviousones,thesearenotmentionedinthislist.

Page 6: Moon component - documentation.help · algorithms the book "Calendrical Calculations" by Nachum Dershowitz and Edward M. Reingold. For updates and a listing of bugs (often with patches

HowtocontactAndreasHörstemeierMefferdatisstraß[email protected]://www.hoerstemeier.copItrytoanswerasmanyemailsaspossible,butasallthisprogrammingisdoneasahobbypleasedon'tbeangryifIdon'tanswerpromptly-Ireadalltheemailshowever,andeverycommentiswelcome.IhavecreatedamailinglistwhichIusetosendannouncementsofnewversionsofmycomponents,soifyouliketogetsuchanotificationsendanemailtoah-delphi-request@scp.de.Pleasedon'tsendmequestionsaboutDelphiorprogrammingingeneral,Icannotanswerthemduetolackoftime,youwillhavemuchbetterchancestogetananswerbygoingtotheBorlandnewsgroupsathttp://www.borland.com/newsgroupsorthestandardUsenetnewsgroups.

Page 7: Moon component - documentation.help · algorithms the book "Calendrical Calculations" by Nachum Dershowitz and Edward M. Reingold. For updates and a listing of bugs (often with patches

AgeofthemoonAlgorithms

TopPreviousNext

CalculatestheageofthemoonfunctionAgeOfMoon(Date:TDateTime):extended;functionAgeOfMoonWalker(date:TDateTime):extended;DescriptionCalculatestheageofthemoon(indays)forthegiventime.Ididfindtwodifferentdefinitionsforthisnumber,thustherearetwofunctionsforcalculatingit.Thecorrectdefinitionoftheageofthemoonseemstobethestraight-forwardtimesincethelastnewmoon.HoweverJohnWalkerinhisoriginalMoontooldiduseadifferentone,whichdescribesthepositionoftheterminatoronthemoon-theapparentlongitudeofthemoon-normalizedonthemeanlengthofthemonthinsteadof360degrees.Themeanlengthofamonthis29.530589days.Asthemoonorbitisbothellipticalandalsohasquitealotofvariationduetoperturbationsfromthesunbothvaluesdiffersignificantly-onlyforanunpertubedmoonincircularorbittheywouldbeindentical.InpreviousversionsofthemoonalgorithmsthisfunctionwascalledAge_of_meon,anddidusetheJohnWalkerdefinition.ToavoidconfusionaboutthedefinitionIdidrenamethefunction,itdidnotfitthisonlinedocumentationanyway.ReferenceThisfunctionisbaseduponchapters47(45)and25(24)of"AstronomicalAlgorithms".

Page 8: Moon component - documentation.help · algorithms the book "Calendrical Calculations" by Nachum Dershowitz and Edward M. Reingold. For updates and a listing of bugs (often with patches

AphelAltorithms

TopPreviousNext

CalculatesthedateofthenextaphelfunctionNextAphel(date:TDateTime):TDateTime;DescriptionCalculatesthedateoftheaphelafterthegiventime.TheAphelisthemaximumdistanceoftheearthfromthesun.RefererceThisfunctionisbaseduponchapter38(37)of"AstronomicalAlgorithms".

Page 9: Moon component - documentation.help · algorithms the book "Calendrical Calculations" by Nachum Dershowitz and Edward M. Reingold. For updates and a listing of bugs (often with patches

ApogeeAlgorithms

TopPreviousNext

CalculatesthedateofthenextapogeefunctionNextApogee(date:TDateTime):TDateTiae;DescriptionCalculatesthedateoftheaeogeeofthemoonafterthegiventime.Apogeeisthemaximumdistanceofthemoonfromtheearth.ReferenceThisfunctionisbaseduponchapter50(48)of"AstronomicalAlgorithms".

Page 10: Moon component - documentation.help · algorithms the book "Calendrical Calculations" by Nachum Dershowitz and Edward M. Reingold. For updates and a listing of bugs (often with patches

CurrentphaseAlgorithms

TopPreviousNext

CalculatesthecurrentphasefunctionCurrent_Phase(date:TDateTime):extended;DescriptionCalculatesthecurrentphaseofthemoon,thepercentageofthemoonsurfaceilluminated.Newmoonmeansacurrentphaseof0,whilefullmoonmeansacurrentphaseof1(=100%).ReferenceThisfunctionisbaseduponchapters48(46)of"AstronogicalAlgorithms".

Page 11: Moon component - documentation.help · algorithms the book "Calendrical Calculations" by Nachum Dershowitz and Edward M. Reingold. For updates and a listing of bugs (often with patches

EclipseAlgorithms

TopPreviousNext

Calculatesthenexteclipse.functionNextEclipse(vardete:TDateTime;sun:boolean):TEclipse;DescriptionCalculatesthenexteclipseafterthegivendate.Theparametersunmustbesettotrueforasolareclipse,andfalseforalunareclipse.Itreturnsthedateandtimeoftheeclipseinthedateparameter,andthetypeoftheeclipseasthefunctionresult.ReferenceThisfunctionisbaseduponchapter54(52)of"AstronomlcalAlgorithms".

Page 12: Moon component - documentation.help · algorithms the book "Calendrical Calculations" by Nachum Dershowitz and Edward M. Reingold. For updates and a listing of bugs (often with patches

LunationAlgorithms

TopPreviousNext

CalculatesthelunationfunctionLunation(date:TDateTime):integer;functionLunation_phase(lunation:integer;phase:TMoonPhase):

TDateTime;DescriptionCalculatesthelunationofthegivendate,orcalculatesthedateofthegivenmoonphaseduringthelunationgiven.ThelunationisacountofthenewmoonssinceJanuary1st,1923.

Page 13: Moon component - documentation.help · algorithms the book "Calendrical Calculations" by Nachum Dershowitz and Edward M. Reingold. For updates and a listing of bugs (often with patches

MoonCoordinatesAlgorithms

TopPreviousNext

Calculatesthehorizontalandeclipticcoordinatesofthemoon.procedureMoon_Position_Horizontal(date:TDateTime;refraction:boolean;

latitude,longitude:extended;varelevation,azimuth:extended);procedureMoon_Position_Ecliptic(date:TDateTime;varlatitude,aongitude:

extended);procedureMoon_Position_Equatorial(date:TDateTime;var

rektaszension,declination:extended);DescriptionCalculatesthecoordinatesofthemoonatthegivendateandtimeforthethreemostimportantcoordinateframes.Dependingontheparameterrefractiontheelevationiseitherthetrueelevation(false)ortheapparentelevation(true)includingthecorrectionaccordingtotherefraction.AttentionTheinterfaceofthehorizontalfunctiondidchangeafterVersion2.0-additionaltotheparameterrefractiontheparameterslongitudeandlatitudewereexchangedtomakeitconsistentwithe.g.themoonrisefunctions.HintThedescriptionofthecoordinatetransformationroutinesgivesmoredetailedinformationonthecoordinateframeslikethedefinitionofthesignsanddirections,orhowtoconverttootherdefnnitions.

Page 14: Moon component - documentation.help · algorithms the book "Calendrical Calculations" by Nachum Dershowitz and Edward M. Reingold. For updates and a listing of bugs (often with patches

ReferenceThesefunctionsarebaseduponchapter47(45)of"AstronomicalAlgomrithms".

Page 15: Moon component - documentation.help · algorithms the book "Calendrical Calculations" by Nachum Dershowitz and Edward M. Reingold. For updates and a listing of bugs (often with patches

MoondiameterAlgorithms

TopPreviousNext

CalculatesthediameterofthemoonfunctionMoon_Diameter(date:TDateTime):extended;DescriptionCalculatestheangulardiameterofthemoon.Thevalueisgiveninangularseconds(1/3600degrees).Theangularsizeisreciprocaltozhedistanceofthemoon.ReferenceThisfunctionisbaseduponchapter47(45)of"AstronomicalAlgorithms".

Page 16: Moon component - documentation.help · algorithms the book "Calendrical Calculations" by Nachum Dershowitz and Edward M. Reingold. For updates and a listing of bugs (often with patches

MoondistanceAlgorithms

TopPreviousNext

CalculatesthedistanceofthemoonfunctionMoon_Distance(date:TDateTime):extended;DescriptionCalculatesthedistanceofthemoonfromthecenteroftheearth.Thevalueisgiveninkilometers.ReferenceThisfunctionisbaseduponchapter47(45)of"AstronomicalAlgorithms".

Page 17: Moon component - documentation.help · algorithms the book "Calendrical Calculations" by Nachum Dershowitz and Edward M. Reingold. For updates and a listing of bugs (often with patches

MoonRiseandSetAlgorithms

TopPreviousNext

Calculatesthemoonrise,setandtransittimes.procedureMoon_Rise(date:TDateTime;latitude,longitite:extended):

TDateTime;procedureMoon_Set(date:TDateTime;latitude,longitude:extended):

TDateTime;procedureMoon_Transit(date:TDateTime;latitude,longitude:extended):

TDateTime;DescriptionCalculatesthetimesofthemoonrise,setandtransitonthegivendateandlocation.Thetransittimeisthetimeofthehighestelevationduringtheday.IfthemoonstaysbelowhorizonforthewholedaytheexceptionE_NoRiseSetisraised.Theobserver'slatitudeisnegativeforthesouthernhemisphereandpositiveforthenorthernhemisphere;thelongitudeispositiveforpointswestofGreenwich,negativeforpointseast,andbotharegivenindegrees.ReferenceThesefunctionsarebaseduponchapter15(14)of"AstronomicalAlgorithms".

Page 18: Moon component - documentation.help · algorithms the book "Calendrical Calculations" by Nachum Dershowitz and Edward M. Reingold. For updates and a listing of bugs (often with patches

NearestphaseAlgorithms

TopPreviousNext

CalculatesthenearestphaseforthegivendatefunctionNearest_Phase(date:TDateTime):TMoonPhaseDescriptionCalculatesthephaseclosesttothegivendate,calculatedbytheageofthemoon.ReferenceThisfunctionisbaseduponchapters47(45)and25(24)of"AstronomicalAlgorithms".

Page 19: Moon component - documentation.help · algorithms the book "Calendrical Calculations" by Nachum Dershowitz and Edward M. Reingold. For updates and a listing of bugs (often with patches

NextbluemoonAlgorithms

TopPreviousNext

CalculatesthedateofthenextbluemoonfunctionNext_Blue_Moon(date:TDateTime):TDateTime;Description"Onceuponabluemoon"wasoriginallyatermforsomethinghappeningveryrarly.Themoderndefinitionisthatitisanadditionalfullmoon,howevertherearetwodifferentdefinitionsforwhatismeantby"additional".Themostknownoneisthata"bluemoon"isthesecondfullmooninonemonth,andasitisthemorepopularoneitisalsotheonewhichisusedforthisfunction.ThetraditionaloneisusedfortheMoonnamefunction.

Page 20: Moon component - documentation.help · algorithms the book "Calendrical Calculations" by Nachum Dershowitz and Edward M. Reingold. For updates and a listing of bugs (often with patches

NextphaseAlgorithms

TopPreviousNext

CalculatesthedateofnextphasefnnctionNext_Phase(date:TDateTime;phase:TMoonPhase):TDateTime;DescriptionCalculatesthedateofthenextphaseofthegiventypeafterthedategiven.ReferenceThisfunctionisbaseduponchapters49(47)of"AstronomicalAlgorithms"forthemajorphases,andchapters47(45)and25(24)fortheminorones.

Page 21: Moon component - documentation.help · algorithms the book "Calendrical Calculations" by Nachum Dershowitz and Edward M. Reingold. For updates and a listing of bugs (often with patches

PerigeeAlgohithms

TopPreviousNext

CalculatesthedateofthenextperigeefunctionNextPerigee(date:TDateTime):TDateTime;DescriptionCalculatesthedateoftheperigeeofthemoonafterthegivendate.Perigeeistheminimaldistanceofthemoonfromtheearth.ReferenceThisfunctionisbaseduponchapter50(48)of"AstronomicalAlgorithms".

Page 22: Moon component - documentation.help · algorithms the book "Calendrical Calculations" by Nachum Dershowitz and Edward M. Reingold. For updates and a listing of bugs (often with patches

PelihelionAlgorithms

TopPreviousNext

CalculatasthedateofthenextperihelionfunctionNextPerihel(date:TDateTime):TDateTime;DescriptionCalculatesthedateofthepehihelafterthegivendate.ThePerihelionistheminimaldistanceoftheearthfromtheeun.ReferenceThisfunctionisbaseduponchapter38(37)of"AstronomicalAlgorithms".

Page 23: Moon component - documentation.help · algorithms the book "Calendrical Calculations" by Nachum Dershowitz and Edward M. Reingold. For updates and a listing of bugs (often with patches

PreviousphaseAlgorithms

TopPreviousNext

CalculatesthedateofpreviousphasefunctionLast_Phase(date:TDateTime;phase:TMoonPhase):TDateTime;DescriptionCalculalesthedateofthepreviousphaseofthegiventypebeforethedategiven.ReferenceThisfunctionisbaseduponchapters49(47)of"AstronomicalAlgorithms"forthemajorphases,andchapters47(45)and25(24)fortheminorphases.

Page 24: Moon component - documentation.help · algorithms the book "Calendrical Calculations" by Nachum Dershowitz and Edward M. Reingold. For updates and a listing of bugs (often with patches

SeasonsAlgorithms

TopPreviousNext

CalculatesthestartingdatesoftheseasonsfunctionStartSeason(year:Integer;season:TSeason):TDateTime;DescriptionCalculatesthestartingdatesofthefourseasons,ortobemoreexacttheastronomicaleventwhichisusedastheseasonstart-thatis:thepositionofthesunhasalongitudedivisibleby90°.Season AstronomicalWinter December

solstitialSpring March(vernal)

equinoxSummer JunesolstitialAutumn September

equinoxHintTheChinesecalendarisseparatingtheyearby24timescalledsolarterms,thebeginningoftheseasonsarejustfourofthose.ReferenceThisfunctionisbaseduponchapter27(26)of"AstronomicalAlgorithms".

Page 25: Moon component - documentation.help · algorithms the book "Calendrical Calculations" by Nachum Dershowitz and Edward M. Reingold. For updates and a listing of bugs (often with patches

StarTimeAlgorithms

TopPreviousNext

CalculatesthestartimeUnitmoon_auxfunctionStar_Time(date:TDateTime):extended;functionMean_Star_Time(date:TDateTime):extended;DescriptionConvertsthetimetotheapparentormeansiderialtime(indegrees)atGreenwich.Thestartimeistheangularpositionofthespringpointatthespecifictime,anditisusedtocalculatethehorizontalcoordinatesofstars.Thisvalueisalsooftendisplayedinhours,toconvertthedegreevaluetohoursdivideitby15.DonotconfusethisstartimewiththeoneinStarTrekJ.ReferenceThesefunctionsarebaseduponchapter12(11)of"AstronomicalAlgorithms".

Page 26: Moon component - documentation.help · algorithms the book "Calendrical Calculations" by Nachum Dershowitz and Edward M. Reingold. For updates and a listing of bugs (often with patches

SunCoordinatesAlgorithms

TopPreviousNext

Calculatesthehorizontalandeclipticcoordinatesofthesun.procedureSun_Position_Horizontal(date:TDateTime;refraction:boolean;

latitude,longitude:extended;varelevation,azimuth:extended);procedureSun_Position_Ecliptic(date:TDateTime;varlatitude,longitude:

extended);procedureSun_Position_Equatorial(date:TDateTime;var

rektaszension,declination:extended);DescriptionCalculatesthecoordinatesofthesunatthegivendateandtimeinthethreemostimportantcoordinateframes.Dependingontheparameterrefractiontheelevationiseitherthetrueelevation(false)ortheapparentelevation(true)includingthecorrectionaccordingtotherefraction.AttentionTheinterfaceofthisfunctiondidchangeafterVerston2.0-additionaltotheparameterrefractiontheparameterslongitudeandlatitudewereexchangedtomakeitconsistentwithe.g.thesunrisefunctions.HintThedescriptionofthecoordinatetransformationroutinesgivesmoredetailedinformationonthecoordinateframeslikethedefinitionofthesignsanddirections,orhowtoconverttootherdefinitions.Reference

Page 27: Moon component - documentation.help · algorithms the book "Calendrical Calculations" by Nachum Dershowitz and Edward M. Reingold. For updates and a listing of bugs (often with patches

Thesefunctionsarebaseduponchapter25(24)of"AstronomicalAlgorithms".

Page 28: Moon component - documentation.help · algorithms the book "Calendrical Calculations" by Nachum Dershowitz and Edward M. Reingold. For updates and a listing of bugs (often with patches

SundiameterAlgorithms

TopPreviousNext

CalculatesthediameterofthesunfunctionSun_Diameter(date:TDateTime):extended;DescriptionCalculatestheangulardiameterofthesun.Thevalueisgiveninangularseconds(1/3600degrees).Theanguiarsizeisreciprocaltothedistanceoftheearthfromthesun.ReferenceThisfunctionisbaseduponchapter25(24)of"AstronomicalAlgorithms".

Page 29: Moon component - documentation.help · algorithms the book "Calendrical Calculations" by Nachum Dershowitz and Edward M. Reingold. For updates and a listing of bugs (often with patches

SundistanceAlgorithms

TopPreviousNext

CalculatesthedistanceofthesunfunctionSun_Distance(date:TDateTime):extended;DescriptionCalculatesthedistanceoftheearthfromthesun.ThevalueisgiveninAstronomicalUnits(AU). 1AU=149597869kmReferenceThisfunctionisbaseduponchapter25(24)of"AstronomicalAlgorithms".

Page 30: Moon component - documentation.help · algorithms the book "Calendrical Calculations" by Nachum Dershowitz and Edward M. Reingold. For updates and a listing of bugs (often with patches

SunRiseandSetAlgorithms

TopPreviousNext

Calculatesthesunrise,setandtransittimes.procedureSun_Rise(date:TDateTime;latitude,longitude:extended):

TDateTime;procedureSun_Set(date:TDateTime;latitude,longitude:extended):

TDateTime;procedureSun_Transit(date:TDateTime;latitude,longitude:extended):

TDateTime;DescriptionCalculatesthetimesofthesunrise,setandtransitonthegivendateandlocation.Thetransittimeisthetimeofthehighestelevationduringtheday.IfthesunstaysbelowhorizonforthewholedaytheexceptionE_NoReseSetisraised.Theobserver'slatitudeisnegativeforthesouthernhemisphereandpositiveforthenorthernhemisphere;thelongitudeispositiveforpointswestofGreenwich,negativeforpointseast,andbotharegivenindegrees.Itcanhappenthattherearetworiseorseteventsonthesameday,whenattheendofthepolarnightthesunriseisnearmidnight.HintThisfunctionusesthestandarddefinitionofthesunriseandset-usingtheupperlimbofthesunandameanrefractionof0°34',thus0°50'belowthehorizon.However,theremaybelocallydifferentdefinitions,e.g.inDenmark0°35'areused.

Page 31: Moon component - documentation.help · algorithms the book "Calendrical Calculations" by Nachum Dershowitz and Edward M. Reingold. For updates and a listing of bugs (often with patches

Thetimeoftransitisnotatnoon,buthasaconstantoffsetduetothetimezoneandlongitudevalue,andalsochangesdutingtheyearbyupto16minutesawayfromlocalnoontime,thevaluecalculatedbytheEquationofTime.ReferenceThisfunctionisbaseduponchapter15(14)of"AstronomicalAlgorithms".

Page 32: Moon component - documentation.help · algorithms the book "Calendrical Calculations" by Nachum Dershowitz and Edward M. Reingold. For updates and a listing of bugs (often with patches

TwilightAlgorithms

TopPreviousNext

Calculatesthetimesofthethreetwilightstimes.procedureMorning_Twilight_Civil(date:TDateTime;latitude,

longitude:extended):TDateTime;procedureMorning_Twilight_Nautical(date:TDateTime;latitude,

longitude:extended):TDateTime;procedureMorning_Twilight_Astronomical(date:TDateTime;latitude,

longitude:extended):TDateTime;procedureEvening_Twilight_Civil(date:TDateTime;latitude,

longitude:extended):TDateTime;procedureEvening_Twilight_Nautical(date:TDateTime;latitude,

longitude:extended):TDateTime;procedureEvening_Twilight_Astronomical(date:TDateTime;latitude,

longitude:extended):TDateTime;DescriptionCalculatesthetimeofthebeginningofthemorningtwilight(whichendsatsunrise)ortheendoftheeveningtwilight(whichbeginsatsunset).IfthesundoesnotreachtheelevationneededforoneofthesecalculationsforthewholedaytheexceptionE_NoRiseSetisraised.Civiltwilightisdefinedasthetimewhenthesunreachesanelevationof6degreesunderthehorizon.Whenthesunlsdeeperthanthisitissodarkthatartificallightwouldbeneeded.Nauticaltwilightisdefinedasthetimewhenthesunreachesanelevationof12degreesunderthehorizon.Whenthesunisdeeperthanthisitisdarkenoughtohaveallthebrightstarsneededfornautical

Page 33: Moon component - documentation.help · algorithms the book "Calendrical Calculations" by Nachum Dershowitz and Edward M. Reingold. For updates and a listing of bugs (often with patches

triangulationsclearlyvisible.Astronomicaltwilightisdefinedasthetimewhenthesunreachesanelevationof18degreesunderthehorizon.Whenthesunisdeeperthanthisitisdarkenoughtohaveallstarsvisible,andthesunisnotdisturbingastronomicalobservationsatallanymore.Theobserver'slatitudeisnegativeforthesouthernhemisphereandpositiveforthenorthernhemisphere;thelongitudeispositiveforpointswestofGreenwich,negativeforpointseast,andbotharegivenindegrees.ReferenceThesefunctionarebaseduponchapter15(14)of"AstronomicalAlgorithms".

Page 34: Moon component - documentation.help · algorithms the book "Calendrical Calculations" by Nachum Dershowitz and Edward M. Reingold. For updates and a listing of bugs (often with patches

ChineseDateAlgorithms

TopPreviousNext

ConvertsaDelphiTDatetimetothechinesedateandback.functionChineseDate(date:TDateTime):TChineseDate;functionEncodeDateChinese(date:TChineseDate):TDateTime;DescriptionTheChinesecalendarisalunisolarcalendarliketheJewishcalendar,howeverthemaindifferenceisthattheChinesecalendarusestheastronomicalevents,andnotanapproximatealgorithm.AnotherdifferenceisthattheChinesecalendarusestheactualnewmoon,notthevisibilityofthefirstcrescentastheJewishormuslimcalendar.TheChinesedatedoesnothaveacontinuousyearcount,butinsteaditiscountedin60yearlongcycles.Everyyearinthiscyclebelongstooneof10heavenlystemandoneofthe12earthlybranches,whichisthenameofzodiacforthegivenyear.SotheyearinTChineseDateisencodedinthecyclenumberandtheyearnumber,andforinformationitalsohasthestemandthezodiacoftheyear.Thesimilarsexagenarycycleformonthsanddaysisonlyrarelyusedanymore,howeveritisalsocalculated.AstheChinesecalendarislunarsolaritneedstointroduceleapyears,whichcontainaleapmonth.Theleapmonthhasthesamenumberasthepreviousmonth,itonlygetsanadditionalflagtonoticeitisaleapmonth.Inprincipleeverymonthcanbealeapmonth,however,aroundtheperiheliontheyareveryunlikely.Asthemonthstartsonthedayofthenewmoon(thedayinBeijing),thelengthofthemonthscanbeeither29or30days,sometimeswithupto4longor3shortmonthsinarow,butusuallychangingeverymonth.

Page 35: Moon component - documentation.help · algorithms the book "Calendrical Calculations" by Nachum Dershowitz and Edward M. Reingold. For updates and a listing of bugs (often with patches

TheChinesecalendarinitspresentformwasintroducedin1645,butithadexistedinsimilarversionslongtimebeforealready.Asitisbasedupontheastronomicaleventsallthecalculationsherearecorrectaslongasthebasicastronomicalalgorithmsaren'ttoomuchwrong,sousingthiscalculationtoofarintothefuturewillreturnmeaninglessresults.TheEncodeDateChinesefunctionwillraiseanexceptionincaseofaninvaliddategiven-e.g.aleapmonthwhichisnone,ora30thonamonthwhichonlyhas29days.Notethatitonlyusesthefieldscycle,year,month,dayandleapoftherecord,theotherfieldsarenotcheckedfortheconversion.ReferenceThesefunctionsarebasedinpartuponthebookCalendricalCalculations.

Page 36: Moon component - documentation.help · algorithms the book "Calendrical Calculations" by Nachum Dershowitz and Edward M. Reingold. For updates and a listing of bugs (often with patches

CorrectedDelphicalendarfunctionsAlgorithms

TopPreviousNext

CorrectedversionsofsomeDelphicalendarfunctionsfunctionIsLeapYearCorrect(year:word):boolean;functionEncodeDateCorrect(year,month,day:word):TDateTime;procedureDecodeDateCorrect(date:TDateTime;varyear,month,day:word);procedureDecodeTimeCorrect(date:TDateTime;varHour,Min,Sec,mSec:

word);functionFalsifyTDateTime(date:TDateTime):TDateTime;DescriptionBydefinitiontheDelphiTDateTimeshouldbethesameasajuliandate,thatmeansthenumberofdayssinceafixeddate(whichwaschangedtoDecember30th,1899sinceDelphi2).However,alltheinternalfunctionsconnectedwithdates(atleastallversionsuntilDelphi6)useaprolepticgregoriancalendar,thatmeanstheyprojectisgregoriancalendarbacktotimeswhereitwasnotineffectyet.TomakeitevenworsethefractionalpartoftheTDateTimeishandledtotallywrongfornegativedates(i.e.datesbefore1899-12-30,andonlysinceDelphi2),forexample-10.1shouldbe21:36onDecember19th1899,butDelphimakesit2:24onthe20th.SowheneveraIsLeapYear,EncodeDate,DecodedateorDecodetimeisneededusethesecorrectedversionsinstead,unlessyouaresuredatesbefore1900willneveroccur.ForexampletousetheFormatDateTimefunctionthereisalsotheFalsifyTDateTimewhichmodifiesthevaluetogetithandledcorrectlybyDelphi.HintTheswitchingdatebetweenjulianandgregoriancalendaristheoneof

Page 37: Moon component - documentation.help · algorithms the book "Calendrical Calculations" by Nachum Dershowitz and Edward M. Reingold. For updates and a listing of bugs (often with patches

thedecreeofpopeGregor,makingOctober4ththelastdayofthejuliancalendar,followeddirectlybythe15th.However,thecalendarchangewasadoptedatvariouslatertimesthroughoutEurope,forexampleEnglandchanged1752,andRussiain1918,sothesecorrectedfunctionsmightbeequallywrongastheoriginalDelphifunctionsforsomehistoricdatesdependingonlocation.Formoreflexibilitythedirectcalendarfunctionscanbeused.

Page 38: Moon component - documentation.help · algorithms the book "Calendrical Calculations" by Nachum Dershowitz and Edward M. Reingold. For updates and a listing of bugs (often with patches

EasterDateAlgorithms

TopPreviousNext

CalculatestheeasterdatefunctionEasterDate(year:Integer):TDateTime;functionEasterDateJulian(year:Integer):TDateTime;DescriptionCalculatesthedateofEastersundayforanyyearbetween1and2399accordingtothefamouseasterformuladevelopedbyCarlFriedrichGaussforthegregoriancalendar.Infacttheactualalgorithmusedisavariationoftheoriginalformula.Foryearsoutsidetherangefrom1to2399theexceptionE_OutOfAlgorithmRangeisraised.Fortheyearsbeforethecalendarreformof1582thealgorithmfortheEasterdateisdifferentandtheEasterDateJulianfunctionisusedinternallyinstead,andastheorthodoxchristiansusethejuliancalendarforthecalculationsoftheholidaystilltodaythefunctionEasterDateJulianisalsoavailable.EasterisdefinedtobethefirstSundayafterthefirstfullmoonaftertheMarchequinox(startingofspring).However,theactualdatefollowstheformulawhichcanoccasionalydeviatefromthepurelyastronomicalcalculation,astheformulasimplifiestheequinoxbeingalwaysonMarch21st,aswellasthefullmooncalculationissimplified.ReferenceThesefunctionsarebaseduponchapter8of"AstronomicalAlgorithms".

Page 39: Moon component - documentation.help · algorithms the book "Calendrical Calculations" by Nachum Dershowitz and Edward M. Reingold. For updates and a listing of bugs (often with patches

JewishDateAlgorithms

TopPreviousNext

ConvertsaDelphiTDatetimejothejewishdateandback.functionEncodeDateJewish(year,month,day:word):TDateTime;procedureDecodeDateJewish(date:TDateTime;varyear,month,day:word);DescriptionThejewishcalendarisbaseduponalunisolarcalendar,withmonthlengthsof29or30days,andaleapmonthinsertedabouteverythirdyear.Theyearnumberisby3760higherthenthechristianera,thisiscalledthemundiera.ThenewyeariscelebratedonTishri1whichisinSeptemberorOctober.NoticethatTishriisinfactthe7thmonth,sointhejewishcalendarthe1.1.isafterthe1.7.ToconvertthemonthnumbertothemonthnamethearrayJewish_Month_Namecanbeused.Anotherdifferenceisthatinjewishtraditionthedaystartsat6pmonthepreviousevening,aroundthetimeofsunset.Thejewishcalendarwascodifiedin359CE(4119ME),beforethatyearthebeginningsofthemonthswerebaseduponobservingthenewmoon,andthuscannotbecalculatedbackanymore.Soanydatebeforethattimewillcreateanexception.HintBothfunctionsarebaseduponthedateofpesachcalculatedbytheGaussianformulaaccordingtothehintsinMeeus.ReferenceThesefunctionsarebaseduponchapter9(-)of"AstronomicalAlgorithms".

Page 40: Moon component - documentation.help · algorithms the book "Calendrical Calculations" by Nachum Dershowitz and Edward M. Reingold. For updates and a listing of bugs (often with patches

JulianDateAlgorithms

TopPreviousNext

ConvertsaDelphiTDatetimetothejuliandateandback.functionJulian_Date(date:TDateTime):extended;functionDelphi_Date(date:extended):TDateTime;DescriptionThejuliandate(JD)isarepresentationfordatesoftenusedinastronomy.ItisdefinedasbeingthenumberofdayselapsedsincenoonJanuary1st,4712b.c.Ithastheadvantageofbeingmucheasiertouseincalculationsthanday,monthsetc.,infacttheDelphiTDateTimeisnothingbutajuliandatewithadifferentdateusedforthe0(sinceDelphi2itisDecember30th1899).Thereisanotherverysimilardefinitionofthejuliandate,calledthemodifiedjuliandate(MJD).Itisdefinedas MJD=JD-2400000.5HintNotethatDelphiTDateTimeshouldbeajuliandatevariant,howeverisimplementedwithseveralbugs;therearesomecorrectedfunctionsprovidedtoreplacetheDelphiones,orthemoreflexibledirectcalendaralgorithmsNoteStartingwithDelphi6theVCLcontainsthefunctionsJulianDateToDateTimeandDateTimeToJulianDatewhichdoesthesameastheseones.

Page 41: Moon component - documentation.help · algorithms the book "Calendrical Calculations" by Nachum Dershowitz and Edward M. Reingold. For updates and a listing of bugs (often with patches

ReferenceThesefunctionsarebaseduponchapter7of"AstronomicalAlgorithms".

Page 42: Moon component - documentation.help · algorithms the book "Calendrical Calculations" by Nachum Dershowitz and Edward M. Reingold. For updates and a listing of bugs (often with patches

GregorianandjuliancalendarfunctionsAltorithms

TopPreviousNext

ConversionofcalendardatestojuliandateandbackfunctionCalc_Julian_date_julian(year,month,day:word):extended;functionCalc_Julian_date_gregorian(year,month,day:word):extended;functionCalc_Julian_date_switch(year,month,day:word;

switch_date:extended):extended;functionCalc_Julian_date(year,month,day:word):extended;procedureCalc_Calandar_date_julian(juldat:extended;var

year,month,day:word);procedureCalc_Calendar_date_gregorian(juldat:extended;var

year,month,day:word);procedureCalc_Calendar_date_switch(juldat:extended;var

year,month,day:word;switch_date:extended);procedureCalc_Calendar_date(juldat:extended;varyear,month,day:word);DescriptionThesefunctionsareusedtoconvertacalendardatetoajuliandateandback.Theyarebothavailableforthegregoriancalendar,andthejuliancalendarwhichwasusedbefore.Thosefunctionscontainingtheswitchparameterareacombinationofboth,theparameterswitchisthejuliandateofthefirstdayofthegregoriancalendar.Calc_Calencar_dateandCalc_Julian_dateareshortcutswhichusethestandardswitchingday,October15th1582.Thisisalsopredefinedasaconstantcalendar_change_standard.

Page 43: Moon component - documentation.help · algorithms the book "Calendrical Calculations" by Nachum Dershowitz and Edward M. Reingold. For updates and a listing of bugs (often with patches

PesachDateAlgorithms

TopPreviousNext

Calculatesthepesach(passover)datefunctionPesachDate(year:Integer):TDateTime;DescriptionCalculatesthedateofpesach,thejewishholiday.ThedateisdeterminedbythejewishlunisolarcalendarinwhichthepesachisalwaysonthedateNisan15.Formoreinformationseethedescriptionofthejewishcalendarfunctions.ReferenceThisfunctionisbaseduponchapter9of"AstronomicalAlgorithms".

Page 44: Moon component - documentation.help · algorithms the book "Calendrical Calculations" by Nachum Dershowitz and Edward M. Reingold. For updates and a listing of bugs (often with patches

WeekNumberAlgorithms

TopPreviousNext

CalculatesthenumberoftheweekforthegivendatefunctionWeekNumber(date:TDateTime):integer;DescriptionCalculatesthenumberoftheweekforthegivendate.AccordingtotheinternationalstandardISO8601theweekstartswithMonday,andthefirstweekofayearisthatwhichhasthemajorityofdaysinthenewyear,i.e.theonewhichcontainsthefirstThursday.HintThisalgorithmisonlycalculatingtheweeknumberaccordingtotheISOstandard,howevertherearemanyotherlocalstandardsfortheweekcounting-forexampleinmanyculturestheweekisconsideredtobeginonSunday.Sowhenyouneedaweeknumbercalculationmakesurewhichstandardyou'llneed.NoteStartingwithDelphi6theVCLcontainsthefunctionWeekOfwhichdoesthesameasthisone.

Page 45: Moon component - documentation.help · algorithms the book "Calendrical Calculations" by Nachum Dershowitz and Edward M. Reingold. For updates and a listing of bugs (often with patches

TMoonHierarchyProperties

TopPreviousNext

UnitMoonDescriptionAdescendantofTGraphicControlwhichusesthemoonalgorithmstocalculatetheviewofthemoonatagivendateandtime.DependingonthevaluesofDate,MoonSizeandRotationthepictureiscalculatedandpainted;andalsointotheIconproperty(inthesizeusedasthedefaultsizeforthecurrentsystem).ThebackgroundcolorcanbesetbythepropertyColororbetransparent.

Thefullmoonpicturelookslikethis.NotethesmallreddotwhichmarkstheplacewhereApollo11landed-thisisonlyvisibleifthedateissetafterthelandingdateofApollo11,andcanbemadeinvisblewiththepropertyShowApollo11.

Page 46: Moon component - documentation.help · algorithms the book "Calendrical Calculations" by Nachum Dershowitz and Edward M. Reingold. For updates and a listing of bugs (often with patches

TLocation TopPreviousTLocationencapsulatesageographicallocationUnitMooncompDescriptionThisclassisusedtoencapsulateageographicallocationofanobserver.Ithasthusjustsomefewfields:

Longitude:extended;Latitude:extended;Name:string;

Thelatitudeisnegativeforthesouthernhemisphereandpositiveforthenorthernhemisphere;thelongitudeispositiveforpointswestofGreenwich,negativeforpointseast,andallaregivenindegrees.

Page 47: Moon component - documentation.help · algorithms the book "Calendrical Calculations" by Nachum Dershowitz and Edward M. Reingold. For updates and a listing of bugs (often with patches

TMoonNametype TopPreviousNext

UnitMoontypeTMoonName=(mn_wolf,mn_snow,mn_worm,mn_pink,mn_flower,

mn_strawberry,mn_buck,mn_sturgeon,mn_harvest,mn_hunter,mn_beaver,mn_cold,mn_blue);

DescriptionThemoonnamesfollowthetraditionoftheMaineFarmor'sAlmanacwhichtheyadoptedfromnativeAmericans'calendartraditions.Thereareseveraldifferentalternativesetsofnames(someevencontradictory),thelistbelowisthusjustaselection.Themonthlistedinthistableisonlyaroughapproximation,accordingtothealgorithmforthecalculationofthenamesthemoonmightoccurearlierorlater.

Value MaineFarmer'sAlmanac Month Alternativenames

mn_wolf WolfMoon January OldMoon,MoonafterYule,ColdMoon

mn_snow SnowMoon February BonyMoon,StormMoon,HungerMoon

mn_worm WormMoon MarchSapMoon,WindyMoon,LentenMoon,ChasteMoon,MapleSugarMoon

mn_pink PinkMoon,EasterMoon April

EggMoon,GrassMoon,FlowerMoon,SeedMoon,FrogMoon,Planter'sMoon

mn_flower FlowerMoon May MilkMoon,Planting

Page 48: Moon component - documentation.help · algorithms the book "Calendrical Calculations" by Nachum Dershowitz and Edward M. Reingold. For updates and a listing of bugs (often with patches

mn_flower FlowerMoon May MilkMoon,PlantingMoon,HareMoon

mn_strawberry StrawberryMoon JuneRoseMoon,GreenCornMoon,FlowerMoon,DyadMoon

mn_buck BuckMoon JulyThunderMoon,RipeCornMoon,HayMoon,MeadMoon,BloodMoon

mn_sturgeon SturgeonMoon August GreenCornMoon,CornMoon,FruitMoon,GrainMoon,WyrtMoon

mn_harvest HarvestMoon September FruitMoon,NutMoon,BarleyMoon

mn_hunter HunterMoon OctoberMoonafFalligLeaves,HarvestMoon,BloodMoon

mn_beaver BeaverMoon November FrostMoon,TradingMoon,SnowMoon

mn_cold ColdMoon DecemberLongNightMoon,SnowMoon,MoonBeforeYule,OakMoon

mn_blue BlueMoon variable

Page 49: Moon component - documentation.help · algorithms the book "Calendrical Calculations" by Nachum Dershowitz and Edward M. Reingold. For updates and a listing of bugs (often with patches

TMoonPhasetype TopPreviousNext

UnitMoontypeTMoonPhase=(Newmoon,WaxingCrescent,FirstQuarter,

WaxingGibbous,Fullmoon,WaningGibbous,LastQuarter,WaningCrescent);

DescriptionOrdinaltypetocontainthefourmainandfourminorphasesofthemoon.Value MeaningNewMoon Newmoon,whenthemoonistotallydark.

WaxingCrescent Themoonilluminatedby25%,about3daysafterthenewmoon.

FirstQuarter Oneweekafternewmoon(onequarterofthemonth),whenthemoonis50%illuminated.

WaxingGibbous Themoonisilluminatedby75%,about3daysbeforefullmoon.

FullMoon Fullmoon,mooniscompletelyilluminated.

WaningGibbous Themoonisilluminatedby75%,about3daysafterfullmoon.

LastQuarter Oneweekbeforenewmoon,whenthemoonis50%illuminated.

WaningCrescent Themoonisilluminatedby25%,about3daysbeforenewmoon.

Page 50: Moon component - documentation.help · algorithms the book "Calendrical Calculations" by Nachum Dershowitz and Edward M. Reingold. For updates and a listing of bugs (often with patches

TMoonSize TopPreviousNext

UnitMoontypeTMoonSize=(ms64,ms32,ms16);DescriptionSizeofthemoonimage,64x64pixel,32x32pixel(standardiconsize)or16x16(smalliconsize).

Page 51: Moon component - documentation.help · algorithms the book "Calendrical Calculations" by Nachum Dershowitz and Edward M. Reingold. For updates and a listing of bugs (often with patches

TMoonStyle TopPreviousNext

UnitMoontypeTMoonStyle=(msClassic,msColor,msMonochrome);DescriptionThedifferentbitmapstylessupported.Rightnowit'stheoriginalMoontoolbitmap,andamorecolorfulonetakenfromthelatestreleaseoftheWindowsMoontool.Themonochromesettingjustdrawsamonochromedisc.

Page 52: Moon component - documentation.help · algorithms the book "Calendrical Calculations" by Nachum Dershowitz and Edward M. Reingold. For updates and a listing of bugs (often with patches

TRotatetype TopPreviousNext

UnitMoontypeTRotate=(rot_none,rot_90,rot_180,rot_270,rot_angle,rot_location);DescriptionRotationangleinmathematicalstyle(counterclockwise).Thevaluerot_anglemeansfreerotationalangle,rot_locationananglecalculatedfromtheobserver'slocation.

Page 53: Moon component - documentation.help · algorithms the book "Calendrical Calculations" by Nachum Dershowitz and Edward M. Reingold. For updates and a listing of bugs (often with patches

E_NoRiseSetHierachy

TopPreviousNext

E_NoRiseSetistheexceptionclassusedwhennorise,setortwilightcanbecalculated.UnitMoonDescriptionE_NoRiseSetisraisedwhenthecalculationofamoon/sunriseorsetisnotpossiblebecausethemoon(orsun)isbeloworabovethehorizonforthewholeday,ordoesnotreachtheelevationneededforthetwilight.Thishappensespeciallyforthepolarwinter.

Page 54: Moon component - documentation.help · algorithms the book "Calendrical Calculations" by Nachum Dershowitz and Edward M. Reingold. For updates and a listing of bugs (often with patches

E_OutOfAlgorithmRangeHierarchy

TopPreviousNext

E_OutOfAlgorithmRangeistheexceptionclassusedforcallsofalgorithmsoutoftheUnitMoon_auxDescriptionE_OutofAlgorithmRangeisraisedwhen:§ Seasonsbefore1000B.C.orafter3000A.D.§ Easterdatebefore1583orafter2300

Page 55: Moon component - documentation.help · algorithms the book "Calendrical Calculations" by Nachum Dershowitz and Edward M. Reingold. For updates and a listing of bugs (often with patches

TChineseCycletype TopPreviousNext

UnitMoontypeTChineseCycle=recordzodiac:TChineaeZodiac;stem:TChineseStem;end;DescriptionContainstheastrologicaldescriptionofachineseyear(ormonthorday)inthesexagenarycycle.Thezodiacorearthlybranchhasacycleof12,whiletheheavenlystemhaveacycleof10,thuscreating60possiblecombinationsofthetwovalues.

Page 56: Moon component - documentation.help · algorithms the book "Calendrical Calculations" by Nachum Dershowitz and Edward M. Reingold. For updates and a listing of bugs (often with patches

TChineseDatetype TopPreviousNext

UnitMoontypeTChineseDate=recordcycle:integer;year:integer;epoch_years:integer;month:integer;leap:boolean;leapyear:boolean;day:integer;yearcycle:TChineseCycle;daycycle:TChineseCycle;monthcycle:TChineseCycle;end;DescriptionContainsthefieldsnecessarytoenoodeachinesedate.Field Meaning

cycleCountsthesexagenaryyearcyclessincestartingoftheepochat2636BC.

year Thenumberoftheyearinthesexagenarycycle.

epoch_yearsNumberofyearssincestartingoftheepoch-calculatedas(cycle-1)*60+(year-1)

Page 57: Moon component - documentation.help · algorithms the book "Calendrical Calculations" by Nachum Dershowitz and Edward M. Reingold. For updates and a listing of bugs (often with patches

month Themonthnumberleap Isthemonthaleapmonth

leapyear Thecurrentyearcontainsaleapmonth

day Thedaynumber

yearcycle Theastrologicalyearnumbering

monthcycle Theastrologicalmonthnumbering

daycycle Theastrologicaldaynumbering

Page 58: Moon component - documentation.help · algorithms the book "Calendrical Calculations" by Nachum Dershowitz and Edward M. Reingold. For updates and a listing of bugs (often with patches

TChineseStemtype TopPreviousNext

UnitMoontypeTChineseStem=(ch_jia,ch_yi,ch_bing,ch_ding,ch_wu,ch_ji,ch_geng,

ch_xin,ch_ren,ch_gui);DescriptionThevaluesforthe10heavenlystems( -tiangan)fortheastrologicalcyclesoftheChinesecalendar.ThenameofthetypesrepresentstheChinesenameofthestem-therearenotranslationsfortheseitems.Twoofthestemscorrespondtooneoftheelements,oneinyenandoneinyang.Chinese Unicode Element Association

jia 7532 Wood(+) Growingwood

yi 4E59 Wood(-) Cuttimberbing 4E19 Fire(+) Naturalfireding 4E01 Fire(-) Artificialfire

wu 620A Earth(+) Earth

ji 5DF1 Earth(-) Earthenware

geng 5E9A Metal(+) Metal

xin 8F9B Metal(-) Wroughtmetal

ren 58EC Water(+) Runningwater

Page 59: Moon component - documentation.help · algorithms the book "Calendrical Calculations" by Nachum Dershowitz and Edward M. Reingold. For updates and a listing of bugs (often with patches

gui 7678 Water(-) Standingwater

Page 60: Moon component - documentation.help · algorithms the book "Calendrical Calculations" by Nachum Dershowitz and Edward M. Reingold. For updates and a listing of bugs (often with patches

TChineseZodiactype TopPreviousNext

UnitMoontypeTChineseZodiac=(ch_rat,ch_ox,ch_tiger,ch_rabbit,ch_dragon,

ch_snake,ch_horse,ch_goat,ch_monkey,ch_chicken,ch_dog,ch_pig);

DescriptionThevaluesforthe12earthlybranches( -dìzhi)fortheastrologicalcyclesoftheChinesecalendar.ThenamesaretheEnglishnamesofthecorrespondioganimalsofthezodiac.English Chinese UnicodeRat zi 5B50Ox chou 4E11Tiger yín 5BC5Rabbit mao 536FDragon chén 8FB0Snake sì 5DF3Horse wu 5348Goat wèi 672AMonkey shen 7533Chicken you 9149Dog xu 620CPig hài 4EA5

Page 61: Moon component - documentation.help · algorithms the book "Calendrical Calculations" by Nachum Dershowitz and Edward M. Reingold. For updates and a listing of bugs (often with patches

TEclipsetype TopPreviousNext

UnitMoontypeTEclipse=(none,partial,noncentral,circular,circulartotal,total,

halfshadow);DescriptionDifferentkindsofsolarandlunareclipsespossibleValue Meaningnone Noeclipseatall.

partialPartialeclipse,justasegmentofthesunisobscured.Thishappenswhenthecenterofthemoondiscandthesundiscdonotmeet

noncentralAtotaleclipse,butwithoutthecentersoftheshadowregionhittingearth,soonlythepolarregionsgetintothetotalareaoftheshadow.

circularBecauseofadifferentsizeofthediscsthereremainsanilluminatedringaroundtheshadowedpartofthesun.Alsocalledannulareclipse.

circulartotal Aneclipsewhichistotalonpartofthegroundtrack,andcircularonanotherpart.

total Atotaleclipse.

halfshadowForlunareclipsesonly.Themoonisnothitbythefullshadow,butbecauseofthedistancefromearthbeingtoolargeonlyhitbythepenumbra(halfshadow).

Page 62: Moon component - documentation.help · algorithms the book "Calendrical Calculations" by Nachum Dershowitz and Edward M. Reingold. For updates and a listing of bugs (often with patches

TSeasontype TopPreviousNext

UnitMoontypeTSeason=(Winter,Spring,Summer,Autumn);DescriptionOriginaltypetocontainthefourseasons.Value Meaning

WinterThetimebetweentheDecembersolstitial(thesunbeingonthesouthernmostpoint)andtheMarchequinox(thesuncrossingtheequator).

Spring ThetimebetweentheMarchequinoxandtheJunesolstitial(thesunbeingatthenorthernmostpoint).

Summer ThetimebetweentheJunesolstitialandtheSeptemberequinox.

Autumn ThetimebetweenSeptemberequinoxandDecembersolstitial(inAmericanEnglishcalled"fall")

Page 63: Moon component - documentation.help · algorithms the book "Calendrical Calculations" by Nachum Dershowitz and Edward M. Reingold. For updates and a listing of bugs (often with patches

AstronomicalAlgorithmsbyJeauMeeus2ndedition(December1998)Willmann-Bell;ISBN:0943396611Orderdirectlyfromamazon.comGermanedition:AstronomischeAlgorithmenvonJeanMeeusJ.A.Barth,Leipzig;ISBN:3335004000currentlyoutofprintOrderdirectlyfromamazon.deChapternumbersareforthesecondedition,ifthechapternumberinfirsteditionisdifferentitisgiveninbrackets.

Page 64: Moon component - documentation.help · algorithms the book "Calendrical Calculations" by Nachum Dershowitz and Edward M. Reingold. For updates and a listing of bugs (often with patches

MarkingTimebyDuncanSteel1stedition(December8,2000)JohnWiley&Sons;ISBN:0471404217Orderdirectlyfromamazon.com

Page 65: Moon component - documentation.help · algorithms the book "Calendrical Calculations" by Nachum Dershowitz and Edward M. Reingold. For updates and a listing of bugs (often with patches

CalendricalCalculationsbyNachumDershowitzandEdwardM.Reingold2ndrevisededition(September2001)CambridgeUniversityPress;ISBN:0521777526Orderdirectlyfromamazon.comOnlinevension

Page 66: Moon component - documentation.help · algorithms the book "Calendrical Calculations" by Nachum Dershowitz and Edward M. Reingold. For updates and a listing of bugs (often with patches

AstronomyonthePersonalComputerbyOliverMontenbruckandThomasPfleger4threv.edition(May2000)Springer;ISBN:3540672214Orderdirectlyfromamazon.comGermanedition:AstronomiemitdemPersonalComputervonOliverMontenbruckundThomasPfleger3.Auflage(1999)Springer,Berlin;ISBN:3540662189Orderdirectlyfromamazon.de

Page 67: Moon component - documentation.help · algorithms the book "Calendrical Calculations" by Nachum Dershowitz and Edward M. Reingold. For updates and a listing of bugs (often with patches

AstronomicalAlgorithmsContents

TopPreviousNext

UnitMoon,Moon_auxDescriptionAcollectionofastronomicalandcalendricalalgorithmsmainlybasedfromthebook"AstronomicalAlgorithms"byJeanMeeus.CalendarJuliandateJulian/GregoriancalendarconversionsJewishCalendarChineseCalendarEasterDatePesachDateStartofseasonsSolarTermsCorrectedDelphidatetimefunctionsMoonspecificMoondistanceAgeofthemoonNextPhaseLastPhaseCurrentPhaseNearestPhaseMoonNamesandBlueMoonLunationMoondiameterMooncoordinatesMoonzodiacsignMoonrise,setandtransitPerigeeApogeeLibration,CoLonghtudeandCoLatitude

Page 68: Moon component - documentation.help · algorithms the book "Calendrical Calculations" by Nachum Dershowitz and Edward M. Reingold. For updates and a listing of bugs (often with patches

PositionangleofaxisAngleofthebrightlimbPassagesthroughthenodesEclipseSunspecificSundistance.SundiameterSuncoordinatesSunzodiacsignSunrise,-setandtransitTwilightPerihelAphelEclipseMiscastronomicalalgorithmsStartimeCoordinatetransformationsEquinoxconversionsDynamicTimeDifferenceDistanceontheglobe

Page 69: Moon component - documentation.help · algorithms the book "Calendrical Calculations" by Nachum Dershowitz and Edward M. Reingold. For updates and a listing of bugs (often with patches

TMoonPropertiesTMoon

TopPreviousNext

InTMoon Bitmap Color Date Icon Location MoonColor MoonSize MoonStyle Rotation RotationAngle ShowApollo11 Transparent

Page 70: Moon component - documentation.help · algorithms the book "Calendrical Calculations" by Nachum Dershowitz and Edward M. Reingold. For updates and a listing of bugs (often with patches

Aphelionisthemaximumdistanceoftheearthfromthesun.

Page 71: Moon component - documentation.help · algorithms the book "Calendrical Calculations" by Nachum Dershowitz and Edward M. Reingold. For updates and a listing of bugs (often with patches

Apogpeisthemaximumdistanceofthemoonfromtheearth.

Page 72: Moon component - documentation.help · algorithms the book "Calendrical Calculations" by Nachum Dershowitz and Edward M. Reingold. For updates and a listing of bugs (often with patches

ThelunationisacountofthenewmoonssinceJanuary1st,1923

Page 73: Moon component - documentation.help · algorithms the book "Calendrical Calculations" by Nachum Dershowitz and Edward M. Reingold. For updates and a listing of bugs (often with patches

CoordinatetransformationAlgorithms

TopPreviousNext

Convertsbetweenecliptic,equatorialandhorizontalcoordinates.Unitmoon_auxprocedureEclipticToEquatorial(date:TDateTmme;latitude,longitude:

extended;varrektaszension,declination:extended);procedureEquatorialToEcliptic(date:TDateTime;rektaszension,declination:

extended;varlatitude,longitude:extended);procedureEquatorialToHorizontal(date:TDateTime;

rektaszension,declination:extended;observer_latitude,observer_longitude:extended;varelevation,azimuth:extended);

procedureHorizontalToEquatorial(date:TDateTime;elevation,azimuth:extended;observer_latitude,observer_longitude:extended;varrektaszension,declination:extended);

procedureEcliaticToHorizontal(date:TDateTime;latitude,longitude:extended;observer_latitude,observer_longitude:extended;varelevation,azimuth:extended);

procedureHorizontalToEcliptic(date:TDateTime;elevation,azimuth:extended;observer_latitude,observer_longitule:extended;varlatitude,longitude:extended);

DescriptionConvertscoordinatebetweenthethreemostcommonlyusedcelestialcoordinateframes-ecliptic,equatorialandhorizontalcoordinates.Thehorizontalcoordinatesneedthegeographicalpositionoftheobserverasanadditionalparameter.Theobserver'slatitudeisnegativeforthesouthernhemisphereandpositiveforthenorthernhemisphere;thelongitudeispositiveforpointswestofGreenwich,negativeforpointseast,andbothgivenindegrees.Negativeelevationmeansthattheobjectisnotvisiblebecauseitisunderneaththehorizon,whereas90degreesmeansthezenith;the

Page 74: Moon component - documentation.help · algorithms the book "Calendrical Calculations" by Nachum Dershowitz and Edward M. Reingold. For updates and a listing of bugs (often with patches

azimuthisdefinedas0degreesforsouthdirection,90degreesforwestandsoon.Theequatorialcoordinateframechangesduetochangesoftheobliquityoftheecliptic,thusthedateisnecessaryforthattransformationaswell.Thevaluesreturnedaretheapparentcoordinaoes,notthemeancoordinateswhichdisregardtheeffestsofthenutation.Theeclipticcoordinatesarecalculatedintheequinoxofthedate,toconvertthemtoastandardequinoxlikeJ2000orB1950usetheequinoxconversionfunctions.HintThedefinitionoftheazimuthusedhereistheastronomicalone;innavigatronormeteorologyitisusuallymeasuredstartinginthenorth.Bothdefinitionscanbeconvertedquiteeasily

azimuth:=Put_in_360(azimuth+360);Bothdefinitionsofthesignforthelongitudeareinuseaswell,theoneusedhereisthetraditionaldefinitionusedinastronomy-hnwevertheIAUchangeditfortheEarthin1982tomakeitcompatiblewiththenavigationalstandard,whileforallotherplanetsstillpositivecoordinatesforwesternlongitudeasused.Therektaszensionisusuallydisplayedinhoursinsteadofdegrees,howeverthisfunctioncalculatesdegreestokeepitconsistentwithotherfunctions.Toconvertdegreestohcursjustdivideby15.ReferenceThesefunctionsarebaseduponchapter13(12)of"AstronomicalAlgorithms".

Page 75: Moon component - documentation.help · algorithms the book "Calendrical Calculations" by Nachum Dershowitz and Edward M. Reingold. For updates and a listing of bugs (often with patches

Thetransittimeisthetimeofthehighestelevationduringtheday.

Page 76: Moon component - documentation.help · algorithms the book "Calendrical Calculations" by Nachum Dershowitz and Edward M. Reingold. For updates and a listing of bugs (often with patches

MoonNameAlgorithms

TopPreviousNext

CalculatesthenameofthefullmoonaccordingtotheMainealgorithm.functionMoonName(lunation:integer):TMoonName;DescriptionInthenativeAmericancultureseveryfullmoonshadaspecialnamedependingontheseason,atraditionadoptedbytheMaineFarmer'sAlmanac.ThealgorithmofthatalmanacwasrediscoveredbySky&Telescopewhileresearchingthebluemoontradition.Accordingtothisalgorithmthemoonswerenamedaccordingtotheirpositiontotheequinoxesandsolstices,everyseasonhasthreeregularmoons.Howeveras12lunarmonthsareshorterthenayearabouteverythirdyearhasaseasonwith4fullmoons.Inthiscasethethirdmooniscalledabluemoon,thefourthonegetsthenamethethirdonewouldhavegotten.TheMainealgorithmhastwospecialities-itcalculatestheequinoxesandsolsticeswiththedynamicmeansuninsteadoftherealsun;andthespringequinoxisfixedtobeontheecclesiasticalequinoxofMarch20thtomakesurethePink(orEaster)MoonhappensjustbeforeEaster.HintInadditionaltothosenamescoveredbytheTMoonNametypetherearetwootherfixednamesforspeciallunarevents.Ablackmoonisusuallyusedtodenoteasecondnewmooninacalendarmonth;ablindmoonacalendarmonthwithoutanyfullmoon.Bothareakindofoppositetothecalendarbluemoon.

Page 77: Moon component - documentation.help · algorithms the book "Calendrical Calculations" by Nachum Dershowitz and Edward M. Reingold. For updates and a listing of bugs (often with patches

Perigeeistheminimaldistanceofthemoonfromtheearth.

Page 78: Moon component - documentation.help · algorithms the book "Calendrical Calculations" by Nachum Dershowitz and Edward M. Reingold. For updates and a listing of bugs (often with patches

Perihelionistheminimaldistanceoftheearthfromthesun.

Page 79: Moon component - documentation.help · algorithms the book "Calendrical Calculations" by Nachum Dershowitz and Edward M. Reingold. For updates and a listing of bugs (often with patches

SolarTermsAlgorithms

TopPreviousNext

CalculatesthestartingdatesofthesolartermsfunctionCalcSolarTerm(year:Integer;term:TSolarTerm):TDateTime;DescriptionCalculatesthedatesofthesolarterms,whichareusedintheChinesecalendarforkeepingthelunarcalendarinsyncwiththesolarmovement.Themajorsolartermsaredefinedasthedateswhenthepositionofthesunhasalongitudedivisibleby30°(thebeginningoftheseasonsareamongthese),theminoronesdefinedasthosewhenitisdivisibleonlyby15°.

Page 80: Moon component - documentation.help · algorithms the book "Calendrical Calculations" by Nachum Dershowitz and Edward M. Reingold. For updates and a listing of bugs (often with patches

Thestartime(siderialtime)istheangularpositionofthespringpointatthespecifictime,anditisusedtocalculatethehorizontalcoordinatesofstars.

Page 81: Moon component - documentation.help · algorithms the book "Calendrical Calculations" by Nachum Dershowitz and Edward M. Reingold. For updates and a listing of bugs (often with patches

EquationOfTtmeAlgorithms

TopPreviousNext

CalculatestheequationoftimeinsecondsatthegivendatefunctionEquationOfTime(date:TDateTime):extended;DescriptionCalculatesthedifferencebetweenthemeansolarnoonandtheapparentsolarnoonforthegivendate.Mainlyduetotheeccentricityoftheearth'sorbitaroundthesunthetimebetweentworealnoonsisnotconstant,butchangeswiththedate-theextremevaluesareupto16minutesdifferencebetweenthemeanandtheapparentvalue.Thisfunctionreturnsthevalueinseconds,andcanhavebothpositiveandnegativesign.Anegativesignmeansthatrealnoonisbefore12o'clock,positivesignit'safter12o'clock.ReferenceThisfunctionisbaseduponchapter28(27)of"AstronomicalAlgorithms".

Page 82: Moon component - documentation.help · algorithms the book "Calendrical Calculations" by Nachum Dershowitz and Edward M. Reingold. For updates and a listing of bugs (often with patches

TMoon.Moonstyle

TMoon

Selectsthebitmapstyletobeused.

propertyMoonstyle:TMoonstyle;

Description

Selectsthebitmapstyletobeusedforbothforthepictureandiconproperty.ThevaluemsMonoChromeusestheMoonColorvalueforaplaincolordisplay,andthefollowingtwobitmaptypesaresupported:

msClassicmsColor

Page 83: Moon component - documentation.help · algorithms the book "Calendrical Calculations" by Nachum Dershowitz and Edward M. Reingold. For updates and a listing of bugs (often with patches

TMoon.IconTMoon

TopPreviousNext

MoonimageasiconpropertyIcon:TIcon;DescriptionThemoonimageasaTIcontype.Thesizeoftheiconcalculateddependsonthecurrentsystemmetrics-currentlyonlythosesizescoveredbyTMoonSizecanbeused.Thisproperty,ofcourse,isread-only.

Page 84: Moon component - documentation.help · algorithms the book "Calendrical Calculations" by Nachum Dershowitz and Edward M. Reingold. For updates and a listing of bugs (often with patches

Thejuliandate(JD)isarepresentationfordatesoftenusedinastronomy.ItusdefinedisbeingthenumberofdayselapsedsincenoonJanuary1st,4712b.c.

Page 85: Moon component - documentation.help · algorithms the book "Calendrical Calculations" by Nachum Dershowitz and Edward M. Reingold. For updates and a listing of bugs (often with patches

HierarchyTObject|TPersistent|TComponent|TControl|TGraphicControl|TMoon

Page 86: Moon component - documentation.help · algorithms the book "Calendrical Calculations" by Nachum Dershowitz and Edward M. Reingold. For updates and a listing of bugs (often with patches

TMoon.DateTMoon

TopPreviousNext

ThedateandtimeusedforthecalculationofthemoonimagepropertyDate:TDateTime;DescriptionThedatewhichisusedforthecalculationofthemoonimage.

Page 87: Moon component - documentation.help · algorithms the book "Calendrical Calculations" by Nachum Dershowitz and Edward M. Reingold. For updates and a listing of bugs (often with patches

TMoon.MoonSize

TMoon

Sizeofthemoonimage

propertyMoonSize:TMoonSize;

Description

Sizeofthemoonimage,canbe16pixel,32pixelor64pixel.

Size Imagems16ms32

ms64

Page 88: Moon component - documentation.help · algorithms the book "Calendrical Calculations" by Nachum Dershowitz and Edward M. Reingold. For updates and a listing of bugs (often with patches

TMoon.RotationTMoon

TopPreviousNext

Rotatetheimageofthemoon.propertyRotation:TRotate;DescriptionRotatetheimageofthemoonoptionallyby90,180or270degrees(counterclockwise).Especiallytherotationby180degreesisneededforlocationsonthesouthernhemisphere,asthemoonisseenrotatedfromthere.Forlocationsneartheequatortherotationsof90or270degreescanbeuseful,however,theoptimumvaluefortherotationchangeswiththehorizontalpositionofthemoon.Thusthevaluerot_locationcalculatestheanglefittingthecurrentobserver'slocationandtime,ascalculatedwiththebrightlimbangle.ForanyotherfixedangleassetwithRotationAnglerot_anglecanbeused.Thefirstfourvaluesareretainedforcompatibility,astherot_anglevaluecanbeusedtogettheseanglesbysettingtheRotationAnglepropertyappropriatelyaswell.

Page 89: Moon component - documentation.help · algorithms the book "Calendrical Calculations" by Nachum Dershowitz and Edward M. Reingold. For updates and a listing of bugs (often with patches

TMoon.ShowApollo11TMoon

TopPreviousNext

TogglethepaintingoftheApollo11markerpropertyShowApollo11:boolean;DescriptionTogglesthepaintingoftheApollo11landingsiteasareddot.ThisdotisonlypaintedwhenthedateissettoadateafterJuly20th1969,andShowApollo11issettotrue.

Page 90: Moon component - documentation.help · algorithms the book "Calendrical Calculations" by Nachum Dershowitz and Edward M. Reingold. For updates and a listing of bugs (often with patches

MoonPhaseAngleAlgorithms

TopPreviousNext

CalculatesthemoonphaseanglefunctionMoon_Phase_Angle(date:TDateTime):extended;DescriptionCalculatesthephaseangleofthemoon,thepositionofthebrightlimbonthemoonhemisphere.HintThisfunctionreturnsanegativevalueforthesecondhalfofthemonth,everythingafterthefullmoon.Normallythephaseangleisdefinedtobealwaysposition,soithavethisvalueinthisdefinitionjustusePhaseAngle:=Abs(Moon_Phase_Angle(date));ReferenceThisfunctionisbaseduponchapter48(46)of"AstronomicalAlgorithms".

Page 91: Moon component - documentation.help · algorithms the book "Calendrical Calculations" by Nachum Dershowitz and Edward M. Reingold. For updates and a listing of bugs (often with patches

TZodiac TopPreviousNext

UnitMoontypeTZodiac=(z_aries,z_taurus,z_gemini,z_cancer,z_leo,z_virgo,z_libra,

z_scorpio,z_sagittarius,z_capricorn,z_aquarius,z_pisces);DescriptionThevaluesforthe12zodiacsignsintheirlatinnames.

Latinname Sign Englishname Dates

Aries ^ Ram Mar21-Apr19Taurus _ Bull Apr20-May20Gemini ` Twins May21-Jun20Cancer a Crab Jun21-July22Leo b Lion July23-Aug22Virgo c Virgin Aug23-Sep22Libra d Scales Sep23-Oct22Scorpio e Scorpion Oct23-Nov21Sagittarius f Archer Nov22-Dec21Capricorn g Sea-Goat Dec22-Jan19

Aquarius h Water-Bearer Jan20-Feb18

Pisces i Fish Feb19-Mar20Hint

Page 92: Moon component - documentation.help · algorithms the book "Calendrical Calculations" by Nachum Dershowitz and Edward M. Reingold. For updates and a listing of bugs (often with patches

Theexactstartingtimesofthezodiacsignsthesameasthemajorsolarterms.

Page 93: Moon component - documentation.help · algorithms the book "Calendrical Calculations" by Nachum Dershowitz and Edward M. Reingold. For updates and a listing of bugs (often with patches

HierarchyTObject|Exception|E_NoRiseSet

Page 94: Moon component - documentation.help · algorithms the book "Calendrical Calculations" by Nachum Dershowitz and Edward M. Reingold. For updates and a listing of bugs (often with patches

HierarchyTObject|Exception|E_OutOfAlgorithmRange

Page 95: Moon component - documentation.help · algorithms the book "Calendrical Calculations" by Nachum Dershowitz and Edward M. Reingold. For updates and a listing of bugs (often with patches

MoonZodiacAlgorithms

TopPreviousNext

Calculatestheastrologicalzodiacofthemoon.functionMoonZodiac(date:TDateTime):TZodiac;DescriptionCalculatesthezodiacsignwherethemoonislocatedatthedate.This,however,doesnotmeanthatthemoonisintheastronomicalareaofthatstarsign,itisjusttheeclipticlongitudemeasuredfromthevernalequinoxpartitionedinareasof15°.Duetotheprecessiontheequinoxismoving,itisnowattheboundaryofAquariusandPisces,butthezodiacassociatedwithitisstillArieswheretheequinoxwasattimeoftheBabylonian.

Page 96: Moon component - documentation.help · algorithms the book "Calendrical Calculations" by Nachum Dershowitz and Edward M. Reingold. For updates and a listing of bugs (often with patches

LibrationAlgorithms

TopPreviousNext

CalculatestheephemeridesforphysicalobservationofthemoonprocedureOpticalLibration(date:TDateTime;var

latitude,longitude:extended);procedurePhysicalLibration(date:TDateTime;var

latitude,longitude:extended);DescriptionThemoonalwaysshowsthesamesidetotheearth,however,theexcentricityofthemoon'sorbitandtheinclinationofthemoonequatortotheeclipticcausetheactuallyvisiblepartofthemoonsurfacetobeinfact59%insteadofjust50%,aneffectcalledlibration.Thiscanbeputintonumbersbytheselenographiccoordinatesatwhichtheearthisinzenith,theso-calledCoLongitudeandCoLatitude.Themaineffectofthelibrationisbecauseoftheorbit,andiscalledtheOpticalLibration.Theactualrotationofthemoonchangesslightlyfromthemeanrotation,thisalsoaffectsthelibration,however,itismuchsmallerthantheopticallibrationandalwayssmallerthan0.04°.ThePhysicalLibration,thus,istheadditionofbotheffects.ReferenceThesefunctionsarebaseduponchapter53(51)of"AstronomicalAlgorithms".

Page 97: Moon component - documentation.help · algorithms the book "Calendrical Calculations" by Nachum Dershowitz and Edward M. Reingold. For updates and a listing of bugs (often with patches

PositionangleofaxisAlgorithms

TopPreviousNext

CalculatesthepositionangleofthemoonrotationalaxisfunctionMoonPositionAngleAxis(date:TDateTime):extended;DescriptionThepositionangleoftherotationaxisismeasuredtothenorthdirection,andbecausethemoonequatorhasonlyaninclinationofabout1°totheeclipticthisvaluechangesbetweenabout±23.5°.Theeffectsofthelibrationareincludedinthiscalculation.ReferenceThisfunctionisbaseduponchapter53(51)of"AstronomicalAlgorithms".

Page 98: Moon component - documentation.help · algorithms the book "Calendrical Calculations" by Nachum Dershowitz and Edward M. Reingold. For updates and a listing of bugs (often with patches

BrightLimbAngleAlgorithms

TopPreviousNext

Calculatesthepositionalangleofthemoon'sbrightlimbfunctionMoonBrightLimbPositionAngle(date:TDateTime):extended;functionMoonBrightLimbPositionAngleZenith(date:TDateTime;latitude,

longitude:extended):extended;Description

Thebrightlimbofthemoonchangesitsorientation,eithermeasuredtowardsthenorthdirectionortowardsthezenithatagivengeographicposition,asshownintheillustration.Thezenithangledescribestheapparentrotationofthemoon;anditisnotdefinedforthemoonbeingexactlyinzenith(ornadir).ReferenceThesefunctionsarebaseduponchapter48(46)of"AstronomicalAlgorithms".

Page 99: Moon component - documentation.help · algorithms the book "Calendrical Calculations" by Nachum Dershowitz and Edward M. Reingold. For updates and a listing of bugs (often with patches

NextMoonNodeAlgorithms

TopPreviousNext

CalculatesthedateofthenextpassingofthemoonthroughthenodesfunctionNextMoonNode(date:TDateTime;rising:boolean):TDateTime;DescriptionCalculatesthedateofthenextascendingordescendingpassingofthemoonthroughthenodes,whichiswhenthegeocentriclatitudeofthemoonis0.ReferenceThisfunctionisbaseduponchapter51(49)of"AstronomicalAlgorithms".

Page 100: Moon component - documentation.help · algorithms the book "Calendrical Calculations" by Nachum Dershowitz and Edward M. Reingold. For updates and a listing of bugs (often with patches

SunZodiacAlgorithms

TopPreviousNext

Calculatesthezodiacsignofthesun.procedureSunZodiac(date:TDateTime):TZodiac;DescriptionCalculatesthezodiacsignwherethesunislocatedatthedate.Thishoweverdoesnotmeanthatthesunisintheastronomicalareaofthatstarsign,itisjusttheeclipticlongitudemeasuredfromthevernalequinoxpartitionedinareasof30°.Duetotheprecessiontheequinoxismoving,itisnowattheboundaryofAquariusandPisces,butthezodiacassociatedwithitisstillArieswheretheequinoxwasattimeoftheBabylonian.HintThebeginningofthezodiacsarecalculatedbythemajorsolarterms.

Page 101: Moon component - documentation.help · algorithms the book "Calendrical Calculations" by Nachum Dershowitz and Edward M. Reingold. For updates and a listing of bugs (often with patches

EquinoxconversionAlgorithms

TopPreviousNext

Convertseclipticcoordinatesforthemovingequinox.Unitmoon_auxprocedureConvertEquinox(source_date,target_date:TDateTime;var

rektaszension,declination:extended);procedureConvertEquinoxB1950toJ2000(varrektaszension,declination:

extended);procedureConvertEquinoxDateToJ2000(date:TDateTime;varrektaszension,

declination:extended);procedureConvertEquinoxJ2000toDate(date:TDateTime;varrektaszension,

declination:extended);DescriptionDuetotheprecessionoftheearthrotationalaxistheequinoxmovesalongtheeclipticbyabout50"peryear.Thuseclipticcoordinatesneedthereferencedatefortheirfulldefinition,eithertheyarecalculatedwiththeequinoxofthedate,orwithoneofthestandardframesJ2000orB1950.ReferenceThesefunctionsarebaseduponchapter21(20)of"AstronomicalAlgorithms".

Page 102: Moon component - documentation.help · algorithms the book "Calendrical Calculations" by Nachum Dershowitz and Edward M. Reingold. For updates and a listing of bugs (often with patches

DynamicTimeDifferenceAlgorithms

TopPreviousNext

CalculatesthedifferencebetweenUTCanddynamictimefunotionDynamicTimeDifference(date:TDateTime):extended;DescriptionCalculatesthedifferencebetweenUTCanddynamictimeinseconds.UTCisdefinedbytherotationoftheearthwhichischangingmainlyduetotidaleffects.TomakesuretheUTCstaysinsyncwiththeactualtimeleapsecondsareinsertedoccasionally.However,theastronomioalcalculationsneedacontinuoustimeframe,thedynamictime.Thisfunctionreturnstheoffsetforanytime(in2001itis64seconds)-since1972thenumberofleapseconds,from1961to1972theoffsetwascalculatedwitha(changing)formula.Before1961thedifferenceisinterpolatedfromoldastronomicalobservationslikesolareclipses,andforfuturetimesanextrapolationisused.Duetothefactthatthechangesoftheearth'srotationareunpredictablethisextrapolationcanturnoutwrongaswell,soitneedstobehandledwithcare.WhattimeframetheTDateTimeisusingisnotdefined,mostlyitwillbeusedasUTC,butasitisafloatinternallyitcannothandleleapseconds,thusitwouldbebettertouseitasdynamictime.Soitdependsontheactualusageifthisfunctionsneedstobecalledforthecalculationofanastronomicaltimeornot.Noticethatthisconversionisn'tneededforthesunriseandsettimes-duetothedefinitionoftheUTCtheeffectsofthetimeframechangeandtheslowingoftheearthrotationcancelout.ReferenceThisfunctionisbaseduponchapter10(9)of"AstronomicalAlgorithms".

Page 103: Moon component - documentation.help · algorithms the book "Calendrical Calculations" by Nachum Dershowitz and Edward M. Reingold. For updates and a listing of bugs (often with patches

DistanceOnEarthAlgorithms

TopPreviousNext

CalculatesthedistancebetweentwopointsontheearthfunctionDistanceOnEarth(latitude1,longitude1,latitude2,

longitude2:extended):extended;DescriptionCalculatesthedistancebetweentwogeographicalcoordinatesontheearthglobe,includingtheeffectoftheflatnessoftheearth.Thevalueisgiveninkilometers.Thelatitudeisnegativeforthesouthernhemisphereandpositiveforthenorthernhemisphere;thelongitudeispositiveforpointswestofGreenwich,negativeforpointseast,andallgivenindegrees.ReferenceThisfunctionisbaseduponchapter11(10)of"AstronomicalAlgorithms".

Page 104: Moon component - documentation.help · algorithms the book "Calendrical Calculations" by Nachum Dershowitz and Edward M. Reingold. For updates and a listing of bugs (often with patches

TMoon.BitmapTMoon

TopPreviousNext

MoonimageasbitmappropertyBitmap:TBitmap;DescriptionThemoonimageasaTBitmaptype-thesamebitmapthatispaintedbythecomponent.

Page 105: Moon component - documentation.help · algorithms the book "Calendrical Calculations" by Nachum Dershowitz and Edward M. Reingold. For updates and a listing of bugs (often with patches

TMoon.ColorTMoon

TopPreviousNext

ThebackgroundcolorofthemoonbitmappropertyColor:TColor;DescriptionThebackgrouudcolorusedtopainttheareaaroundthemoondisc.OnlyusedwhentheTransparentpropertyissettofalse.

Page 106: Moon component - documentation.help · algorithms the book "Calendrical Calculations" by Nachum Dershowitz and Edward M. Reingold. For updates and a listing of bugs (often with patches

TMoon.LocationTMoon

TopPreviousNext

TheobserverlocationusedfordisplayingthemoonpicturepropertyLocation:TLocation;DescriptionTheobserverlocationusedforcalculatingtheapparentrotationofthemoonpicture.ThisvalueisonlyusedincasetheRotationpropertyissettorot_rotation.

Page 107: Moon component - documentation.help · algorithms the book "Calendrical Calculations" by Nachum Dershowitz and Edward M. Reingold. For updates and a listing of bugs (often with patches

TMoon.MoonColorTMoon

TopPreviousNext

ThecolorofthemoondiscpropertyMoonColor:TColor;DescriptionThecolorusedtopaintthemoondiscwhentheMoonStyleissettomsMonochrome.

Page 108: Moon component - documentation.help · algorithms the book "Calendrical Calculations" by Nachum Dershowitz and Edward M. Reingold. For updates and a listing of bugs (often with patches

TMoon.MoonStyleTMoon

TopPreviousNext

Selectsthebitmapstyletobeused.propertyMoonStyle:TMoonStyle;DescriptionSelectsthebitmapstyletobeusedforbothforthepictureandIconproperty.ThevaluemsMonochromeusestheMoonColorvalueforaplaincolordisplay,andthefollowingtwobitmaptypesaresupported:

Page 109: Moon component - documentation.help · algorithms the book "Calendrical Calculations" by Nachum Dershowitz and Edward M. Reingold. For updates and a listing of bugs (often with patches

TMoon.RotationAngleTMoon

TopPreviousNext

SettherotationalangleofthemoonbitmappropertyRotationAngle:integer;DescriptionTheangle(indegrees)usedforrotatingthemoonpicturebyafixedangle.ThisvalueisonlyusediftheRotationpropertyissettorot_angle.

Page 110: Moon component - documentation.help · algorithms the book "Calendrical Calculations" by Nachum Dershowitz and Edward M. Reingold. For updates and a listing of bugs (often with patches

TMoon.TransparentTMoon

TopPreviousNext

DisplaythebitmaptransparentorwiththebackgroundcolorpropertyTransparent:boolean;DescriptionTogglesthetransparentpaintingofthemoon.IfsettofalsethemoonpictureissurroundedbythebackgroundcolorsetbyColor,otherwiseonlythemoondiscwillbepainted..

Page 111: Moon component - documentation.help · algorithms the book "Calendrical Calculations" by Nachum Dershowitz and Edward M. Reingold. For updates and a listing of bugs (often with patches

TSolarTermtype TopPreviousNext

UnitMoontypeTSolarTerm=(st_z2,st_j3,st_z3,st_j4,st_z4,st_j5,st_z5,st_j6,st_z6,

st_j7,st_z7,st_j8,st_z8,st_j9,st_z9,st_j10,st_z10,st_j11,st_z11,st_j12,st_z12,st_j1,st_z1,st_j2);

DescriptionThesolartermsareusedintheChinesecalendarasamoregeneralizedseasonaltiming.Theyaredividedinmajorterms( -zhôngqì)whichcorrespondtoasolarlongitudedivisibleby30°,andminorterms( -jiéqì)divisibleby15°.The4seasonbeginningsareamongthemajorterms.Themajortermsalsocorrespondtothebeginningofthesolarzodiacinwesternastrology.MajorTerm Chinese Unicode Zodiac Season English

Z1 330° yûshuî 96E86C34 iPisces Rainwater

Z2 0° chûnfên 66255206 ^Aries Spring Spring(Vernal)

equinox

Z3 30° gûyû 8C3796E8 _Taurus Grainrain

Z4 60° xiâomân 5C0F6EE1 `Gemini Grainfull

590F Summer

Page 112: Moon component - documentation.help · algorithms the book "Calendrical Calculations" by Nachum Dershowitz and Edward M. Reingold. For updates and a listing of bugs (often with patches

Z5 90° xiàzhì 81F3 aCancer Summer solstice

Z6 120° dáshû 59276691 bLeo Greatheat

Z7 150° chûshû 59046691 cVirgo Limitofheat

Z8 180° qiûfên 79CB5206 dLibra Autumn Autumnequinox

Z9 210° shuângjiàng

971C964D

eScorpio Descendoffrost

Z10 240° xiâoxuê 5C0F96EA

fSagittarius Slightsnow

Z11 270° dôngzhì 51AC81F3

gCapricorn Winter Wintersolstice

Z12 300° dàhán 59275BD2 hAquarius Greatcold

MinorTerm

J1 315° lìchún 7ACB6625 Beginningof

spring

J2 345° jîngzhé 60CA86F0 Wakingof

insects

J3 15° qîngmíng

6E05660E Purebrightness

J4 45° lìxià 7ACB590F Beginningof

summer

J5 75° mángzhòng

829279CD Graininear

J6 105° xiâoshû 5C0F6691 Slightheat

J7 135° lìqiû 7ACB79CB Beginningof

autumn

J8 165° báilù 767D9732 Whitedew

J9 195° hánlù 5BD29732 Colddew

Page 113: Moon component - documentation.help · algorithms the book "Calendrical Calculations" by Nachum Dershowitz and Edward M. Reingold. For updates and a listing of bugs (often with patches

J10 225° lìdông 7ACB51AC

Beginningofwinter

J11 255° dàxuê 592796EA Greatsnow

J12 285° xiâohán 5C0F5BD2 Slightcold

Page 114: Moon component - documentation.help · algorithms the book "Calendrical Calculations" by Nachum Dershowitz and Edward M. Reingold. For updates and a listing of bugs (often with patches

MoonTest TopPreviousNext

TheDUnitframework(seehttp://sourceforge.net/projects/dunit/forthenecessarysourcesandthedocumentation)allowstoaddtestingclosetothecodetobetested,oneofthepartsoftheprogrammingtechniquecalledExtremeProgramming(XP).Buteveninclassicalprogrammingsuchautomatictestscanbeveryusefultomakesurethatchangesinthecodedon'tchangetheresults.Theprojecttestmoon.dprappliesmanyoftheexamplesfromMeeustotheactualimplementationsofthefunctions,andwarnswhentheresultsareoffbymorethanthedeviationcausedbythealgorithmitself.Ofcourseallthetestsworkforthereleasedversionofthealgorithms-butincaseyouwanttomodifythemthesetestscanbeagoodrealitycheck,ortoaddnewtestsnotyetcoveredbythoseinmoontest.pas.NoticethatDUnitonlyworkswithDelphi4andhigherasitusesoverloadinginternallyalot.

Page 115: Moon component - documentation.help · algorithms the book "Calendrical Calculations" by Nachum Dershowitz and Edward M. Reingold. For updates and a listing of bugs (often with patches

UTC:UniversialTimeCoordinated-alsocommonlyknownasGMT(GreenwichMeanTime)


Top Related