# What should be the seperation between sun and moon during a solar and lunar eclipse as viewed from earth?

I saw this code online where a guy calculates the separation between sun and moon and verify the occurrence of eclipses. You can find the codes here.

Why does he uses earth's angular size seen from the moon in this calculation ?

• Maybe that comment is related to the lunar eclipse portion of the calculation? Imagine you're on the moon - then a lunar eclipse on Earth looks like a solar eclipse to you. – Carl Witthoft Dec 24 '18 at 17:35
• Because his observer is geocentric (observer.elevation = -6371000), he needs to compute if there's anywhere on the surface of the Earth, even if there isn't one at the center of the Earth. – barrycarter Dec 26 '18 at 20:35