# Calculate 3d point on sphere's surface given a cone inside it

I have a sphere with its center at $(0,0,0)$ and 2 vectors $\vec a$ and $\vec b$ and both of them have a length of spheres radius

$\Vert \vec a \Vert = \Vert \vec b \Vert =R$

Angle between these vectors ($\alpha$) is also known.

If $\vec a$ circles around the $\vec b$ keeping the angle $\alpha$ unchanged we are kind of getting a cone inside the sphere like in this picture.

How can I calculate the coordinates of $\vec a$ if it would rotate $\beta$ degrees around the $\vec b$ ?

• there exists a separate rotation matrix for this purpose in linear algebra. – tp1 Jun 19 '17 at 19:49

To make thinks simpler lets assume that this is a unit sphere.

$p = (a\cdot b) b$ is the projection of $a$ onto $b$

$v = a - (a\cdot b) b$ is orthogonal to $b$

$p+v = a$

$u = b\times a$ is orthogonal to both $v$ and $b$

$\|u\| = \|v\|$

the circle: $p+v\cos t + u\sin t$

• Thanks for the answer man, can you explain what (a * b) b means? First part looks like a dot product? – etrusks Jun 19 '17 at 20:39
• $a\cdot b$ is the Euclidean inner (dot) product. $(a\cdot b)b$ is the vector $b$ scaled by $(a\cdot b).$ $a\times b$ is the vector (or cross) product. – Doug M Jun 19 '17 at 20:40
• Last equation represents resulting vector to the circle and t is same as my $\beta$? – etrusks Jun 19 '17 at 20:47
• Thanks a lot man, I tested it out and it gives me nice results :) Very much appreciated :) – etrusks Jun 19 '17 at 20:59