<p>Part Oe of Five: An Online Dsitance calculator.</p>
<p>Here is a link to an online calculator that calculates the distance between two stars.</p>
<p><a href="https://www.wolframalpha.com/widgets/view.jsp?id=1ece06643e87f3c4d90813af5ee12223#:%7E:text=Wolfram%7CAlpha%20Widgets%3A%20%22The,two%20stars%22%20%2D%20Free%20Astronomy%20Widget" rel="nofollow noreferrer">https://www.wolframalpha.com/widgets/view.jsp?id=1ece06643e87f3c4d90813af5ee12223#:~:text=Wolfram%7CAlpha%20Widgets%3A%20%22The,two%20stars%22%20%2D%20Free%20Astronomy%20Widget</a></p>
<p>I think it only works for the stars that are in it's data base.</p>
<p>Part Two: A Problem With Aliens From Delta Pavonis.</p>
<p>Here is a frame challenge.</p>
<p>Delta Pavonis might be too close to Earth to be the center of a realm colonizing other stars, if Earth is not already colonized at the beginning of the story.  Because only a minority of stars would be expected to have (naturally) habitable planets, Earth might be one of a very few habitable planets closest to Data Pavonis, or even the closest habitable planet to Delta Pavonis.</p>
<p>Here is a link to <em>Habitable Planets for Man</em>, Stephen Dole, 1964.</p>
<p><a href="https://www.rand.org/content/dam/rand/pubs/commercial_books/2007/RAND_CB179-1.pdf" rel="nofollow noreferrer">https://www.rand.org/content/dam/rand/pubs/commercial_books/2007/RAND_CB179-1.pdf</a></p>
<p>There are  many places within the biosphere of planet Earth which are filled with lifeforms, but where unwarned and unprotected humans would swiftly die.  For example, a few kilometers high the atmosphere, or a few kilometers beneath the surface of the Sea, or a few kilometers deep in rock where microorganisms live.  And even on the surface of the Earth, the majority of the surface is water too far from the nearest land for a human to swim.</p>
<p>So most parts of Earth's biosphere are habitable for liquid water using lifeforms, but not habitable for humans.  So it is easy to imagine that there could be planets which are habitable for some liquid water using lifeforms, but don't have any places that are habitable for humans.</p>
<p>So planets habitable for humans in particular should be a smaller subset of planets habitable for liquid water using life in general.</p>
<p>And most discussions of planetary habitability discuss habitability for liquid water using life in general.  The only discussion of planetary habitability for humans in particular (and thus for aliens who also need an oxygen rich atmosphere) is <em>Habitable Planets for Man</em>.</p>
<p>Dole calculates the probability that an individual star will have a human habitable planet, a figure which many science fiction fans will consider to be &quot;Dole-fully&quot; small.</p>
<p>Table 19 on page 105 lists the expected (by Dole) number of human habitable planets within spheres around Earth with different radii.</p>
<p>Within a radius of 27.2 light years there should be one habitable planet (beside Earth).</p>
<p>Within a radius of 34.3 light years there should be 2 habitable planets (beside Earth).</p>
<p>Within a radius of 46.5 light years there should be 5 habitable planets (beside Earth).</p>
<p>Within a radius of 25.5 light years there should be 10 habitable planets (beside Earth).</p>
<p>Within a radius of 100 light years there should be 50 habitable planets (beside Earth).</p>
<p>So if the Delta Pavonians made the same sort of calculations and got the same figures as Dole, they would be pleasantly surprised to find their first habitable planet as close to Delta Pavonis as Earth is.  And Earth would be the first planet they conquered and colonized.</p>
<p>So every writer of a story where aliens colonize planets of other stars beside their home star has to decide on how many planets they have already colonized, and thus the radius of their sphere of colonization.  And if Earth is not already colonized by them at the beginning of the story, their home planet must be at least a little bit, and possibly thousands of light years, farther from Earth than the radius of their sphere of colonization.</p>
<p>So if the Delta Pavonians have already colonized a bunch of different star systems at the star of the story, Earth will be within their sphere of colonization.  And maybe the Delta Pavonians decided not to colonize Earth or interfere with humans, but only colonized planets with no native intelligent life.  So stars colonized by the Delta Pavonians should be all around Earth in every direction.  And the home star of the aliens who fight the Delta Pavonians could be in any direction as seen from Earth, since the Delta Pavonian border which those aliens come from beyond is in every direction as seen from Earth.</p>
<p>Part Three: A Solution.</p>
<p>Or the aliens could come from a star tens or hundreds of light years from Earth.  At that distance a star capable of having a naturally human habitable planet would probably not be visible to the naked eye from Earth and would be known by its catalog numbers in various star catalogs.</p>
<p>Part Four: Another Solution.</p>
<p>Or you could say in your story that many more planets in the star systems around Earth are habitable than should naturally be habitable.  The cause is that sometime in the past an advanced society terraformed the planets of many stars, including many stars which couldn't have naturally habitable planets, and so habitable planets are much more common than they would naturally be.</p>
<p>Thus the Delta Pavonians could have colonized at least a few planets around nearby stars without having discovered Earth yet.</p>
<p>Part Five: The Worldbuilding Stack Exchange.</p>
<p>You can also ask questions about creating fictional worlds and societies at the Worldbuilding Stack Exchange.</p>
<p><a href="https://worldbuilding.stackexchange.com/">https://worldbuilding.stackexchange.com/</a></p>

