Download the PHP package solaris/php-moon-phase without Composer
On this page you can find all versions of the php package solaris/php-moon-phase. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download solaris/php-moon-phase
More information about solaris/php-moon-phase
Files in solaris/php-moon-phase
Package php-moon-phase
Short Description Calculate the phases of the Moon in PHP.
License MIT
Homepage https://github.com/BitAndBlack/php-moon-phase
Informations about the package php-moon-phase
Solaris PHP Moon Phase
Calculate the phases of the Moon in PHP. This library is based on Moontool for Windows.
Installation
This library is made for the use with Composer. Add it to your project by running $ composer require solaris/php-moon-phase
.
Usage
Create an instance of the MoonPhase
class, supplying a DateTime
object with a UNIX timestamp for when you want to determine the moon phase (if you don't then the current time will be used).
You can then use the following methods:
getPhase()
: the terminator phase angle as a fraction of a full circle (i.e.,0
to1
). Both0
and1
correspond to a New Moon, and0.5
corresponds to a Full Moon.getIllumination()
: the illuminated fraction of the Moon (0
= New,1
= Full).getAge()
: the age of the Moon, in days.getDistance()
: the distance of the Moon from the centre of the Earth (kilometres).getDiameter()
: the angular diameter subtended by the Moon as seen by an observer at the centre of the Earth (degrees).getSunDistance()
: the distance to the Sun (kilometres).getSunDiameter()
: the angular diameter subtended by the Sun as seen by an observer at the centre of the Earth (degrees).getPhaseNewMoon()
: the time of the New Moon in the current lunar cycle, i.e., the start of the current cycle (UNIX timestamp).getPhaseNextNewMoon()
: the time of the New Moon in the next lunar cycle, i.e., the start of the next cycle (UNIX timestamp).getPhaseFullMoon()
: the time of the Full Moon in the current lunar cycle (UNIX timestamp).getPhaseNextFullMoon()
: the time of the Full Moon in the next lunar cycle (UNIX timestamp).getPhaseFirstQuarter()
: the time of the first quarter in the current lunar cycle (UNIX timestamp).getPhaseNextFirstQuarter()
: the time of the first quarter in the next lunar cycle (UNIX timestamp).getPhaseLastQuarter()
: the time of the last quarter in the current lunar cycle (UNIX timestamp).getPhaseNextLastQuarter()
: the time of the last quarter in the next lunar cycle (UNIX timestamp).getPhaseName()
: the phase name.
Example
Help
If you have any questions, feel free to contact us under [email protected]
.
Further information about Bit&Black can be found under www.bitandblack.com.