I have the following 2D geometry question from a camera positioning problem:
Point $P1$ (parent) can only be on a circle about the origin with given radius $R$. Point $P2$ (child)'s position is calculated by moving (given) $d_r$ distance from parent in a direction outwards from the origin and (given) distance $d_t$ tangent to the circle at the position $P1$ is at.
The question is, given any point in the Cartesian plane, say $P3$, where should I place $P1$ along the circle such that the line drawn between $P3$ and $P2$ is parallel to the line between the origin and $P1$?
Below is a picture that should help hopefully!

If $\theta=\angle P_1OP_3$ then $OP_3\sin\theta$ is the distance between $P_3$ and line $OP_1$, and $d_t$ is the distance between $P_2$ and line $OP_1$. If $P_2P_3$ is parallel to $OP_1$ then those distances are equal, so that: $$ \sin\theta={d_t\over OP_3}. $$ Of course there are two possible choices for $\theta$, depending on $\angle P_1OP_3$ being acute or obtuse. The right choice must take into account the direction of $d_t$. If $d_t$ is drawn counterclockwise (as in the diagram above), then the obtuse solution must be taken.