# 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