CC BY-SA 4.0
2023-03-15T05:00:01.037Z
2023-03-15T05:00:01.037Z
M. A. Golding
<p>That can be done, using the cosine-rule in mathematics:</p>
<p><span class="math-container">$$A^2 = B^2 + C^2 - 2BC\cos(\alpha)$$</span></p>
<p><a href="https://i.sstatic.net/R6KE6.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/R6KE6.png" alt="enter image description here" /></a></p>
<p><span class="math-container">$a$</span> is the location of the sun, <span class="math-container">$b$</span> and <span class="math-container">$c$</span> the location of your other stars.</p>

CC BY-SA 4.0
2023-03-14T15:13:31.887Z
It's little bit more involved than this, because you'll still have to calculate the angular separation of the two stars $\alpha$ from the coordinate system.
notovny
CC BY-SA 4.0
2023-03-15T05:02:30.447Z
I don't think it is that simple. It involves Celestial coordinates which is more than what Cosine rule can achieve.
Nilay Ghosh
CC BY-SA 4.0
2023-03-14T11:09:10.013Z
2023-03-14T11:09:10.013Z
Dominique
<p>This can be done straightforwardly without even thinking about the geometry if you convert to Cartesian coordinates. Given a star at distance <span class="math-container">$d$</span>, <a href="https://en.wikipedia.org/wiki/Galactic_coordinate_system#Galactic_latitude" rel="nofollow noreferrer">galactic latitude</a> <span class="math-container">$b$</span>, and <a href="https://en.wikipedia.org/wiki/Galactic_coordinate_system#Galactic_longitude" rel="nofollow noreferrer">galactic longitude</a> <span class="math-container">$l$</span>, you can define Cartesian coordinates such that
<span class="math-container">$$ x = d\cos b \cos l$$</span>
<span class="math-container">$$ y = d\cos b \sin l$$</span>
<span class="math-container">$$ z = d\sin b.$$</span>
If you evaluate these coordinates for both stars, you can then subtract them to get the separation.</p>
<hr />
<p>Explicitly, suppose star 1 is at distance <span class="math-container">$d$</span>, galactic latitude <span class="math-container">$b$</span>, and galactic longitude <span class="math-container">$l$</span>, and star 2 is at distance <span class="math-container">$d^\prime$</span>, galactic latitude <span class="math-container">$b^\prime$</span>, and galactic longitude <span class="math-container">$l^\prime$</span>. Then the distance between them is</p>
<p><span class="math-container">$$\sqrt{(d\cos b \cos l-d^\prime\cos b^\prime \cos l^\prime)^2+(d\cos b \sin l-d^\prime\cos b^\prime \sin l^\prime)^2+(d\sin b-d^\prime\sin b^\prime)^2}.$$</span></p>

