Warning
This repository has been moved to Codeberg: LunaZodiaco
This cross platform - Linux, Mac OS X and Windows - F# .Net library and smartphone app calculates and shows the moon phase and the moon's zodiac at any date between the 1st of January 1900 and the 31st of December, 2099.
It calculates the ecliptic longitude of the moon (zodiac) using an algorithm from Paul Schlyter Computing planetary positions - a tutorial with worked examples and the moon phase using the moon age calculations of John Horton Conway.
It uses Fabulous as F# MVU (Elm-like) frontend to Xamarin.Forms.
For more information about calculations regarding the moon, see Links.
Information about the smartphone app is at Usage of the Smartphone App
To interactively try out the F# NuGet package LunaZodiaco, go to the Jupyter Notebook
Full documentation can be found at Read the Docs
Computing planetary positions - a tutorial with worked examples by Paul Schlyter
Moon age (phase) calculation by John Horton Conway.
Link to a site with the current data of the moon.
List of changes: CHANGELOG.md
Download the latest release: Release at GitHub
Install the package for your smartphone (.apk for Android) onto your phone - search the web on how you can do that, this depends on your phone
I can’t generate an iPhone package myself, so you have to build the project IOS for yourself and provision the app to your phone. Microsoft has a how-to here
Download an install the LunaZodiaco Nuget package using your IDE (Visual Studio or JetBrains Rider) or one of the command-line possibilities: LunaZodiaco Package at NuGet
In an interactive F# FSI session, you can use the command #r "nuget: LunaZodiaco" to download and use the NuGet package LunaZodiaco.
See YouTube video of the smartphone app for a video.
LunaZodiaco is a F# NuGet package to calculate the moon phase and the moon's zodiac (ecliptic longitude) at a given day. It uses Conway's method to calculate the moon age, which works in the 20th and 21th century and has an accuracy of about 1 day. The zodiac / ecliptic longitude ist calculated using an algorithm of Paul Schlyter - Computing planetary positions - a tutorial with worked examples.
So both values aren't accurate enough for use in a serious astronomy program, but suitable for a calender like application - the position changes during one day anyway.
You can try LunaZodiaco interactively online using this Jupyter notebook at .
Download an install the LunaZodiaco Nuget package using your IDE (Visual Studio or JetBrains Rider) or one of the command-line possibilities: LunaZodiaco Package at NuGet
In an interactive F# FSI session, you can use the command #r "nuget: LunaZodiaco" to download and use the NuGet package LunaZodiaco.
#r "nuget: LunaZodiaco"
Installed package LunaZodiaco version 0.9.2
Everything is located in the namespace RC.Moon
, so lets open that.
To check if everything is working, we try to display the Unicode codepoint of a full moon:
open RC.Moon
MoonPhase.FullMoon.ToUnicode ()
🌕️
Types and functions regarding the lunar phase are located in the module MoonPhase
.
There is a discriminated union for all 8 lunar phases:
MoonPhase.NewMoon
Luna nueva
MoonPhase.WaxingCrescent
Luna creciente
MoonPhase.FirstQuarter
Cuarto creciente
MoonPhase.WaxingGibbous
Creciente gibosa
MoonPhase.FullMoon
Luna Llena
MoonPhase.WaningGibbous
Menguante gibosa
MoonPhase.LastQuarter
Cuarto menguante
MoonPhase.WaningCrescent
Luna menguante
The member ToString
and the function MoonPhase.toString
both return the Spanish name of the lunar phase.
MoonPhase.NewMoon.ToString ()
Luna nueva
MoonPhase.toString MoonPhase.NewMoon
Luna nueva
The member ToUnicode
returns the Unicode codepoint of the lunar phase, a symbol. Same as the function MoonPhase.toUnicode
.
MoonPhase.FirstQuarter.ToUnicode ()
🌓️
MoonPhase.toUnicode MoonPhase.FirstQuarter
🌓️
The member ToInt
return an integer index of the lunar phase, where 0
is the new moon, 4
is the full moon and 7
waning crescent.
MoonPhase.WaxingGibbous.ToInt ()
3
The member FromInt
and function MoonPhase.fromInt
convert an int to a moon phase option, it is the inverse of the function ToInt
above.
MoonPhase.fromInt 3
Value
Creciente gibosa
MoonPhase.T.FromInt 3
Value
Creciente gibosa
Too big or small integers yield None
.
MoonPhase.fromInt -6
None
The function MoonPhase.getInterval
and member Interval
return the elongation interval of the phase.
The last quarter occures between an elongation angle (between the moon and the sun) of 270 degrees up to, but not including, 315 degrees.
MoonPhase.LastQuarter.Interval ()
Item1 Item2
270 315
MoonPhase.getInterval MoonPhase.LastQuarter
Item1 Item2
270 315
The inverse function of getInterval
is fromAngle
, the member function is named FromAngle
. This returns the lunar phase to a given elongation angle. Angles in degrees need the measurement ``.
MoonPhase.fromAngle 346.
Value
Luna menguante
MoonPhase.T.FromAngle 346.
Value
Luna menguante
All zodiac related functions the the zodiac type are contained in the module Zodiac
.
There is a discriminated union for all 12 zodiacs:
Zodiac.Aries
Aries
Zodiac.Taurus
Tauro
Zodiac.Gemini
Géminis
And so on, until
Zodiac.Aquarius
Acuario
Zodiac.Pisces
Piscis
The member ToString
and the function Zodiac.toString
both return the Spanish name of the lunar phase.
Zodiac.Aries.ToString ()
Aries
Zodiac.toString Zodiac.Aries
Aries
The member ToUnicode
returns the Unicode codepoint of the zodiac, a symbol. Same as the function Zodiac.toUnicode
.
Zodiac.Gemini.ToUnicode ()
♊
Zodiac.toUnicode Zodiac.Gemini
♊
The member ToInt
return an integer index of the zodiac, where 0
is the Aries, ... and 11
Pisces.
Zodiac.Capricorn.ToInt ()
9
The member FromInt
and function Zodiac.fromInt
convert an int to a moon phase option, it is the inverse of the function ToInt
above.
Zodiac.fromInt 5
Value
Virgo
Zodiac.T.FromInt 5
Value
Virgo
Too big or small integers yield None
.
Zodiac.fromInt -6
None
The function Zodiac.getInterval
and member Interval
return the ecliptic longitude interval of the phase.
Libra occurs in the ecliptic longitude angle of 180 to 210 degrees, including 180 but excluding 210.
Zodiac.Libra.Interval ()
Item1 Item2
180 210
Zodiac.getInterval Zodiac.Libra
Item1 Item2
180 210
The inverse function of getInterval
is fromAngle
, the member function is named FromAngle
. This returns the zodiac to a given ecliptic longitude angle. Angles in degrees need the measurement ``.
Zodiac.fromAngle 346.
Value
Piscis
Zodiac.T.FromAngle 346.
Value
Piscis
This module contains the moon phase and zodiac calculations and the type MoonDay
, that holds the zodiac and lunar phase for a given date.
let moonDay = { LunaZodiaco.MoonDay.Phase = MoonPhase.WaningGibbous; LunaZodiaco.Zodiac = Zodiac.Capricorn }
moonDay
Phase Zodiac
Menguante gibosa Capricornio
MoonDay
does have the member ToStrings
and function LunaZodiaco.toStrings
, that return a tuple of strings
LunaZodiaco.toStrings moonDay
Item1 Item2
Menguante gibosa Capricornio
moonDay.ToStrings ()
Item1 Item2
Menguante gibosa Capricornio
And the member ToString
, that returns a single string.
moonDay.ToString ()
{ Phase = WaningGibbous
Zodiac = Capricorn }
The function LunaZodiaco.toUnicode
returns the moon phase and zodiac as a tuple of Unicode code points / symbols:
LunaZodiaco.toUnicode moonDay
Item1 Item2
🌖 ♑
moonDay.ToUnicode ()
Item1 Item2
🌖 ♑
The member ToIntervals
and the function LunaZodiaco.toIntervals
return the elongation angle and the ecliptic longitude angle interval of the moon phase and zodiac as a tuple.
LunaZodiaco.toIntervals moonDay
Item1 Item2
( 225, 270 ) ( 270, 300 )
moonDay.ToIntervals ()
Item1 Item2
( 225, 270 ) ( 270, 300 )
The function LunaZodiaco.computeMoonPhase
returns the moon phase interval of the moon at a given date, with an accuracy of +/- one day. Attention: it only works in the 20th and 21st century, as it uses Conways algorithm to calculate the moon age (the day of the moon in one lunar cycle of 29 days).
open System
LunaZodiaco.computeMoonPhase (DateTime (2021, 05, 06))
Item1 Item2
315 360
THe function LunaZodiaco.computeLongitude
calculates the ecliptic longitude of the moon at the given day (well, an angle that it has during the day).
LunaZodiaco.computeLongitude (DateTime (2021, 05, 06))
340.9314455776453
To get the moon phase and moon zodiac of a day, use the function LunaZodiaco.getMoonDay
, that returns the moon phase and the zodiac as a MoonDay
record.
LunaZodiaco.getMoonDay (DateTime (2021, 05, 06))
Phase Zodiac
Luna menguante Piscis
Any help is welcome!
If you encounter a problem using LunaZodiaco, a task it not as easy as you'd like it to be or you'd like something added to it: open an issue at GitHub, see section Report Issues.
See page Contributing at Read the Docs for a detailed description.
All content except some images of LunaZodiaco is licensed under the MIT license, see file LICENSE.
LunaZodiaco does not collect or share any personal information, it does not contain any ads, trackers or in-app-payments. See: Privacy Policy