I want to write an algorithm that morphs or transforms an arc of a circle to a straight line joining both ends of the arc. I would like to understand the maths behind this such a transformation. How can this be done?
Can an arc from a circle be made a straight line?
1.7k Views Asked by Bumbble Comm https://math.techqa.club/user/bumbble-comm/detail AtThere are 3 best solutions below
On
We can depict bending of circular arcs of increasing radius. The math is elementary trig. Angle subtended at arc center goes on increasing when arc bends more. It is straight for infinite radius of curvature ($R$, $r$) at beginning..
When arc starts with horizontal tangent, the tangential rotation, arc length and radius respectively are $(\phi, s,R) .$
$$ \phi = s/R$$
$$ \frac{dx}{ds}= \cos \phi,\, \frac{dy}{ds}= \sin \phi $$
integrate,
$$ x= x_0 + R \sin (s/R),\, y= y_0 + R (1-\cos (s/R))\, ; $$
that gives co-ordinates as a function of distance $s$ from fixed point $ (x_0,y_0), $ the fixity point for any radius R. It can be animated. If only the endpoint is desired, we let $s=L_{max}$.
Lmax = 100.;
ParametricPlot[{r Sin[L/r], r (1 - Cos[L/r])}, {r, 20, 100}, {L,
Lmax/10, Lmax}, Mesh -> {30, 20}, GridLines -> Automatic]
On
If $x(t)$ is a parametrization of your circle arc (see the other answers for how to find one), and $y(t)$ a parametrization of the straight line segment joining the endpoints of the arc, then
$$F_\lambda(t)=(1-\lambda)x(t)+\lambda y(t)$$
is the parametrizations for the circle arc when $\lambda=0$, the parametrization of the line segment when $\lambda=1$, and some intermediate form when $\lambda\in(0,1)$ is something in between. This technique is called linear interpolation and is one way (out of infinitely many) to achieve such a blend.
So draw $F_\lambda(t)$ for $\lambda=0$ and then slowly increase the value of $\lambda$ and repeatedly daw the resulting curve.

Here's one way to think about it.
An arc of a circle is defined by a radius $r$ of the circle and an angle $\phi$ which the arc subtends.
Let's assume your arc has radius $r_0$ and subtends angle $\phi_0$. Let's put the coordinates of the endpoints at $(r_0, 0)$ and $(\cos\phi_0, \sin\phi_0)$
Our goal will be to continuously shrink $\phi$ from $\phi_0$ to $0$ (and simultaneously let $r$ approach $\infty$), so that at each stage (other than the $\phi=0$ stage) we have an arc between the two endpoints subtending a smaller and smaller angle of a larger and larger circle, and in the limit we have a straight line.
Let $d$ be the distance between your two points. (This is determined by $r_0$ and $\phi_0$, but it will be convenient for it to have its own name.) If $\phi \neq 0,\pi$, we can draw an isosceles triangle with vertices the two endpoints and the center of the circle, so it has sides of length $r$, $r$, and $d$. We can draw a line from the circle center to the midpoint of the opposite side, splitting the isosceles triangle into two right triangles. The angle opposite the side of length $\frac{d}{2}$ is either $\frac{\phi}{2}$ or $\pi - \frac{\phi}{2}$, so $|\sin\frac{\phi}{2}| =\frac{\frac{d}{2}}{r}$. This relation must hold at every stage of the process. (When $\phi=\pi$, $d = 2r$, so the relation still holds.) Solving for $r$, we get $r = \frac{d}{2|\sin\frac{\phi}{2}|}$.
So we can continuously shrink $\phi$ from $\phi_0$ to $0$ and simultaneously let $r$ approach $\infty$ according to the formula $r = \frac{d}{2|\sin\frac{\phi}{2}|}$.