6
$\begingroup$

I'm wondering whether a rational Bézier curve could take exactly the same shape as a part of the sine function. The best way to check this seems like this:

  • Find a part of the sine function such that there is no symmetry anymore in this part, e.g. from $\sin(0)$ to $\sin({\pi \over 2})$.
  • In that case, the control points for a quadratic Bézier curve follow from the sine function. Because a Bézier curve is tangent to the control polygon at the first and last points, this results in the points $(0,0)$, $(1,1)$ and $({\pi \over 2}, 1)$. The second point $(1,1)$ is the intersection of the two tangent lines.

When plotting the above:

enter image description here

Which is pretty close, but I'm looking for an exact representation (if possible). Therefore, the next step is to look to a rational Bézier curve:

enter image description here

In this case I used the weights [1, 1.4, 1]. It is now a very close approximation for this part of the sine function, but it is not exact.

What would be a systematic way to do this? And if it fails for a quadratic rational Bézier curve, could it work for a cubic, quartic, quintic, ... curve?

I don't think it would be meaningful to look into Uniform Rational B-Splines (or Non-Uniform ones, NURBS) since they are just piecewise rational Bézier curves, right?

$\endgroup$
1

4 Answers 4

7
$\begingroup$

In a Bézier curve, $x$ and $y$ are polynomials in the parameter $t$. Note that you can't just have "a part of the sine function": if $y(t) = \sin(x(t))$ for $t$ in some interval, since both sides of that equation are analytic functions on the complex plane the equation would be true for all complex numbers $t$. Since $y(t)$ is a polynomial, for any given value of $y$ (unless $y$ is constant) there are only finitely many $t$ and thus finitely many $x$. But this is not the case for the sine function: $\sin(n \pi) = 0$ for all integers $n$. So the sine curve can't be given exactly by a Bézier curve of any degree.

$\endgroup$
7
  • $\begingroup$ @Robert: Thanks, but I'm talking about a part of the sine curve. Unless I'm overlooking something, your answer seems a little beside the point. $\endgroup$
    – Ailurus
    Commented Mar 4, 2012 at 19:02
  • $\begingroup$ @WimC: But we're talking about rational functions. I'm a little confused, since for example part a circle can be exactly represented by a rational Bézier curve. $\endgroup$
    – Ailurus
    Commented Mar 4, 2012 at 19:08
  • $\begingroup$ @Ailurus, I removed my first comment since the answer was updated. A circle does satisfy a polynomial relation, e.g. $x^2+y^2=1$ and so my argument didn't apply to that. $\endgroup$
    – WimC
    Commented Mar 4, 2012 at 19:11
  • $\begingroup$ @Robert: Could you please elaborate on the "both sides are analytic" part? I know that $sin(x)$ is analytic, and hence infinitely differentiable ($C^\infty$). But why does this mean that a part of the sine curve cannot be represented as a rational Bézier curve? $\endgroup$
    – Ailurus
    Commented Mar 4, 2012 at 19:35
  • 2
    $\begingroup$ If $x(t)$ and $y(t)$ are polynomials, $y(t) - \sin(x(t))$ is an analytic function on the whole complex plane. It is a theorem of complex analysis that if $f(z)$ is analytic on (open, connected) domain $D$ in the complex plane and $f(z) = 0$ on a line segment in $D$, then $f(z) = 0$ on all of $D$. $\endgroup$ Commented Mar 4, 2012 at 20:26
3
$\begingroup$

The answer to the question posted is that given a high enough order of rational bezier you can approximate $\sin(x)$ to within a given error, but I think the question that the author meant to ask was more along the lines of "how can a parametric quadratic bezier exactly describe a conic section but I can't get one to give me an exact $\sin$ approximation?"

The keyword here is "parametric". You can easily generate a parametric rational quadratic curve which exactly passes through all the points on a quarter of a circle: $$ arc(t) = \left \{(1-t^2)/(1+t^2),\, 2\,t\,/(1+t^2)\right \},\, t \in \left [0, 1 \right ] $$ The problem is that the variable t does not have to transcribe the arc at a constant angular rate for it to still make an exact arc, so the following is unfortunately true: $$ arc(t) \neq \left \{ \cos(t\: \pi/2),\, \sin(t\: \pi/2) \right \},\, t \in \left [0, 1 \right ] $$ As an example $arc(1/2) = \left \{ 0.6,\, 0.8 \right \}$ and indeed $\sqrt{1-0.6^2}=0.8$ so the point is on the unit circle, but clearly $\left \{ 0.6,\, 0.8 \right \} \neq \left \{ 1/\sqrt{2},\, 1/\sqrt{2} \right \}$

$\endgroup$
-1
$\begingroup$

Since a Bezier curve has only finitely many nonzero derivatives and a sine has infinitely many, they can not coincide on any interval in their domains containing more than one point.

$\endgroup$
1
  • $\begingroup$ The function $y=\sqrt{x}$ can be fitted exactly with a quadratic bezier curve, so this is not a valid argument. $\endgroup$
    – WimC
    Commented Mar 4, 2012 at 19:03
-1
$\begingroup$

I'm not sure if you have known the answer now...I'm working on NURBS these days, and I'm sure now the answer to your question is "YES", and the exact second-order Bezier expansion of sin(\theta) with \theta belongs to [0,pi/2] is: knot vector: [0,0,0,1,1,1]; weights: [1,sqrt(2)/2,1], and the expansion coefficients: [0,1,1]--> Note that these coefficients are actually the second coordinate components of the three control points for an exact represention of 90^0 planar unit arc. And note that a linear transformation between \theta and parameter coordinates should be mate. Similarly, the exact expansion of cos(\theta) with rational version of Bernstein basis can also be found. It is in my opinion that any part of any trigonometric function can be exactly expressed based on second-order rational Bernstein bases, not limited to the interval [0,pi/2], for their closely connection with the unit circle. You can see The NURBS book by Piegl and Tiller for a well description of Bezier curves and NURBS. Best wishes.

$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .