<p>My eventual solution was to rotate the image using the <a href="https://en.wikipedia.org/wiki/Rotation_matrix" rel="nofollow noreferrer">2D rotation matrix</a>, then deproject by accounting for the inclination. In Python, this looks like:</p>
<pre><code>def sky_to_disk(x, y, inc, PA):

    # Rotate (x, y) by PA (deg)
    x_rot = x * np.cos(np.radians(PA)) + y * np.sin(np.radians(PA))
    y_rot = - x * np.sin(np.radians(PA)) + y * np.cos(np.radians(PA))

    # Deproject (x_rot, y_rot) by inc (deg)
    x_d, y_d  = x_rot, y_rot / np.cos(np.radians(inc))

    return x_d, y_d
</code></pre>

CC BY-SA 4.0
2022-05-23T19:25:16.693Z
In stack exchange we try to think as much about future readers as possible and much less about who gets the "credit" or reputation points. So if there's an answer post that best answers the question we usually accept it no matter who the author is. That way when the question shows up in future searches folks will see that there's an accepted answer and which one it is, and *search engines* will see that acceptance as well.
uhoh
CC BY-SA 4.0
2022-05-24T10:40:28.667Z
Okay thanks, I have accepted my own answer incase it may help others in the future
lucas
CC BY-SA 4.0
2022-04-30T17:08:30.487Z
When you add a solution to your own question you should identify it as the right answer so you'll get the credit.
stretch
CC BY-SA 4.0
2022-05-02T21:50:12.243Z
@stretch disagree about "getting credit" or there being a specific "should" at all. Accepting a particular answer or no answer at all is completely up to the OP and there are several considerations they may evaluate before choosing a corse of action. It is helpful to the site and to future readers if we eventually choose a best answer to accept, but that's strictly up to the OP to decide.
uhoh
CC BY-SA 4.0
2022-05-03T02:02:18.403Z
I didn't know that someone else could decide which answer is best. Who is it that makes the decision?
stretch
CC BY-SA 4.0
2022-04-30T13:22:56.027Z
2022-04-30T13:22:56.027Z
lucas
<p>@Greg Miller's point is that the rotation angle doesn't count. The only measurement you care about is the inclination. It makes a point's arc distance from the major axis of the apparent ellipse cos(43) times the distance you'd see if the protoplanet was not inclined. Take the square root of the sum of the squares of its arc distance from the minor axis and its corrected distance from the major axis and you'll have the &quot;deprojected&quot; distance.</p>
<p>BTW, unless your object is very near the celestial equator you won't have the same scale for your axes. It's just a labeling problem though: you can't say your X axis is right ascension.</p>

CC BY-SA 4.0
2022-04-30T13:23:58.457Z
Thanks, yes you're right, I think I thought the problem was more complicated than it actually was. I've posted my solution in case it's helpful to anyone.
lucas
CC BY-SA 4.0
2022-04-29T20:59:34.400Z
2022-04-29T20:59:34.400Z
stretch
<p>I have an image of a protoplanetary disk, from which I would like to measure the distance of various points from the centre. See below image for an example, where I would like to measure the distance between the green x's.</p>
<p>It is straightforward to measure the distances as projected on the sky, since I know the distance to the disk (110pc), and the angular separation in arcsecs.</p>
<p>However, the disk is inclined (i=43<span class="math-container">$^\text{o}$</span>) and rotated by a position angle (PA=146<span class="math-container">$^\text{o}$</span>). I would like to know how to calculate the <em>deprojected</em> distance between two points.</p>
<p><a href="https://i.sstatic.net/THzc2.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/THzc2.png" alt="enter image description here" /></a></p>

