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
SUMMARY

The discussion focuses on the comparison between Hermite curves and quadratic Bezier curves in representing angles from 0 to 45 degrees on a unit circle. The user presents a Hermite curve defined by specific control points and calculates points on the locus using a defined algorithm. The results from the Hermite curve do not match the sine values calculated using the sind function, leading to questions about potential floating point errors. The conversation concludes with insights on NURBS (Non-Uniform Rational B-Splines) as a more accurate method for representing circular arcs and conic sections.

PREREQUISITES
  • Understanding of Hermite curves and quadratic Bezier curves
  • Familiarity with trigonometric functions, specifically the sind function
  • Knowledge of floating point arithmetic and its implications in programming
  • Basic concepts of NURBS (Non-Uniform Rational B-Splines)
NEXT STEPS
  • Research the mathematical foundations of NURBS and their applications in computer graphics
  • Explore the differences between Hermite curves and Bezier curves in detail
  • Learn about floating point precision and error handling in programming
  • Investigate algorithms for accurately approximating circular arcs using splines
USEFUL FOR

Graphic designers, computer graphics programmers, and anyone involved in geometric modeling or animation who seeks to understand curve representations and their mathematical underpinnings.

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 5 ·
Replies
5
Views
4K
  • · Replies 11 ·
Replies
11
Views
13K
  • · Replies 12 ·
Replies
12
Views
11K