How to make an angle smooth

473 Views Asked by At

Suppose we are given in $R^2$ an angle ACB and a circle centered at C, like the following picture shows.enter image description here

How can we "draw" a $C^1$ curve containing the segments outside of the circle and the part AB would be inside the circle and angle at the same time?

3

There are 3 best solutions below

3
On BEST ANSWER

You can easily solve for a quadratic polynomial that will make this $C^1$ (or, indeed, a quartic polynomial that will make it $C^2$). Just take $y=f(x)=ax^2+bx+c$, set $f(\pm x_0)=0$ and $f'(\pm x_0) = \mp m$. You have to specify $x_0$ and $m$ appropriately to make sure the curve stays below $C$. (Here I'm taking the $x$-coordinate of $C$ to be $0$ and the $x$-coordinates of $A$ and $B$ to be $\pm x_0$ respectively.)

2
On

You already have slopes and values of the desired curve at A and B. Pick a point P inside the circle and below C.

Find a fourth degree polynomials with the given information and you are done.

2
On

I present to you: the Bézier Curve.

We parameterize the curve with a time value $t$ that varies from $0$ to $1$. Then, to find a point on the curve, we generate points: $$D_t = (1-t)A+tC$$ $$E_t = (1-t)C+tB$$ $$F_t = (1-t)D_t+tE_t$$

The locus of $F_t$ as we vary $t$ is then our curve.

Here's one Bézier curve, drawn with 16 segments.

A Bézier curve

If you want more control, you can switch to rational Bézier curves, which work approximately the same way, but include a weight with each control point. Then we have, with weights $a$, $b$, and $c$ corresponding to the three control points above: $d_t = (1-t)a + tc$, etc, mirroring the control equations from before. Then our final points on the curve are $$F^*_t = \frac{F_t}{f_t}$$ This is equivalent to placing our control points in homogeneous coordinates with varying $w$ values. In all cases with non-zero weights, the resulting curves are tangent to the lines between the control points at the ends. There is a weight value that makes the curve a circular arc, equal to the sine of half the angle at the center.

Here's a series of rational Bézier curves, with endpoint weights $1$ and center control point weight varying from $0.1$ to $10$.

Animation of a rational Bézier curve