<p>A photograph of stars is essentially a
<a href="https://en.wikipedia.org/wiki/Gnomonic_projection" rel="nofollow">gnomonic projection</a>
of part of the
<a href="https://en.wikipedia.org/wiki/Celestial_sphere" rel="nofollow">celestial sphere</a>.
If $\vec P$ is computed for the photograph center (RA, Dec) in the same way as $\vec S$,
and the north celestial pole is
$\hat{\mathrm k} = (0, 0, 1)^{\mathrm T}$,
then the photograph has basis vectors perpendicular to $\vec P$ and each other,
$$\hat{\mathrm u} = \frac{\vec P \times \hat{\mathrm k}}{\| \vec P \times \hat{\mathrm k} \|},
\hat{\mathrm v} = \frac{\hat{\mathrm u} \times \vec P}{\| \hat{\mathrm u} \times \vec P \|}$$
and you can project $\vec S$ onto the photograph as
$$\left( \frac{\vec S \cdot \hat{\mathrm u}}{\vec S \cdot \vec P},
\frac{\vec S \cdot \hat{\mathrm v}}{\vec S \cdot \vec P} \right)$$
scaling as needed.</p>

CC BY-SA 3.0
2016-08-13T02:00:06.813Z
Thank you for your assistance! In my case, I am using vector P as (1, 1, 1) however im not sure if I should be doing this. Would k hat be apart of the vector P or is a seperate value on its own where I should be using its value as the center? Would you also be able to provide any links to where I might be able to learn more about this concept.
Continuum
CC BY-SA 3.0
2016-08-13T03:44:20.183Z
$\vec P$ depends on the region of interest, e.g. for the Big Dipper you might center the photo at RA 12 h, Dec +55 deg and use $\vec P$ = (-0.57, 0.0, 0.82). To make $\hat{\mathrm u}$ and $\hat{\mathrm v}$  point west and north in the photo, I used a cross product with [standard basis vector](https://en.wikipedia.org/wiki/Unit_vector) $\hat{\mathrm k}$ (aligned with +Z axis, north celestial pole).
Mike G
CC BY-SA 3.0
2016-08-13T04:03:57.370Z
so if I were to have kept my P vector as (1 , 1 , 1), this would have given me incorrect results for finding the coordinates of the stars in the big dipper?
Continuum
CC BY-SA 3.0
2016-08-13T04:55:33.300Z
You might still be able to plot them, but the constellation would be severely distorted.
Mike G
CC BY-SA 3.0
2016-08-13T01:47:06.250Z
2016-08-14T02:50:34.580Z
2016-08-14T02:50:34.580Z
Mike G
<p>I am currently running into some problems with plotting some stars locations in a Cartesian coordinate system.
The stars aren't in the right order and I'm not sure where I am going wrong.</p>

<p>I first use the equation (where S is a vector)</p>

<pre><code>S = [cos(ra)*cos(dec), sin(ra)*cos(dec), sin(dec)]
</code></pre>

<p>to obtain a vector S of the star.
I now want to obtain the x and y positions of the stars In terms of a 2d coordinate system so I use</p>

<pre><code>c * sx = S * px / S* pz
c * sy = S * py / S* pz
</code></pre>

<p>where C is the scale ratio of pixels to tangent of the angle of the camera and P is the vector center of the camera.(Im using this because I'm trying to find the distance between each pair of stars when a photo of the stars is taken by a camera)</p>

<pre><code>px = unit vector X
py = unit vector Y
pz = unit vector Z
</code></pre>

<p>and I solve for sx and sy. When I plot the stars location with sx and sy however I do not get the right locations of the stars. Any guidance?</p>

CC BY-SA 3.0
2016-08-13T08:18:35.057Z
S is a scalar in this example. Is the code correct?
James K
CC BY-SA 3.0
2016-08-13T09:53:27.983Z
could you please clarify what is a vector, scalar, dot product etc. in your writing? This is extremely confusing and inconsistent
AtmosphericPrisonEscape
CC BY-SA 3.0
2016-08-14T17:48:14.287Z
in this example S is a vector! My apologies I wasn't sure how to add the notations for vectors and dot products
Continuum
CC BY-SA 3.0
2016-08-14T18:36:59.110Z
This [MathJax tutorial](http://meta.math.stackexchange.com/questions/5020/mathjax-basic-tutorial-and-quick-reference) may help.If $\hat{\mathrm p}_z= \vec P$, then your $\hat{\mathrm p}_x$ and $\hat{\mathrm p}_y$ look like my $\hat{\mathrm u}$ and $\hat{\mathrm v}$.
Mike G
<star><coordinate>
plotting stars in cartessian coordinates using the stars ra and dec produces the wrong location of the stars
Continuum
# plotting stars in cartessian coordinates using the stars ra and dec produces the wrong location of the stars

(Asked by: username_0 on 2016-08-12)

I am currently running into some problems with plotting some stars locations in a Cartesian coordinate system.
The stars aren't in the right order and I'm not sure where I am going wrong.
I first use the equation (where S is a vector)
S = [cos(ra)*cos(dec), sin(ra)*cos(dec), sin(dec)]

to obtain a vector S of the star.
I now want to obtain the x and y positions of the stars In terms of a 2d coordinate system so I use
c * sx = S * px / S* pz
c * sy = S * py / S* pz

where C is the scale ratio of pixels to tangent of the angle of the camera and P is the vector center of the camera.(Im using this because I'm trying to find the distance between each pair of stars when a photo of the stars is taken by a camera)
px = unit vector X
py = unit vector Y
pz = unit vector Z

and I solve for sx and sy. When I plot the stars location with sx and sy however I do not get the right locations of the stars. Any guidance?

**Tags:** star, coordinate
> **Comments:**
> **username_1**: S is a scalar in this example. Is the code correct?  
> **username_2**: could you please clarify what is a vector, scalar, dot product etc. in your writing? This is extremely confusing and inconsistent  
> **username_0**: in this example S is a vector! My apologies I wasn't sure how to add the notations for vectors and dot products  
> **username_3**: This [MathJax tutorial](http://meta.math.stackexchange.com/questions/5020/mathjax-basic-tutorial-and-quick-reference) may help.If $\hat{\mathrm p}_z= \vec P$, then your $\hat{\mathrm p}_x$ and $\hat{\mathrm p}_y$ look like my $\hat{\mathrm u}$ and $\hat{\mathrm v}$.  

---

## 1 answers

### Answer by username_3 on 2016-08-13. Score: 1

A photograph of stars is essentially a
[gnomonic projection](https://en.wikipedia.org/wiki/Gnomonic_projection)
of part of the
[celestial sphere](https://en.wikipedia.org/wiki/Celestial_sphere).
If $\vec P$ is computed for the photograph center (RA, Dec) in the same way as $\vec S$,
and the north celestial pole is
$\hat{\mathrm k} = (0, 0, 1)^{\mathrm T}$,
then the photograph has basis vectors perpendicular to $\vec P$ and each other,
$$\hat{\mathrm u} = \frac{\vec P \times \hat{\mathrm k}}{\| \vec P \times \hat{\mathrm k} \|},
\hat{\mathrm v} = \frac{\hat{\mathrm u} \times \vec P}{\| \hat{\mathrm u} \times \vec P \|}$$
and you can project $\vec S$ onto the photograph as
$$\left( \frac{\vec S \cdot \hat{\mathrm u}}{\vec S \cdot \vec P},
\frac{\vec S \cdot \hat{\mathrm v}}{\vec S \cdot \vec P} \right)$$
scaling as needed.

> **Comments:**
> **username_0**: Thank you for your assistance! In my case, I am using vector P as (1, 1, 1) however im not sure if I should be doing this. Would k hat be apart of the vector P or is a seperate value on its own where I should be using its value as the center? Would you also be able to provide any links to where I might be able to learn more about this concept.  
> **username_3**: $\vec P$ depends on the region of interest, e.g. for the Big Dipper you might center the photo at RA 12 h, Dec +55 deg and use $\vec P$ = (-0.57, 0.0, 0.82). To make $\hat{\mathrm u}$ and $\hat{\mathrm v}$  point west and north in the photo, I used a cross product with [standard basis vector](https://en.wikipedia.org/wiki/Unit_vector) $\hat{\mathrm k}$ (aligned with +Z axis, north celestial pole).  
> **username_0**: so if I were to have kept my P vector as (1 , 1 , 1), this would have given me incorrect results for finding the coordinates of the stars in the big dipper?  
> **username_3**: You might still be able to plot them, but the constellation would be severely distorted.  

---

