Find point on a sphere given two angles

3.4k Views Asked by At

I have a direction represented as two angles x (angle around x axis), and y (angle around y axis). A ray from the origin moving in this direction will intersect a sphere with a radius of 1 that is centered at the origin at some coordinates. How can I find these coordinates? I would prefer a solution that doesn't require rotation matrices.

2

There are 2 best solutions below

0
On BEST ANSWER

Assuming you are starting at $(0,0,1)$ since that seems to make the most sense for an $x$-$y$ rotation.

If you rotate about the $x$-axis by some angle $\theta_x$, then you've rotated your point from $(0, 0,1)$ to $$ (0 , \cos(\theta_x) , \sin(\theta_x) ) $$ and if you follow that by a rotation of $\theta_y$ about $y$-axis then you have $$ (\sin(\theta_x) \cdot \sin(\theta_y), \cos(\theta_x), \sin(\theta_x) \cos(\theta_y) ) $$

7
On

if $\theta$ is the angle around the $x$ axis and $\phi$ is the angle around the $y$ axis.

Suppose $(x,y,z)$ is the point on the unit sphere.

$(x,y,z)\cdot (1,0,0) = x = \cos \theta\\ (x,y,z)\cdot (0,1,0) = y = \cos \phi\\ z = \sqrt{1-\cos^2\theta - \cos^2\phi}$