CC BY-SA 4.0
2022-04-29T15:13:39.767Z
It can be done in one rotation, just rotate to make the incline 90 degrees.
Greg Miller
CC BY-SA 4.0
2022-04-29T17:07:02.663Z
I'm not able to adjust the inclination/position angle myself, these are just inferred quantities from the ALMA observation. I'm just looking to find a way to take the separation between points as measured in the image, and deproject to the 'true' separation, based on the inferred inclination and PA.
lucas
CC BY-SA 4.0
2022-04-29T19:28:26.220Z
different but potentially related: [What (actually) is the " deprojected half-light radius" of this almost-all-dark-matter Galaxy?](https://astronomy.stackexchange.com/q/18074/7982)
uhoh
<coordinate><mathematics><modeling><proto-planetary-disk>
Measure the deprojected distance between two points?
lucas
# Measure the deprojected distance between two points?

(Asked by: username_0 on 2022-04-29)

I have an image of a protoplanetary disk, from which I would like to measure the distance of various points from the centre. See below image for an example, where I would like to measure the distance between the green x's.

It is straightforward to measure the distances as projected on the sky, since I know the distance to the disk (110pc), and the angular separation in arcsecs.

However, the disk is inclined (i=43$^\text{o}$) and rotated by a position angle (PA=146$^\text{o}$). I would like to know how to calculate the *deprojected* distance between two points.

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

**Tags:** coordinate, mathematics, modeling, proto-planetary-disk
> **Comments:**
> **username_1**: It can be done in one rotation, just rotate to make the incline 90 degrees.  
> **username_0**: I'm not able to adjust the inclination/position angle myself, these are just inferred quantities from the ALMA observation. I'm just looking to find a way to take the separation between points as measured in the image, and deproject to the 'true' separation, based on the inferred inclination and PA.  
> **username_2**: different but potentially related: [What (actually) is the " deprojected half-light radius" of this almost-all-dark-matter Galaxy?](https://astronomy.stackexchange.com/q/18074/7982)  

---

## 2 answers

### Answer by username_0 on 2022-04-30. Score: 1 | Accepted answer

My eventual solution was to rotate the image using the 2D rotation matrix, then deproject by accounting for the inclination. In Python, this looks like:
def sky_to_disk(x, y, inc, PA):

    # Rotate (x, y) by PA (deg)
    x_rot = x * np.cos(np.radians(PA)) + y * np.sin(np.radians(PA))
    y_rot = - x * np.sin(np.radians(PA)) + y * np.cos(np.radians(PA))

    # Deproject (x_rot, y_rot) by inc (deg)
    x_d, y_d  = x_rot, y_rot / np.cos(np.radians(inc))

    return x_d, y_d

> **Comments:**
> **username_3**: When you add a solution to your own question you should identify it as the right answer so you'll get the credit.  
> **username_2**: @stretch disagree about "getting credit" or there being a specific "should" at all. Accepting a particular answer or no answer at all is completely up to the OP and there are several considerations they may evaluate before choosing a corse of action. It is helpful to the site and to future readers if we eventually choose a best answer to accept, but that's strictly up to the OP to decide.  
> **username_3**: I didn't know that someone else could decide which answer is best. Who is it that makes the decision?  
> **username_2**: In stack exchange we try to think as much about future readers as possible and much less about who gets the "credit" or reputation points. So if there's an answer post that best answers the question we usually accept it no matter who the author is. That way when the question shows up in future searches folks will see that there's an accepted answer and which one it is, and *search engines* will see that acceptance as well.  
> **username_0**: Okay thanks, I have accepted my own answer incase it may help others in the future  

---

### Answer by username_3 on 2022-04-29. Score: 3

@Greg Miller's point is that the rotation angle doesn't count. The only measurement you care about is the inclination. It makes a point's arc distance from the major axis of the apparent ellipse cos(43) times the distance you'd see if the protoplanet was not inclined. Take the square root of the sum of the squares of its arc distance from the minor axis and its corrected distance from the major axis and you'll have the "deprojected" distance.

BTW, unless your object is very near the celestial equator you won't have the same scale for your axes. It's just a labeling problem though: you can't say your X axis is right ascension.

> **Comments:**
> **username_0**: Thanks, yes you're right, I think I thought the problem was more complicated than it actually was. I've posted my solution in case it's helpful to anyone.  

---

