<p>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 <span class="math-container">$RA=RA_p\pm d$</span> (points 1 and 3) and the declination would be <span class="math-container">$Dec=Dec_p \pm d$</span> (points 2 and 4) where d is the radius of the circle.
<a href="https://i.sstatic.net/OqdDZ.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/OqdDZ.png" alt="rectangular coordinate system"></a></p>

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

<p><span class="math-container">$$\cos(d) = \sin(Dec_i)\sin(Dec_j) + \cos(Dec_i)\cos(Dec_j)\cos(RA_i - RA_j)$$</span></p>

<p><a href="https://i.sstatic.net/8alBn.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/8alBn.png" alt="spherical coordinates used in the sky"></a></p>

<p>For points 1 and 3 on the circle, <span class="math-container">$Dec_i=Dec_j=Dec_p$</span> in the above equation, and you can solve for the difference in right ascension <span class="math-container">$RA_i - RA_j$</span> to be added to or subtracted from <span class="math-container">$RA_p$</span>. For points 2 and 4, <span class="math-container">$RA_i=RA_j=RA_p$</span> and the above equation simplifies to <span class="math-container">$Dec=Dec_p \pm d$</span>. 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. </p>

CC BY-SA 4.0
2019-02-09T23:26:06.450Z
2019-02-09T23:26:06.450Z
JohnHoltz
<p><a href="https://i.sstatic.net/rkyz1.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/rkyz1.png" alt="enter image description here"></a></p>

<p>Imagine that you are at 80 degrees north and 0 degrees east (on the <a href="https://en.wikipedia.org/wiki/Prime_meridian" rel="nofollow noreferrer">Prime Meridian</a>).  </p>

<p>It is only 10 latitude degrees from you to the north pole.  </p>

<p>Notice that the distance from you to the 45th meridian (shown in green) is about 7 latitude degrees (<span class="math-container">$\sin{\pi/4}\cdot 10$</span>) because if you walked to the closest point on the 45th meridian, the north pole would be directly to your left and the three points 1) the closest point on the 45th meridian, 2) the north pole, and 3) 80 degrees north on the prime meridian almost form an isosceles 45-45-90 triangle. </p>

<p>If you draw a circle around the position (80 North, 0 East) with radius of 7 latitude degrees, the maximum latitude would be 87, the minimum latitude would be 73, the maximum longitude would be about 45 degrees east, and the minimum longitude would be about -45 degrees (45 degrees west).  </p>

<p>Also, the point on the 45th meridian closest to your starting position (80N 0E) would have a latitude of about 83 degrees, not 80 degrees.  </p>

<p>The example above illustrates that the spacing between longitude lines gets closer near the poles.  </p>

<p>In general, if you are at the position (<span class="math-container">$\delta$</span> north, <span class="math-container">$\alpha$</span> east) and you draw a circle around yourself with "radius" <span class="math-container">$\rho$</span>, then the min/max latitude/longitude of the enclosed points would be <span class="math-container">$\delta-\rho$</span>, <span class="math-container">$\delta+\rho$</span>, <span class="math-container">$\alpha - \gamma$</span>, <span class="math-container">$\alpha + \gamma$</span> where
<span class="math-container">$$
\gamma = \mathrm{arcsin}\left(\frac{\sin\rho}{\cos\delta}\right).
$$</span>
(where <span class="math-container">$\rho$</span> is the angle between you and the edge of the circle as seen from the center of the Earth).
Notice that </p>

<ul>
<li>if <span class="math-container">$\delta=0$</span>, then <span class="math-container">$\gamma=\rho$</span>,</li>
<li><span class="math-container">$\gamma\geq\rho$</span>, </li>
<li>if <span class="math-container">$\pi/2-|\delta|=\rho$</span>, then <span class="math-container">$\sin\rho=\cos\delta$</span> and <span class="math-container">$\gamma=\mathrm{arcsin}(1)=\pi/2$</span>, and</li>
<li>if <span class="math-container">$\pi/2-|\delta|&lt;\rho$</span>, then there is no solution for <span class="math-container">$\gamma$</span> because a pole is enclosed by the circle.  </li>
</ul>

<p>The formula can be derived from dot products between your position vector and the vector perpendicular to the either extreme meridian.  I need to do a lot of visualization and to fix several false starts to get it right.</p>

<p>For the original example of a circle around 80N 0E with radius 7 degrees, the formula yields 
<span class="math-container">$$
\gamma = \mathrm{arcsin}( \sin(7\pi/180)/\cos( 80\pi/180))\cdot180/\pi = 44.573 \mathrm{\ degrees}
$$</span> 
which is close to the estimated 45 degrees.  </p>

CC BY-SA 4.0
2019-02-11T00:28:46.723Z
2019-02-11T00:38:13.947Z
2019-02-11T00:38:13.947Z
irchans
<p>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. </p>

