# Converting equatorial coordinates to Cartesian coordinates for extragalactic distances

I'm trying to search for galaxy clusters with the friends-of-friends (FoF) algorithm. I have the equatorial coordinates ($$\alpha, \delta$$) and redshifts ($$0.5) of galaxies that I wish to convert to Cartesian coordinates, with the following:

$$X = R\cdot \cos(\delta)\cos(\alpha) \\ Y = R\cdot \cos(\delta)\sin(\alpha) \\ Z = R\cdot \sin(\delta)$$

The problem I'm having is deciding the correct $$R$$ to use: should it be comoving distance, angular diameter distance or luminosity distance, given that I only have redshifts to work with? How do we determine the best LOS distance measure to use for this case? Is there a better way to do this?

For example, in astropy, their default Distance quantity computes the distance from redshift (and a given cosmology) using luminosity distance.

### References

• Welcome to astronomy SE! I fixed a bit of typesetting and allowed to add a reference for the FOF algorithm, feel free to adjust that. Feb 19, 2021 at 11:44

## 1 Answer

I find this discussion of cosmological distances by David Hogg to be very useful in answering questions like this. In Section 4 he says:

The line-of-sight comoving distance between two nearby events (ie, close in redshift or distance) is the distance which we would measure locally between the events today if those two points were locked into the Hubble flow. It is the correct distance measure for measuring aspects of large-scale structure imprinted on the Hubble flow, eg, distances between “walls.”

That would suggest to me that it’s the distance measure you want for your problem, but I encourage you to read further in that article to be sure.

• Hi, thanks for the article. Comoving distance seems like an appropriate choice if I consider all the galaxies in the same cluster to have an approximate average redshift and comoving distance. However, the results of my code seem to be not right, given that the galaxies appear stretched out in one direction in the cluster. I don't think this is the right place to troubleshoot this though. Thanks nevertheless! Feb 21, 2021 at 13:52