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. $$