Parameterizating a function generator

62 Views Asked by At

I'm trying to program a morph animation between a quarter of a circle (an arc) and a straight line, while keeping the length constant. In other words, I need to program a "function generator" $f(t), t=0..1$ so that $f(t)=y(x)$ for the given interpolation/morph paramter such that $f(0)=0$ (straight line) and $f(1)=R-\sqrt{(2R)^2-x^2}$ (quarter of a circle).

enter image description hereenter image description here

I know the constant line's length is $\pi R\over2$

My thinking is to find a new radius $R'$ and segment $\phi$ so that $f(t)=f(R',\phi)$. Let's say $R'={R\over t}$. for $t=1$ we'll get the original arc, and for $t\to0$ we'll get $y(x)=0$. Now I need to find $\phi$:

$$ {\int _0 ^\phi \sqrt{(2R)^2-y^2}dy}={{\pi \over 2} R} $$

I don't know how to solve this. And I'm not sure I'm on the right track to solving this algorithm. Any help will be greatly appreciated.

1

There are 1 best solutions below

3
On BEST ANSWER

For a radius $R'$ the arc length subtended by $\phi$ is simply $R'\phi$. This should equal $\pi R/2$, and so

$$ \phi=\frac{\pi}{2}\frac{R}{R'} $$