Hermite/quadratic bezier curve vs (sin and cos)

  • Thread starter arpace
  • Start date
  • Tags
    Cos Curve
In summary, the conversation discusses the use of a quadratic Bezier (Hermite) curve to represent degrees 0 through 45 of a unit circle. While a Bezier curve cannot exactly equal a circle, it is a good approximation and can be used in computer graphics to draw circles. NURBS, which are a collection of Bezier curves, can accurately represent conic sections such as circles with the use of weights for each control point.
  • #1
arpace
9
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
  • #2
seriously? no one?
 
  • #3
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.
 
  • #4
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
 
  • #5


I would like to first clarify that both the Hermite/Quadratic Bezier curve and the sine/cosine functions have their own unique properties and applications. While they may both represent curves or points on a locus, they are not necessarily equivalent.

With that being said, let's address the specific question at hand. The algorithm provided for finding points on the Hermite curve between 0 and 45 degrees seems to be correct. However, it is important to note that this algorithm is only valid for the specific control points given. If we were to change the control points, the resulting curve may not match the results of the sine/cosine functions.

Furthermore, there may be slight discrepancies between the results of the algorithm and the results of the sine/cosine functions due to floating point error. This is a common issue in computer calculations and can be minimized by using higher precision data types or by implementing error correction methods.

In conclusion, while the Hermite/Quadratic Bezier curve and the sine/cosine functions may have some similarities in representing curves or points on a locus, they are not interchangeable and their results may not always match due to differences in their underlying algorithms and properties. It is important to carefully consider the specific application and intended use before choosing one over the other.
 

1. What is the difference between a Hermite/quadratic bezier curve and a sin/cos curve?

A Hermite/quadratic bezier curve is a type of mathematical curve that is defined by a set of control points and a set of tangent vectors. It is commonly used in computer graphics and animation. On the other hand, a sin/cos curve is a trigonometric function that describes a smooth, periodic oscillation. While both curves can be used to represent smooth curves, they have different mathematical properties and are used for different purposes.

2. Which curve is better for representing a smooth curve?

It depends on the context and the desired outcome. Generally, Hermite/quadratic bezier curves are better for representing smooth curves with sharp turns or corners. Sin/cos curves, on the other hand, are better for representing smooth, periodic curves.

3. Can Hermite/quadratic bezier curves and sin/cos curves be combined?

Yes, they can be combined to create more complex curves. For example, a Hermite curve can be used to define the shape of a curve, while a sin/cos curve can be used to define the oscillation of that curve.

4. Which curve is more commonly used in computer graphics?

Hermite/quadratic bezier curves are more commonly used in computer graphics due to their ability to create smooth, complex shapes with sharp turns and corners. They are also easier to manipulate and control compared to sin/cos curves.

5. Are there any limitations to using Hermite/quadratic bezier curves or sin/cos curves?

Both curves have their own limitations. Hermite/quadratic bezier curves can only represent smooth curves, so they may not be suitable for representing jagged or rough shapes. Sin/cos curves can only represent periodic curves, so they may not be suitable for representing non-repeating shapes. Additionally, both curves require a sufficient number of control points to accurately represent a shape.

Similar threads

Replies
1
Views
2K
  • General Math
Replies
5
Views
3K
  • General Math
Replies
5
Views
4K
  • General Math
Replies
11
Views
12K
  • General Math
Replies
12
Views
11K
Back
Top