# Move point onto circle-outline in R3

I need to do all this in $\mathbb{R}^3$

• a plane by $n \cdot p = -k$
• a circle within this plane by radius = $r$ and center = $c$
• a point $a$ on the inside on the circle (on the plane)
• a direction $d$ orthogonal to $n$

Now I want to move $a$ onto the circle outline using $d$. I am not sure how to find the scalar $s$ needed to "hit" the outline of the circle with $o = a + sd$ where $o$ is the point on the outline.

I was thinking of the cosine law but then I don't know the wanted point on the circle outline.

Can someone help me? A closed form solution would be great. Thanks

Let $\theta$ be the angle between $a-c$ and $d$. Then by the law of cosines applied to triangle $aoc$ you get: $$s^2+2sl\cos\theta+l^2-r^2=0,$$ where $l$ is the distance between $a$ and $c$. From that you can readily compute $s$: $$s=\sqrt{r^2-l^2\sin^2\theta}-l\cos\theta.$$
• yes I can follow that myself now. Somehow I missed that I can use the $d$ for the angle. Thanks! Aug 7 '15 at 11:04
• although there is a sign mistake: I think it should be $s = \sqrt{ ... } + l \cos \theta$ Aug 7 '15 at 11:43
• It depends on which angle you choose as $\theta$ between the two formed by $d$ with line $ac$. Aug 7 '15 at 12:46