CC BY-SA 4.0
2023-03-14T20:16:23.050Z
Could you please enlighten me on the difference between Cartesian and Galactic coordinates? Also, what actions exactly do you make in these calculations? Is it multiplication?
At school, I had poor grades in mathematics and was stubbornly sure I wouldn't need math in life :-)
Krišjānis Liepiņš
CC BY-SA 4.0
2023-03-14T20:33:24.733Z
[Galactic coordinates](https://en.wikipedia.org/wiki/Galactic_coordinate_system) describe the angular position of an object on the two-dimensional sky, in a manner that's oriented with respect to the Milky Way galaxy. It's like latitude and longitude on the Earth, if the galaxy were to lie along the equator. [Cartesian coordinates](https://en.wikipedia.org/wiki/Cartesian_coordinate_system) give the three-dimensional position of an object, in terms of three coordinates that can be viewed as "front/back position", "left/right position", and "up/down position".
Sten
CC BY-SA 4.0
2023-03-14T22:26:18.767Z
@KrišjānisLiepiņš I added the full explicit calculation
Sten
CC BY-SA 4.0
2023-03-15T07:49:00.890Z
Thank you, this is very helpful!
Krišjānis Liepiņš
CC BY-SA 4.0
2023-03-20T17:17:06.490Z
@Sten I was reading the von Hoerner paper, where he estimates that the average distance between technical civilizations is  $D=\frac{D_0}{\nu^{\frac{1}{3}}}$, where $D_0$ is the average distance between stars and $\nu$ is the number of technical civilizations. Do you know how this formula is justified.
Alexander Cska
CC BY-SA 4.0
2023-03-20T17:26:07.097Z
@AlexanderCska It sounds like $\nu$ is the fraction of stars that host such civilizations. Then the number density of stars (number per volume) is $D_0^{-3}$, so the number density of civilizations is $\nu D_0^{-3} = (D_0/\nu^{1/3})^{-3}$.
Sten
CC BY-SA 4.0
2023-03-20T17:47:47.163Z
@Sten thank you. So basically $\frac{\nu}{\frac{4}{3}\pi D_0^3}=\frac{1}{\frac{4}{3}\pi D^3}$. But here we equate number density stuff per volume, to inverse volume? I am a bit puzzled :(.
Alexander Cska
CC BY-SA 4.0
2023-03-14T19:27:46.000Z
2023-03-14T22:25:07.820Z
2023-03-14T22:25:07.820Z
Sten
<p>I have data on nearby stars, including galactic coordinates and distance from Sun. And I have a dilemma.</p>
<p>In a story I'm writing, I have two starfaring alien civilisations. One originates from a planet orbiting Delta Pavonis and has a few settlements on nearby (to Delta Pavonis) stars. The second civilisation originates from a planet orbiting a star near Delta Pavonis as it is attacking the first civilisation.</p>
<p>But two stars that are at a similar distance from Sun, let's say, 12 light years, might be very far apart from each other as they are on opposite sides of the sky.</p>
<p>Thus my question is, knowing the galactic coordinates of stars and distances from the Sun, how to calculate distances between the two stars?</p>

CC BY-SA 4.0
2023-03-16T22:57:13.047Z
Highly relevant: https://astronomy.stackexchange.com/questions/39595/what-is-the-distance-from-alpha-centauri-to-barnards-star/39603#39603
sforsingh
<galaxy><distances><coordinate>
How to calculate distance between stars?
Krišjānis Liepiņš
# How to calculate distance between stars?

(Asked by: username_0 on 2023-03-14)

I have data on nearby stars, including galactic coordinates and distance from Sun. And I have a dilemma.

In a story I'm writing, I have two starfaring alien civilisations. One originates from a planet orbiting Delta Pavonis and has a few settlements on nearby (to Delta Pavonis) stars. The second civilisation originates from a planet orbiting a star near Delta Pavonis as it is attacking the first civilisation.

But two stars that are at a similar distance from Sun, let's say, 12 light years, might be very far apart from each other as they are on opposite sides of the sky.

Thus my question is, knowing the galactic coordinates of stars and distances from the Sun, how to calculate distances between the two stars?

**Tags:** galaxy, distances, coordinate

> **Comments:**
> **username_1**: Highly relevant: https://astronomy.stackexchange.com/questions/39595/what-is-the-distance-from-alpha-centauri-to-barnards-star/39603#39603  

---

## 3 answers

### Answer by username_6 on 2023-03-14. Score: 5 | Accepted answer

This can be done straightforwardly without even thinking about the geometry if you convert to Cartesian coordinates. Given a star at distance $d$, [galactic latitude](https://en.wikipedia.org/wiki/Galactic_coordinate_system#Galactic_latitude) $b$, and [galactic longitude](https://en.wikipedia.org/wiki/Galactic_coordinate_system#Galactic_longitude) $l$, you can define Cartesian coordinates such that
$$ x = d\cos b \cos l$$
$$ y = d\cos b \sin l$$
$$ z = d\sin b.$$
If you evaluate these coordinates for both stars, you can then subtract them to get the separation.

---

Explicitly, suppose star 1 is at distance $d$, galactic latitude $b$, and galactic longitude $l$, and star 2 is at distance $d^\prime$, galactic latitude $b^\prime$, and galactic longitude $l^\prime$. Then the distance between them is

$$\sqrt{(d\cos b \cos l-d^\prime\cos b^\prime \cos l^\prime)^2+(d\cos b \sin l-d^\prime\cos b^\prime \sin l^\prime)^2+(d\sin b-d^\prime\sin b^\prime)^2}.$$

> **Comments:**
> **username_0**: Could you please enlighten me on the difference between Cartesian and Galactic coordinates? Also, what actions exactly do you make in these calculations? Is it multiplication? At school, I had poor grades in mathematics and was stubbornly sure I wouldn't need math in life :-)  
> **username_6**: [Galactic coordinates](https://en.wikipedia.org/wiki/Galactic_coordinate_system) describe the angular position of an object on the two-dimensional sky, in a manner that's oriented with respect to the Milky Way galaxy. It's like latitude and longitude on the Earth, if the galaxy were to lie along the equator. [Cartesian coordinates](https://en.wikipedia.org/wiki/Cartesian_coordinate_system) give the three-dimensional position of an object, in terms of three coordinates that can be viewed as "front/back position", "left/right position", and "up/down position".  
> **username_6**: @username_0 I added the full explicit calculation  
> **username_0**: Thank you, this is very helpful!  
> **username_7**: @username_6 I was reading the von Hoerner paper, where he estimates that the average distance between technical civilizations is  $D=\frac{D_0}{\nu^{\frac{1}{3}}}$, where $D_0$ is the average distance between stars and $\nu$ is the number of technical civilizations. Do you know how this formula is justified.  
> **username_6**: @username_7 It sounds like $\nu$ is the fraction of stars that host such civilizations. Then the number density of stars (number per volume) is $D_0^{-3}$, so the number density of civilizations is $\nu D_0^{-3} = (D_0/\nu^{1/3})^{-3}$.  
> **username_7**: @username_6 thank you. So basically $\frac{\nu}{\frac{4}{3}\pi D_0^3}=\frac{1}{\frac{4}{3}\pi D^3}$. But here we equate number density stuff per volume, to inverse volume? I am a bit puzzled :(.  

---

### Answer by username_2 on 2023-03-15. Score: 1

Part Oe of Five: An Online Dsitance calculator.

Here is a link to an online calculator that calculates the distance between two stars.

[https://www.wolframalpha.com/widgets/view.jsp?id=1ece06643e87f3c4d90813af5ee12223#:~:text=Wolfram%7CAlpha%20Widgets%3A%20%22The,two%20stars%22%20%2D%20Free%20Astronomy%20Widget](https://www.wolframalpha.com/widgets/view.jsp?id=1ece06643e87f3c4d90813af5ee12223#:%7E:text=Wolfram%7CAlpha%20Widgets%3A%20%22The,two%20stars%22%20%2D%20Free%20Astronomy%20Widget)

I think it only works for the stars that are in it's data base.

Part Two: A Problem With Aliens From Delta Pavonis.

Here is a frame challenge.

Delta Pavonis might be too close to Earth to be the center of a realm colonizing other stars, if Earth is not already colonized at the beginning of the story. Because only a minority of stars would be expected to have (naturally) habitable planets, Earth might be one of a very few habitable planets closest to Data Pavonis, or even the closest habitable planet to Delta Pavonis.

Here is a link to *Habitable Planets for Man*, Stephen Dole, 1964.

<https://www.rand.org/content/dam/rand/pubs/commercial_books/2007/RAND_CB179-1.pdf>

There are many places within the biosphere of planet Earth which are filled with lifeforms, but where unwarned and unprotected humans would swiftly die. For example, a few kilometers high the atmosphere, or a few kilometers beneath the surface of the Sea, or a few kilometers deep in rock where microorganisms live. And even on the surface of the Earth, the majority of the surface is water too far from the nearest land for a human to swim.

So most parts of Earth's biosphere are habitable for liquid water using lifeforms, but not habitable for humans. So it is easy to imagine that there could be planets which are habitable for some liquid water using lifeforms, but don't have any places that are habitable for humans.

So planets habitable for humans in particular should be a smaller subset of planets habitable for liquid water using life in general.

And most discussions of planetary habitability discuss habitability for liquid water using life in general. The only discussion of planetary habitability for humans in particular (and thus for aliens who also need an oxygen rich atmosphere) is *Habitable Planets for Man*.

Dole calculates the probability that an individual star will have a human habitable planet, a figure which many science fiction fans will consider to be "Dole-fully" small.

Table 19 on page 105 lists the expected (by Dole) number of human habitable planets within spheres around Earth with different radii.

Within a radius of 27.2 light years there should be one habitable planet (beside Earth).

Within a radius of 34.3 light years there should be 2 habitable planets (beside Earth).

Within a radius of 46.5 light years there should be 5 habitable planets (beside Earth).

Within a radius of 25.5 light years there should be 10 habitable planets (beside Earth).

Within a radius of 100 light years there should be 50 habitable planets (beside Earth).

So if the Delta Pavonians made the same sort of calculations and got the same figures as Dole, they would be pleasantly surprised to find their first habitable planet as close to Delta Pavonis as Earth is. And Earth would be the first planet they conquered and colonized.

So every writer of a story where aliens colonize planets of other stars beside their home star has to decide on how many planets they have already colonized, and thus the radius of their sphere of colonization. And if Earth is not already colonized by them at the beginning of the story, their home planet must be at least a little bit, and possibly thousands of light years, farther from Earth than the radius of their sphere of colonization.

So if the Delta Pavonians have already colonized a bunch of different star systems at the star of the story, Earth will be within their sphere of colonization. And maybe the Delta Pavonians decided not to colonize Earth or interfere with humans, but only colonized planets with no native intelligent life. So stars colonized by the Delta Pavonians should be all around Earth in every direction. And the home star of the aliens who fight the Delta Pavonians could be in any direction as seen from Earth, since the Delta Pavonian border which those aliens come from beyond is in every direction as seen from Earth.

Part Three: A Solution.

Or the aliens could come from a star tens or hundreds of light years from Earth. At that distance a star capable of having a naturally human habitable planet would probably not be visible to the naked eye from Earth and would be known by its catalog numbers in various star catalogs.

Part Four: Another Solution.

Or you could say in your story that many more planets in the star systems around Earth are habitable than should naturally be habitable. The cause is that sometime in the past an advanced society terraformed the planets of many stars, including many stars which couldn't have naturally habitable planets, and so habitable planets are much more common than they would naturally be.

Thus the Delta Pavonians could have colonized at least a few planets around nearby stars without having discovered Earth yet.

Part Five: The Worldbuilding Stack Exchange.

You can also ask questions about creating fictional worlds and societies at the Worldbuilding Stack Exchange.

<https://worldbuilding.stackexchange.com/>


---

### Answer by username_3 on 2023-03-14. Score: 0

That can be done, using the cosine-rule in mathematics:

$$A^2 = B^2 + C^2 - 2BC\cos(\alpha)$$

[![enter image description here](https://i.sstatic.net/R6KE6.png)](https://i.sstatic.net/R6KE6.png)

$a$ is the location of the sun, $b$ and $c$ the location of your other stars.

> **Comments:**
> **username_4**: It's little bit more involved than this, because you'll still have to calculate the angular separation of the two stars $\alpha$ from the coordinate system.  
> **username_5**: I don't think it is that simple. It involves Celestial coordinates which is more than what Cosine rule can achieve.  

---

