Jump to content


Simple question, probably difficult answer: distance between Moon and object in sky?

Recommended Posts

Hi all,

I'd like to use a spreadsheet to calculate the distance between a given DSO, and the Moon, in the sky. Sounds easy enough.

At first I thought this was simple: just do something like hyp squared=x squared+y squared, figure out what x is (whether RA1-RA2 or Az1-Az2), figure out what y is (whether Dec1-Dec2 or Alt1-Alt2), and you're done.

Which would work if this were a regular flat grid with cartesian coordinates. But it isn't, it involves polar coordinates for RA or azimuth. I think. I'm not a mathematician.

The more I think about this, the less I understand the problem or answer. I think that essentially the problem is calculating the direct line distance between two points on a globe. I've found some formulae that calculate an equivalent problem - between two points on earth, using lat and long - but they go around the surface of the globe, whereas I want to go direct. I think.

As for the answer, well I don't even really know what units this would be in! Degrees? Arcmin? It's sort of like asking how big is the sky.

So, are there any physics/maths geniuses who could offer some insight into this? Ideally with some sort of formulae that I could implement in Excel to help me with it? Or if someone could tell me this is a nonsensical notion to begin with, that would be fine, and it would help me to stop fretting about this.

Of course, I could just fire up Stellarium and look, but that would be too easy...

Thanks, Brendan

Link to comment
Share on other sites

After more thinking, this isn't about distances, it's about angles. The smaller the angle, the closer the objects. The largest angle would be 180 degrees, that is, opposite side in the sky. 

So, if I know the difference between the alt for two objects, I have one angle. Same with the az, although I would need to start counting down when it goes past 180 degrees. 

So given those two angles, would that be sufficient to derive the angle between the two objects? I have angle up, and angle across. Can I then get the 'diagonal' (for wanting of a better word, as I said, I'm no mathematician) angle? 

I have a feeling this is either absurdly simple, or fiendishly difficult. 

Stop me if I'm talking nonsense again. 

Edited by BrendanC
  • Like 1
Link to comment
Share on other sites

Hey, thank you! It's all about the search terms I guess - didn't even know about angular distance. This could be exactly what I was looking for - and proves it wasn't quite as easy as I initially thought.

Ah, post-edit...

I don't understand how he's getting his sine cos etc values.

For example, he's saying that d1=-16.58.

Then he says sin (d1)=-0.285

If I do sin(-16.58) in Excel, I get 0.768.

This is the same across all the functions - very different results. There's clearly something very basic I'm doing wrong here. I've tried converting to radians etc, and cannot understand how he's obtaining those values for sins and cosines.

Any ideas?

Post-post edit...

The input to the sine etc functions needs to be in radians, so I just convert from degrees to radians. Then convert the answer back into degrees. All good. :)

Edited by BrendanC
  • Like 1
Link to comment
Share on other sites

17 hours ago, BrendanC said:

I'd like to use a spreadsheet to calculate the distance between ...


3 hours ago, Gfamily said:

Try this page


And this formula 

cos(A) = sin(d1)sin(d2) + cos(d1)cos(d2)cos(ra1-ra2)

After more than a dozen years, an independent check to a formula I posted. Great!


The formula I posted and the formula at astronomycafe are equivalent, as shown by

cos(ra1 - ra2) = cos(ra1)cos(ra2) + sin(ra1)sin(ra2).

I also attached an Excel spreadsheet in the above thread.

  • Like 2
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. By using this site, you agree to our Terms of Use.