<p>Ken G's answer is essentially correct, but there is one important thing to keep in mind: The distance <span class="math-container">$r$</span> between the galaxies that is interesting for you is the distance they had at the time they emitted the light you see (you don't care about what has happened to them since that time and how far apart they are today; you care about the physical properties <em>then</em>). But the angle you observe them to span is not angle they spanned when they emitted the light (since they were closer to you in the past, so the light they emitted in your direction at that time would "miss" you by the time it reached that place).</p>

<p>This means that, in your calculation, the distance from you to the galaxies should not be the "physical" distance <span class="math-container">$d$</span> (i.e. the actual distance right now to the galaxies, which also corresponds to the <a href="https://en.wikipedia.org/wiki/Comoving_and_proper_distances#Comoving_distance_and_proper_distance" rel="nofollow noreferrer">comoving distance</a>), but the so-called <a href="https://en.wikipedia.org/wiki/Angular_diameter_distance" rel="nofollow noreferrer">angular diameter distance</a>, <span class="math-container">$d_A$</span>. These are related (in a flat universe) by
<span class="math-container">$$
d_A = \frac{d}{1+z},
$$</span>
where <span class="math-container">$z$</span> is the redshift of the galaxies (I assume they have almost the same redshift; if they are too different, then the distance from each other is not simply given by the projected distance). Note that in a non-flat universe, the formula is slightly more complicated; see the link above.</p>

