Calculation of stars distance

The Concept

Distances between two stars or planets are just simple points in 3D space. Finding the distance between two of these points becomes a simple matter of three-dimensional trigonometry.

Our very important first step is to convert spherical coordinates (declination, right ascension and distance) to Cartesian coordinates (x, y, z).

For any given satellite, let:

α=RA=Right Ascension=Sky longitude of planet or star on a star map\alpha = \text{RA} = \text{Right Ascension} = \text{Sky longitude of planet or star on a star map} δ=Declination=Sky latitude of planet or star on a star map\delta = \text{Declination} = \text{Sky latitude of planet or star on a star map} R=Distance between Earth and planet or star, usually in astronomical units (AU), light years, parsecsR = \text{Distance between Earth and planet or star, usually in astronomical units (AU), light years, parsecs} D=Computed distance between the planets or stars in 3D space, in same units as RD = \text{Computed distance between the planets or stars in 3D space, in same units as R}

Letters α and δ are known spherical coordinates in astronomy. They are the Right Ascension and Declination.

Our formula for converting spherical coordinates to Cartesian coordinates is the following:

x=Rcos(α)cos(δ)x = R \cdot \cos(\alpha) \cdot \cos(\delta)

y=Rsin(α)cos(δ)y = R \cdot \sin(\alpha) \cdot \cos(\delta)

z=Rsin(δ)z = R \cdot \sin(\delta)

This is for one star only. We must compute this for each individual star. So we must compute the following values: $$x_1, y_1, z_1$$

x2,y2,z2x_2, y_2, z_2

Subscript 1 is the first star, subscript 2 is the second star. Then, in order to get the distance between two stars, we must take the square root of each coordinate lengths' squares added together:

D=(x2x1)2+(y2y1)2+(z2z1)2D = \sqrt{(x_2 - x_1)^2 + (y_2 - y_1)^2 + (z_2 - z_1)^2}

We'll get back to this later. But for clarity's sake, let's go through all the individual variables we will have.

Right Ascension

We commonly measure Right Ascension in hours, but we will be computing via degrees now, for simplicity's sake.

Commonly, we use four (4) references to know how to work with Right Ascension:

  • Vernal Equinox: March 20th
  • Summer Solstice: June 20th
  • Autumnal Equinox: September 22nd
  • Winter Solstice: December 21st

Right Ascension is like geographical longitude, but it's measured in time instead of degrees - though, we could convert to degrees. RA tells you how far east along the celestial equator the star lies from a zero point called the Vernal Equinox, which is on March 20th.

The conversion for computational reasons goes as: 36024=15\frac{360^{\circ}}{24} = 15^{\circ}. This means that for every hour on our sphere, we add 15 degrees. So let's say we have a star at 6 hours; then that star will be 15×6=9015 \times 6 = 90^{\circ} from the equinox. But it's usually much more complicated than simple hours; we measure minutes and seconds, too. If we need a decimal degree format (for computational reasons), then we convert as such:

  • 1 day (24 hours) = 360360^{\circ}
  • 1 hour = 1515^{\circ}
  • 1 minute = 0150^{\circ} 15^{'}
  • 1 second = 00150^{\circ} 0^{'} 15^{''}

::: question Exercise: Convert 6 hours, 25 minutes and 3 seconds of angle in time to degrees.

Convert them to decimal degree format. :::

::: answer Convert them to decimal degree format.
First of all, let's look at our table above. 6 hours is 6×156 \times 15 degrees, that is, 9090^{\circ}. We could leave minutes as such, but our task is to convert that minute to degrees (for practice's sake). 2560=0.25\frac{25}{60} = 0.25^{\circ}. That's it. That was it. It's really that simple. Now, seconds to degrees: 453600=0.125\frac{45}{3600} = 0.125^{\circ}. Simple, isn't it? Now, let's add it all up: 90+0.25+0.125=90.37590^{\circ} + 0.25^{\circ} + 0.125^{\circ} = 90.375^{\circ}. Our final answer is $90.375^ˆ^$. :::

Declination

Declination is like geographical latitude: it tells you how far north (+) or south (--) of a star is, from the Earth's equator.

If we project Earth's North and South Poles out onto the sky, we get the North and South Celestial Poles. These are the points around which ethe sky appears to rotate.

Taking Earth's equator and extending that out into space, we get the circle on the sky that is the celestial equator. This divides the sky into a northern and a southern half, just as Earth's equator does for our planet. Now, this reference point is the 0 degrees declination. Northwards, it increases up to positive 90 degrees, up until the North Celestial Pole. Southwards, it decreases down to negative 90 degrees, until the South Celestial Pole.

Distance

Our 3rd coordinate of conversion is the distance, which is symbolized by R, as the radius vector of our imaginary sphere; the line between our eyes and the satellite in question. Our distance unit can be light years, astronomical units, parsecs, kilometers - anything. This will define our ultimate distance unit between the two stars. It is usually given in astronomical distances, though.

The Actual Calculation

If we recall formulas

x=Rcos(α)cos(δ)x = R \cdot \cos(\alpha) \cdot \cos(\delta)

y=Rsin(α)cos(δ)y = R \cdot \sin(\alpha) \cdot \cos(\delta)

z=Rsin(δ)z = R \cdot \sin(\delta)

and

D=(x2x1)2+(y2y1)2+(z2z1)2D = \sqrt{(x_2 - x_1)^2 + (y_2 - y_1)^2 + (z_2 - z_1)^2}

then we can start working with actual, real life data. Our first task will be to calculate the distances between two stars, Sirius and Vega.

Siriusra=101.2870833\text{Sirius}_{\text{ra}} = 101.2870833

Siriusdec=16.7161111\text{Sirius}_{\text{dec}} = -16.7161111

Siriusdist=8.6\text{Sirius}_{\text{dist}} = 8.6

Vegara=279.2345833\text{Vega}_{\text{ra}} = 279.2345833

Vegadec=38.7836111\text{Vega}_{\text{dec}} = 38.7836111

Vegadist=25.3\text{Vega}_{\text{dist}} = 25.3

For our purposes, I wrote a Python script that lets us very easily calculate distances between two stars. Here, I will demonstrate that by giving the code and outputting it's results. You can copy the code if you want, and change the initial settings.

import math

Sirius_ra = 101.2870833
Sirius_dec = -16.7161111
Sirius_dist = 8.6

Vega_ra = 279.2345833
Vega_dec = 38.7836111
Vega_dist = 25.3

x1 = Sirius_dist * math.cos(math.radians(Sirius_ra)) * math.cos(math.radians(Sirius_dec))
y1 = Sirius_dist * math.sin(math.radians(Sirius_ra)) * math.cos(math.radians(Sirius_dec))
z1 = Sirius_dist * math.sin(math.radians(Sirius_dec))
x2 = Vega_dist * math.cos(math.radians(Vega_ra)) * math.cos(math.radians(Vega_dec))
y2 = Vega_dist * math.sin(math.radians(Vega_ra)) * math.cos(math.radians(Vega_dec))
z2 = Vega_dist * math.sin(math.radians(Vega_dec))

dx = (x2 - x1) 
dy = (y2 - y1) 
dz = (z2 - z1) 

D = math.sqrt(dx*dx + dy*dy + dz*dz)
print(f"Distance between Vega and Sirius: {D} light years.")

RESULTS:
Distance between Vega and Sirius: 33.42338352898635 light years.