C⃗ =A⃗ +r(B⃗ −A⃗ )||B⃗ −A⃗ ||
Where r
is the radius of the circle. Works for points both inside and outside the circle. Imagine (B⃗ −A⃗ )
to be a vector in the direction of B⃗
and (B⃗ −A⃗ )||B⃗ −A⃗ ||
thus is the same vector but with a length of 1
. By multiplying it with r
, you "walk in that direction" a total distance of r
, thus reaching the circle.
With coordinats A⃗ =(Ax,Ay)
etc. this reads
Cx=Ax+rBx−Ax(Bx−Ax)2+(By−Ay)2−−−−−−−−−−−−−−−−−−−−√
Cy=Ay+rBy−Ay(Bx−Ax)2+(By−Ay)2−−−−−−−−−−−−−−−−−−−−√
ooh boy... this will be fun