# Generate East and North unit vectors tangent to a point on the celestial sphere, using vectors?

I am stuck and a little embarrassed.

I'm trying to implement this answer. I have a unit vector $$w$$ pointing in the direction of a radio source on the celestial sphere.

$$u$$ and $$v$$ are the two other, mutually orthogonal unit vectors that point east and north from that point, tangent to the sphere.

Without back-converting to R.A. and Dec or using trigonometry, is there a simple way to generate $$u$$ and $$v$$ vectorially?

Slide 38 here may or may not be helpful, I think my description is sufficient by itself.

• How did you determine w? – Mike G Apr 11 '19 at 11:42
• @MikeG In my question, $w$ is a given. It can come from any source. If it comes from orbital mechanics, it's the normalized relative position vector $\mathbf{r}/|r|$, or it can come from an initial RA/Dec value that's been spun around the Earth's axis for 24 hours like I did here when I built SgrA_star (which is what would be $w$), or it can be from somewhere else entirely. From any given $w$ I'm asking how to get $u$ and $v$ without going back to trigonometry. Can it be done using just vectors somehow? – uhoh Apr 11 '19 at 11:49

If $$\mathbf{\hat{n}}$$ points to the north celestial pole, then the eastward tangent vector is
$$\mathbf{\hat{u} = \frac{\hat{n} \times \hat{w}}{\|\hat{n} \times \hat{w}\|}}$$
$$\mathbf{\hat{v} = \frac{\hat{w} \times \hat{u}}{\|\hat{w} \times \hat{u}\|}}$$
$$\mathbf{\|\hat{w} \times \hat{u}\|}$$ analytically should be 1 but can be slightly different numerically.