commons-suncalc icon indicating copy to clipboard operation
commons-suncalc copied to clipboard

Moon age (days) calculation

Open vdurnev opened this issue 2 years ago • 2 comments

Thank you for your work, Richard

What is the right way to calculate Moon age (Moon days) using your library?

vdurnev avatar Aug 13 '22 07:08 vdurnev

This is kotlin

    val moonage = 29.0 * (normalized / 360.0) + 1.0
    content += "Moon Age: " + moonage.toString()

ELY3M avatar Nov 06 '22 16:11 ELY3M

I don't code in Kotlin, but it's enough like Java that I'm reasonably confident you don't need the explicit moonage.toString(). Simplifying a bit, you can think of string concatenation terms all being wrapped in an implicit String.valueOf(x) call.

What is the precise definition of Moon age/days here? I'm not familiar with this.

isomeme avatar Nov 06 '22 22:11 isomeme