1

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.

liorda
  • 123

1 Answers1

1

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'} $$

lemon
  • 3,548
  • How didn't I see that? Thanks! – liorda Aug 25 '14 at 13:18
  • @liorda By the way, if you decrease $t$ linearly then the circle will get larger at an ever decreasing rate which probably isn't what you want. Whereas if you decrement $t$ by a value that scales inversely with $\phi$ then you should get a more uniform transition. – lemon Aug 25 '14 at 13:30
  • Thanks, that's a good idea. – liorda Aug 25 '14 at 14:01