Hermite/quadratic bezier curve vs (sin and cos)

  • Context: Graduate 
  • Thread starter Thread starter arpace
  • Start date Start date
  • Tags Tags
    Cos Curve
Click For Summary

Discussion Overview

The discussion centers around the comparison between a Hermite curve (specifically a quadratic Bezier curve) and the sine function for angles between 0 and 45 degrees. Participants explore the mathematical properties of these curves and their relationship to circular arcs, as well as potential discrepancies in calculated values.

Discussion Character

  • Exploratory, Technical explanation, Debate/contested

Main Points Raised

  • One participant presents a Hermite curve defined by specific control points and questions whether it should yield results equivalent to the sine function for angles between 0 and 45 degrees.
  • The participant notes a discrepancy between the calculated value of Loc.y at 22.5 degrees and the expected value from the sine function, suggesting it may be due to floating point error.
  • Another participant asserts that a Bezier curve cannot exactly equal a circle and suggests that while splines can approximate circles, they do not maintain a unit distance from the origin.
  • A different participant counters that a quadratic rational Bezier curve can exactly reproduce a circular arc, and mentions that a degree 5 rational Bezier curve can represent an entire circle, referencing the theory of NURBS.
  • There is a mention of the versatility of NURBS in representing conic sections and their relationship to Bezier curves.

Areas of Agreement / Disagreement

Participants express differing views on the capabilities of Bezier curves in relation to circular arcs, with some asserting that they can approximate circles while others claim they cannot exactly represent them. The discussion remains unresolved regarding the initial question of equivalence between the Hermite curve and the sine function.

Contextual Notes

Participants discuss the limitations of Bezier curves in accurately representing circular shapes and the implications of floating point errors in calculations. There is also a reference to the mathematical properties of NURBS as a more versatile alternative.

arpace
Messages
9
Reaction score
0
So I have a Hermite curve with the control points:

//point# (x,y):

p0 (1,0)
p1 (1,(Math.sqrt(2)-1))
p2 (Math.sqrt(0.5), Math.sqrt(0.5))

I also have the algorithm to find the points on the locus between 0 and 45 degrees:

//L0 is the point on the line between p0 and p1
//L1 is the point on the line between p1 and p2
//Loc is the point on the locus
//...
//keep in mind that although this can be extended with if statements to check for
//any degree with a little modification
//right now, the rule is 0 <= degree <= 45

L0 = p0 + (p1 - p0)*degree/45;
L1 = p1 + (p2 - p1)*degree/45;
Loc = L0 + (L1-L0)*degree/45;

so Shouldn't this, as it is essentially a quadratic Bezier (Hermite) curve representing degrees 0 through 45 of a unit circle , not equal the results of sind(degree) as long as:
0<= degree <= 45 ?


when I use for the degree 22.5, on my windows calculator
sind(22.5) = 0.3826834323650897717284599840304;

...but mine (again using the window calc) at 22.5 degrees is
Loc.y = 0.38388347648318440550105545263106

could this be due to floating point error? Is there something obvious I am missing?

here is an image I made to help with conceptualization
[PLAIN]http://sphotos.ak.fbcdn.net/hphotos-ak-snc4/hs1384.snc4/163638_10100121877154282_28122817_59279302_5323393_n.jpg
 
Last edited by a moderator:
Mathematics news on Phys.org
seriously? no one?
 
A Bezier curve can not be exactly equal to a circle.

Repeat the subdivision process again, and you will see that you a mid-point which is not a unit distance from the origin.

However your splines are a good approximations to a circle, and are often used to draw approximate circles in computer graphics.

FWIW it is possible to represent a circular arc up to a semicircle (or in fact any conic section) exactly using rational functions as splines. Look up the theory of NURBS (non-uniform rational B-splines) if you are interested.
 
Actually, a quadratic rational Bezier curve can exactly reproduce a circular arc and a degree 5 rational Bezier curve can represent an entire circle. There is a formula to figure out the weights for each control point if you're still interested. A NURBS can reproduce any conic section, which makes them so versatile. However, a NURBS is basically a collection of Bezier curves joined together so that they have a specified continuity. If you're interested, there is a whole bunch of information about computer-aided geometric design at http://en.wikiversity.org/wiki/CAGD
 

Similar threads

Replies
1
Views
2K
  • · Replies 5 ·
Replies
5
Views
4K
  • · Replies 12 ·
Replies
12
Views
11K