Bend curve so that endpoint's tangent points towards a given coordinate Given a straight line of length L with start a (0,0), how do I find the bending angle $\theta$ and radius R that make it a circular segment whose endpoint's tangent points toward an arbitrary coordinate. Like this

 A: Since the arc has the same length as the line segment, then
$ L =  R \ \theta \hspace{25pt}(1)$
The end point of the arc is
$E = (R - R \cos \theta , R \sin \theta )$
The unit tangent vector at $E$ is
$T = \dfrac{1}{R} \dfrac{dE}{d \ \theta} = ( \sin \theta, \cos \theta ) $
Parametric equation of the tangent is
$ E + s T = (R - R \cos \theta, R \sin \theta ) + s (\sin \theta, \cos \theta )$
$(x, y)$ is on this tangent so
$(x, y) = (R - R \cos \theta + s \sin \theta , R \sin \theta  + s \cos \theta  )$
From which we get
$ s = \dfrac{( x - R + R \cos \theta  )}{  \sin \theta  } = \dfrac{(y - R \sin \theta  ) }{ \cos \theta } $
Cross-multiplying,
$(x \cos \theta  - R \cos \theta  + R \cos^2 \theta) = y \sin \theta - R \sin^2 \theta$
which reduces to
$x \cos \theta - y \sin \theta  - R \cos \theta  + R = 0\hspace{25pt}(2)$
Equations $(1),(2)$ are two non-linear equations in the two unknowns $\theta$ and $R$.
These two equations can be solved using the Newton-Raphson multivariate root finding algorithm which is described in this wiki page.
