EDIT: Solved by sidneyc on reddit and it looks pretty neat: solution
Please see this figure of a circle and tangent
Given:
- points A(xA,yA) and B(xB,yB) on a tangent to a circle in point A
- point C(xC,yC) on the same circle
What are the coordinates of point D(xD,yD) located at distance=n/m (in the example above 2/3) between A and C in the direction the arrow BA is pointing to?
I need xD and yD as function of known values (xA, yA, xB, yB, xC, yC, n, m)
Thank you
WLOG, we can let the circle (of radius $= R$) be centered at $O(0, 0)$. From your drawing, I am assuming $C$ is on the x-axis.
1) From $B$ and $A$, get its slope and hence $\alpha$.
2) From $C$ and $A$, get $\beta$.
3) $\gamma = \gamma_2 = \gamma_1 = \beta - \alpha$
4) $\angle AOC = 2 \gamma$
5) $\angle COD = \theta = …$ as shown.
6) $X = R \cos \theta$ and $Y = R \sin \theta$ (with sign adjustment).