CC BY-SA 4.0
2019-02-04T22:52:57.253Z
Could you give more detail of what you are trying to do and why.  I have read your question several times, and I cannot understand what you are trying to do.  As an aside, you can't just add radius (a length) to Ra/dec (an angle and hence dimensionless).
Dr Chuck
CC BY-SA 4.0
2019-02-06T06:04:19.933Z
I think Ronan's question can be interpreted as follows.  Let the unit sphere be parametrized by $(\cos\alpha \cos\delta, \sin\alpha \cos\delta, \sin\delta)$.  For a given point $p$ on the sphere with coordinates $(\alpha_p,\delta_p)$ and a distance $d$ what are the maximum and minimum values of $\alpha$ and $\delta$ among all points on the sphere within $d$ units of $p$.  (Assuming $2 \sin\theta = d$, the maximum $\alpha$ is $\min(\delta_p + 2\theta, \pi/2)$, the minimum $\alpha$ is $\max(\delta_p - 2\theta, -\pi/2)$.  Finding the minimum and maximum $\alpha$ is harder.)  ("radius"=$2\theta$)
irchans
CC BY-SA 4.0
2019-02-09T22:43:48.240Z
@irchans. I think you intended to write that the max declination $\delta$ is $\min(\delta_p + 2\theta, \pi/2)$ instead of the maximum right ascension $\alpha$. Likewise for the minimum declination.
JohnHoltz
CC BY-SA 4.0
2019-02-10T22:42:47.637Z
@JohnHoltz   Yes, of course, you are right !
irchans
<python>
How to convert celestial Coordinates with a radius, to max and min celestial coordinates?
Ronan Phillips Johns
# How to convert celestial Coordinates with a radius, to max and min celestial coordinates?

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

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.

**Tags:** python
> **Comments:**
> **username_1**: Could you give more detail of what you are trying to do and why.  I have read your question several times, and I cannot understand what you are trying to do.  As an aside, you can't just add radius (a length) to Ra/dec (an angle and hence dimensionless).  
> **username_2**: I think Ronan's question can be interpreted as follows.  Let the unit sphere be parametrized by $(\cos\alpha \cos\delta, \sin\alpha \cos\delta, \sin\delta)$.  For a given point $p$ on the sphere with coordinates $(\alpha_p,\delta_p)$ and a distance $d$ what are the maximum and minimum values of $\alpha$ and $\delta$ among all points on the sphere within $d$ units of $p$.  (Assuming $2 \sin\theta = d$, the maximum $\alpha$ is $\min(\delta_p + 2\theta, \pi/2)$, the minimum $\alpha$ is $\max(\delta_p - 2\theta, -\pi/2)$.  Finding the minimum and maximum $\alpha$ is harder.)  ("radius"=$2\theta$)  
> **username_3**: @irchans. I think you intended to write that the max declination $\delta$ is $\min(\delta_p + 2\theta, \pi/2)$ instead of the maximum right ascension $\alpha$. Likewise for the minimum declination.  
> **username_2**: @JohnHoltz   Yes, of course, you are right !  

---

## 2 answers

### Answer by username_3 on 2019-02-09. Score: 3

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.
[![rectangular coordinate system](https://i.sstatic.net/OqdDZ.png)](https://i.sstatic.net/OqdDZ.png)

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)$$

[![spherical coordinates used in the sky](https://i.sstatic.net/8alBn.png)](https://i.sstatic.net/8alBn.png)

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.


---

### Answer by username_2 on 2019-02-11. Score: 2

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

Imagine that you are at 80 degrees north and 0 degrees east (on the [Prime Meridian](https://en.wikipedia.org/wiki/Prime_meridian)).

It is only 10 latitude degrees from you to the north pole.

Notice that the distance from you to the 45th meridian (shown in green) is about 7 latitude degrees ($\sin{\pi/4}\cdot 10$) because if you walked to the closest point on the 45th meridian, the north pole would be directly to your left and the three points 1) the closest point on the 45th meridian, 2) the north pole, and 3) 80 degrees north on the prime meridian almost form an isosceles 45-45-90 triangle.

If you draw a circle around the position (80 North, 0 East) with radius of 7 latitude degrees, the maximum latitude would be 87, the minimum latitude would be 73, the maximum longitude would be about 45 degrees east, and the minimum longitude would be about -45 degrees (45 degrees west).

Also, the point on the 45th meridian closest to your starting position (80N 0E) would have a latitude of about 83 degrees, not 80 degrees.

The example above illustrates that the spacing between longitude lines gets closer near the poles.

In general, if you are at the position ($\delta$ north, $\alpha$ east) and you draw a circle around yourself with "radius" $\rho$, then the min/max latitude/longitude of the enclosed points would be $\delta-\rho$, $\delta+\rho$, $\alpha - \gamma$, $\alpha + \gamma$ where
$$
\gamma = \mathrm{arcsin}\left(\frac{\sin\rho}{\cos\delta}\right).
$$
(where $\rho$ is the angle between you and the edge of the circle as seen from the center of the Earth).
Notice that

* if $\delta=0$, then $\gamma=\rho$,
* $\gamma\geq\rho$,
* if $\pi/2-|\delta|=\rho$, then $\sin\rho=\cos\delta$ and $\gamma=\mathrm{arcsin}(1)=\pi/2$, and
* if $\pi/2-|\delta|<\rho$, then there is no solution for $\gamma$ because a pole is enclosed by the circle.

The formula can be derived from dot products between your position vector and the vector perpendicular to the either extreme meridian. I need to do a lot of visualization and to fix several false starts to get it right.

For the original example of a circle around 80N 0E with radius 7 degrees, the formula yields
$$
\gamma = \mathrm{arcsin}( \sin(7\pi/180)/\cos( 80\pi/180))\cdot180/\pi = 44.573 \mathrm{\ degrees}
$$
which is close to the estimated 45 degrees.


---

