Skip to content

Moon Illumination Issue #17

Open
Open
@jindal12ketan

Description

@jindal12ketan

Here in function for Moon Illumination there should be some changes to be happen:

  1. inc = atan(sdist * sin(phi), m['dist'] - sdist * cos(phi)), # comma should not be there after calculating atan
  2. sdist = 149597870.7 position of sun should not be constant for given date

to calculate the distance between sun and earth we should use true_anomaly of sun like below.

`def true_anomaly(days):
M = solar_mean_anomaly(days)
E = M
epsilon = 1e-6
max_iterations = 100
for _ in range(max_iterations):
E_new = E - (E - e * np.sin(E) - M) / (1 - e * np.cos(E))
if abs(E_new - E) < epsilon:
break
E = E_new

theta = 2 * np.arctan(np.sqrt((1 + e) / (1 - e)) * np.tan(E / 2))
return theta`

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions