How to convert celestial Coordinates with a radius, to max and min celestial coordinates? I am writing a piece of python code to convert right ascension and declination with a given radius to minimum and maximum right ascension and declination. I firstly can't understand why the min and max is not always just the given coordinates +- the radius, and secondly how I would write a piece of code to make this conversion. Cheers.
If you were working with a rectangular coordinate system as shown in the figure below (that also had no bounds), then it is correct that the right ascension would be $RA=RA_p\pm d$ (points 1 and 3) and the declination would be $Dec=Dec_p \pm d$ (points 2 and 4) where d is the radius of the circle.


The sky is spherical, so the lines of RA are not a constant separation. (It also has limits such as declination less than $\pm 90$.) Therefore you need to use an equation for spherical trigonometry. The angle d between two points i and j is

$$\cos(d) = \sin(Dec_i)\sin(Dec_j) + \cos(Dec_i)\cos(Dec_j)\cos(RA_i - RA_j)$$



For points 1 and 3 on the circle, $Dec_i=Dec_j=Dec_p$ in the above equation, and you can solve for the difference in right ascension $RA_i - RA_j$ to be added to or subtracted from $RA_p$. For points 2 and 4, $RA_i=RA_j=RA_p$ and the above equation simplifies to $Dec=Dec_p \pm d$. Of course, keep in mind that declination is between -90 and +90. For any other point on the circle, you can assume either an RA or Dec (within the bounds of the above 4 points) and solve for the other unknown.