<p>The comoving distance, in turn, is obtained by integration:
<span class="math-container">$$
d(z) = \frac{c}{H_0} \int_0^z \frac{dz'}{\left( \Omega_\mathrm{M}(1+z)^3 + \Omega_\Lambda \right)^{1/2}},
$$</span>
where <span class="math-container">$c$</span> is the speed of light, and <span class="math-container">$\Omega_\mathrm{M}$</span>, <span class="math-container">$\Omega_\Lambda$</span>, and <span class="math-container">$H_0$</span> are the present matter and dark energy density parameters and Hubble constant, respectively. Here, I've again assumed a flat universe, and neglected radiation since when that was important, there were no galaxies anyway).</p>

<p>Obviously, this effect is not big for small redshifts, but <span class="math-container">$d_A$</span> has the interesting property that it increases with physical distance only out to a certain point (roughly <span class="math-container">$z=1.6$</span>), <em>after which it decreases</em>, because the galaxies were closer to us in the past.</p>

<p>So the physical distance <span class="math-container">$r$</span> between two galaxies spanning an angle <span class="math-container">$\theta$</span> is
<span class="math-container">$$
r = \frac{\theta}{d_A}
$$</span>
or
<span class="math-container">$$
\boxed{
\frac{r}{\mathrm{kpc}} = \frac{\theta / \mathrm{arcsec}}{d / \mathrm{Mpc}} (1+z)
 \, \frac{10^{-3} \times 180\times3600}{\pi},
}
$$</span>
where the last factor accounts for converting Mpc to kpc and radians to arcseconds.</p>

<p>In Python, arbitrarily for <span class="math-container">$z=2.2$</span> and <span class="math-container">$\theta=12.3''$</span>,  it's as easy as</p>

<pre><code>from astropy.cosmology import Planck15
from astropy import units as u
z     = 2.2                               # redshift of galaxies
theta = 12.3 * u.arcsec                   # angle
r_ang = Planck15.kpc_proper_per_arcmin(z) # phys. dist. per angle
r     = r_ang * theta                     # physical distance
print('Distance between galaxies: ', r.to(u.kpc))
</code></pre>

<p>which will print <code>Distance between galaxies:  104.22540165050975 kpc</code>.</p>

CC BY-SA 4.0
2019-04-03T13:02:27.003Z
2019-04-03T13:02:27.003Z
pela
<p>Remember that an arcsecond is an angle, so imagine a pie wedge that extends out from your observatory, having that angle inside the point of the pie wedge.  That's all you can tell by looking at the sky, the angle in that pie wedge.    Also, notice that a field on the sky is not a line, it's more like a circle, so the pie wedge is really a cone with that angle in it.  But you don't know from just searching how far away anything is, so if you want to search on distance, then you have to go through and determine the distance to everything in that search angle.  </p>

<p>Let's say you center your search on a particular galaxy that you do know the distance to.  Now you have a search cone that has its point at your observatory, and the galaxy in question at its center some known distance away.  But within that angular search cone, you may see other objects at all kinds of distances.  There's no easy way to limit to things that have a similar distance as that galaxy, you get the whole cone unless you go through and find the distance to everything and throw out what you don't want.</p>

<p>If you want the galaxy density at nearly the same distance as that galaxy, then you will have to throw out things that are not nearly at the same distance.  Perhaps you have a lower and upper distance cutoff, so now you are searching a section from that cone, but it's not a sphere within some given distance from that galaxy, that shape would be much harder to figure out.  Still, the section I was talking about does have a volume, and you can count the galaxies within it, so that does give you a galaxy density around that galaxy.</p>

<p>To figure out that volume, you would need the linear distance across the cone at the distance to that galaxy.  That sounds like what you are asking about.  That is simple geometry, because the connection between angles and distances can be seen from the formula for the circumference of a circle.  The angle all the way around the center point of the circle is 2*Pi radians, and the circumference is 2*Pi*r, so that tells you that you take the angle in radians (you have to convert from arcsec) and multiply by the radius to get the length of the arc across from that angle.  That's not just true for 2*Pi radians, it's true for any smaller angle as well, as you know if you've ever sliced up a pizza.</p>

<p>So for your application, the r is the distance to the galaxy, and the angle (converted into radians) is the angle of your search field, and when you multiply them you get the length of the arc that crosses the cone we are talking about, at the distance to that galaxy.  That length is the key to figuring out the volume you are counting galaxies in, as the rest of its dimensions depend on what distances you are using to limit what you are counting within that field.</p>

CC BY-SA 4.0
2019-04-03T02:26:08.757Z
2019-04-03T02:26:08.757Z
Ken G
<p>I'm interested in the learning about the local densities around galaxies. I've found myself a bit confused on how to relate angular distances (arcseconds) with physical distances (parsecs) when thinking about distances between two distant galaxies. For example, let's say the average distance between galaxies within clusters is a few megaparsecs. If I had ra, dec coordinates of a particular galaxy and could hypothetically query an all-sky catalog, let's say I'd want to search within a few megaparsecs to get a feel for its density field. But generally when querying catalogs you specify a search radius in some arcseconds. How would these relate here? </p>

<distances><parsec>
How would I search within an angular distance of an object corresponding to a distance in parsecs?
curious_cosmo
# How would I search within an angular distance of an object corresponding to a distance in parsecs?

(Asked by: username_0 on 2019-04-02)

I'm interested in the learning about the local densities around galaxies. I've found myself a bit confused on how to relate angular distances (arcseconds) with physical distances (parsecs) when thinking about distances between two distant galaxies. For example, let's say the average distance between galaxies within clusters is a few megaparsecs. If I had ra, dec coordinates of a particular galaxy and could hypothetically query an all-sky catalog, let's say I'd want to search within a few megaparsecs to get a feel for its density field. But generally when querying catalogs you specify a search radius in some arcseconds. How would these relate here?

**Tags:** distances, parsec


---

## 2 answers

### Answer by username_1 on 2019-04-03. Score: 2 | Accepted answer

username_2's answer is essentially correct, but there is one important thing to keep in mind: The distance $r$ between the galaxies that is interesting for you is the distance they had at the time they emitted the light you see (you don't care about what has happened to them since that time and how far apart they are today; you care about the physical properties then). But the angle you observe them to span is not angle they spanned when they emitted the light (since they were closer to you in the past, so the light they emitted in your direction at that time would "miss" you by the time it reached that place).
This means that, in your calculation, the distance from you to the galaxies should not be the "physical" distance $d$ (i.e. the actual distance right now to the galaxies, which also corresponds to the comoving distance), but the so-called angular diameter distance, $d_A$. These are related (in a flat universe) by
$$
d_A = \frac{d}{1+z},
$$
where $z$ is the redshift of the galaxies (I assume they have almost the same redshift; if they are too different, then the distance from each other is not simply given by the projected distance). Note that in a non-flat universe, the formula is slightly more complicated; see the link above.
The comoving distance, in turn, is obtained by integration:
$$
d(z) = \frac{c}{H_0} \int_0^z \frac{dz'}{\left( \Omega_\mathrm{M}(1+z)^3 + \Omega_\Lambda \right)^{1/2}},
$$
where $c$ is the speed of light, and $\Omega_\mathrm{M}$, $\Omega_\Lambda$, and $H_0$ are the present matter and dark energy density parameters and Hubble constant, respectively. Here, I've again assumed a flat universe, and neglected radiation since when that was important, there were no galaxies anyway).
Obviously, this effect is not big for small redshifts, but $d_A$ has the interesting property that it increases with physical distance only out to a certain point (roughly $z=1.6$), after which it decreases, because the galaxies were closer to us in the past.
So the physical distance $r$ between two galaxies spanning an angle $\theta$ is
$$
r = \frac{\theta}{d_A}
$$
or
$$
\boxed{
\frac{r}{\mathrm{kpc}} = \frac{\theta / \mathrm{arcsec}}{d / \mathrm{Mpc}} (1+z)
 \, \frac{10^{-3} \times 180\times3600}{\pi},
}
$$
where the last factor accounts for converting Mpc to kpc and radians to arcseconds.
In Python, arbitrarily for $z=2.2$ and $\theta=12.3''$,  it's as easy as
from astropy.cosmology import Planck15
from astropy import units as u
z     = 2.2                               # redshift of galaxies
theta = 12.3 * u.arcsec                   # angle
r_ang = Planck15.kpc_proper_per_arcmin(z) # phys. dist. per angle
r     = r_ang * theta                     # physical distance
print('Distance between galaxies: ', r.to(u.kpc))

which will print Distance between galaxies:  104.22540165050975 kpc.


---

### Answer by username_2 on 2019-04-03. Score: 1

Remember that an arcsecond is an angle, so imagine a pie wedge that extends out from your observatory, having that angle inside the point of the pie wedge. That's all you can tell by looking at the sky, the angle in that pie wedge. Also, notice that a field on the sky is not a line, it's more like a circle, so the pie wedge is really a cone with that angle in it. But you don't know from just searching how far away anything is, so if you want to search on distance, then you have to go through and determine the distance to everything in that search angle.

Let's say you center your search on a particular galaxy that you do know the distance to. Now you have a search cone that has its point at your observatory, and the galaxy in question at its center some known distance away. But within that angular search cone, you may see other objects at all kinds of distances. There's no easy way to limit to things that have a similar distance as that galaxy, you get the whole cone unless you go through and find the distance to everything and throw out what you don't want.

If you want the galaxy density at nearly the same distance as that galaxy, then you will have to throw out things that are not nearly at the same distance. Perhaps you have a lower and upper distance cutoff, so now you are searching a section from that cone, but it's not a sphere within some given distance from that galaxy, that shape would be much harder to figure out. Still, the section I was talking about does have a volume, and you can count the galaxies within it, so that does give you a galaxy density around that galaxy.

To figure out that volume, you would need the linear distance across the cone at the distance to that galaxy. That sounds like what you are asking about. That is simple geometry, because the connection between angles and distances can be seen from the formula for the circumference of a circle. The angle all the way around the center point of the circle is 2\*Pi radians, and the circumference is 2\*Pi\*r, so that tells you that you take the angle in radians (you have to convert from arcsec) and multiply by the radius to get the length of the arc across from that angle. That's not just true for 2\*Pi radians, it's true for any smaller angle as well, as you know if you've ever sliced up a pizza.

So for your application, the r is the distance to the galaxy, and the angle (converted into radians) is the angle of your search field, and when you multiply them you get the length of the arc that crosses the cone we are talking about, at the distance to that galaxy. That length is the key to figuring out the volume you are counting galaxies in, as the rest of its dimensions depend on what distances you are using to limit what you are counting within that field.


---

