Skip to content

Latest commit

 

History

History
87 lines (68 loc) · 5.31 KB

README.md

File metadata and controls

87 lines (68 loc) · 5.31 KB

moon

  • Moon phase calculation
  • Moon age calculation
  • Angular diameter
  • Distance to Earth
  • Distance to Sun
  • True Moon longitude
  • Luminous Fraction of the Moon
  • Physical data and parameters of the Moon
  • Emoji supported
  • Supported languages: English, French, German, Spanish, Italian, Russian, Ukrainian

GoDev DOI GolangCI GolangCI GoReport Codiga Codacy Badge License Build status CLDR DMCA.com Protection Status Dependencies Free Gluten Free PRs Welcome DepShield Badge Stars

installation

go get github.com/biter777/moon
import "github.com/biter777/moon"

usage

m := moon.New(time.Now())
fmt.Printf("Moon phase with emoji: %v\n", m.PhaseName(language.English, true))
fmt.Printf("Moon illumination: %v\n", int(m.Illumination*100)+"%")
fmt.Printf("Moon day (Moon age): %v\n", int(m.Age))
fmt.Printf("Full Moon in the current cycle at: %v\n", m.FullMoon())
fmt.Printf("Full Moon in the next cycle at: %v\n", m.NextFullMoon())
fmt.Printf("New Moon in the current cycle at: %v\n", m.NewMoon())
fmt.Printf("New Moon in the next cycle at: %v\n", m.NextNewMoon())
fmt.Printf("Diameter: %v\n", m.Diameter)
fmt.Printf("Distance: %v\n", m.Distance)
fmt.Printf("Longitude: %v\n", m.Longitude)
fmt.Printf("Sun distance: %v\n", m.SunDistance)
fmt.Printf("Sun angular diameter: %v\n", m.SunAngularDiameter)
fmt.Printf("Density: %v\n", moon.Density)
fmt.Printf("AverageDiameter: %v\n", moon.AverageDiameter)
fmt.Printf("AverageDistance: %v\n", moon.AverageDistance)
fmt.Printf("Gravity: %v\n", moon.Gravity)
fmt.Printf("Mass: %v\n", moon.Mass)
fmt.Printf("Average radius: %v\n", moon.AverageRadius)
fmt.Printf("Square: %v\n", moon.Square)
fmt.Printf("Synodic month: %v\n", moon.SynodicMonth)

For more complex options, consult the documentation.

Contributing

  1. Welcome pull requests, bug fixes and issue reports

    Contributors list

  2. Donate - a donation isn't necessary, but it's welcome.

    Donate using Liberapay ko-fi

  3. Star us - give us a star, please, if it's not against your religion :)

    Stars