Distance Between Two Stars or Bodies Calculator
by Jay Tanner - 2024
Body  1
RA,  Decl,  Dist


Body  1
RA,  Decl,  Dist



Distance Between the Bodies in Space:

We can compute the distance between two astronomical bodies in 3D space based on their spherical coordinates (right ascensions and declinations) and distances from the Earth or Sun to the extent that they are numerically known.

Below are the details of how to go about computing the distance between two stars or planets in 3D space.  It is really a rather simple computation to perform, especially for modern computers, and it is based on very elementary geometric concepts dating back thousands of years to Euclid (c 300 BC).

NOTE:
The initial default startup coordinates and distances are for the two Ursa Major stars called Dubhe (α UMa) and Merak (β UMa).

There are three things we need to know first:

The distance (D) between the bodies is to be computed
from the above spherical coordinates.

To compute the rectangular XYZ-coordinates from
the spherical right ascension, declination and distance:

Assign each star or planet an identifying subscript, such as labels like Star1 and Star2, and then compute the 3D rectangular XYZ-coordinates for both of them.
Below are the basic equations used to compute the distance between two stars or planets in 3D space.
For Star1 we have:
For Star2 we have:
Now, given the computed 3D rectangular XYZ-coordinates of the two bodies, we can compute the direct spatial distance between them from the simple formula given below.

Mathematically, the distance between any two bodies in space is numerically equated to the square root of the sum of the squares of the differences between their respective rectangular coordinates.  This applies to any number of spatial dimensions (in this case 3).

Finally, the spatial distance between the bodies is:
The computed distance (D) will be expressed in the same units used for the spherical distance (R) from the Earth or Sun.

Revised: 1970-Jan-01-Thu at Local Time 12:00:00 AM (UTC−05:00)