|
Core 1.0
|
Quintic curves in the plane. More...
#include <curve.h>
Public Member Functions | |
| QuinticCurve2 () | |
| Empty. | |
| QuinticCurve2 (const Quintic &, const Quintic &) | |
| Creates a quintic curve. | |
| ~QuinticCurve2 () | |
| Empty. | |
| Quintic & | operator[] (int) |
| Quintic | operator[] (int) const |
| QuinticCurve2 | operator- () const |
| Negative curve unary operator. | |
| Vector2 | Tangent (const double &) const |
| Computes the tangent to the quintic curve at a given position on the curve. | |
| Vector2 | Normal (const double &) const |
| Computes the normal vector to the quintic curve at a given position on the curve. | |
| double | Length (int=256) const |
| Computes the length of the quintic curve. Integration is performed over interval [0,1]. | |
| double | Length (const double &, const double &, int=256) const |
| Computes the length of the quintic curve over interval [a,b]. | |
| Vector2 | operator() (const double &) const |
| Evaluates curve point at a given location. | |
| Vector2 | Eval (const double &) const |
| Evaluates curve point at a given location. | |
| double | Curvature (const double &) const |
| Computes the signed curvature of the curve at a given point. | |
| Box2 | GetBox () const |
| Compute the bounding box of the quintic curve with parameter interval [0,1]. | |
| Matrix2 | GetMatrix (const double &) const |
| Compute the Frenet vectors (tangent and normal) at a given point on the curve. | |
| Frame2 | GetFrame (const double &) const |
| Compute the frame at a given point on the curve. | |
| void | Draw (QGraphicsScene &, const QPen &=QPen(), const QBrush &=QBrush()) const |
| Draw a quintic curve. | |
| Vector2 | BezierControl (int) const |
| Compute the i-th Bezier control point of the curve. | |
Static Public Member Functions | |
| static QuinticCurve2 | Hermite (const Vector2 &, const Vector2 &, const Vector2 &, const Vector2 &, const Vector2 &, const Vector2 &) |
| Creates an Hermite quintic curve on interval [0,1] given vertex locations and tangent vectors (in that order). | |
| static QuinticCurve2 | Hermite (const Vector2 &, const Vector2 &, const Vector2 &, const Vector2 &, const double &, const double &) |
| Creates an Hermite quintic curve on interval [0,1] given vertex locations, tangent vectors and curvature radii. | |
| static QuinticCurve2 | Bezier (const Vector2 &, const Vector2 &, const Vector2 &, const Vector2 &, const Vector2 &, const Vector2 &) |
| Creates a Bezier quintic curve on interval [0,1] given six control points. | |
Static Public Attributes | |
| static const QuinticCurve2 | Null |
| Null curve. | |
Protected Attributes | |
| Quintic | y |
| Quintic polynomial functions for every coordinate. | |
Friends | |
| std::ostream & | operator<< (std::ostream &s, const QuinticCurve2 &curve) |
| Overloaded. | |
Quintic curves in the plane.
Creates a quintic curve.
| x,y | Quintic parametric equations of the corresponding x, y coordinates. |
|
static |
Creates a Bezier quintic curve on interval [0,1] given six control points.
| a,b,c,d,e,f | Control points of the Bezier curve. |
| Vector2 QuinticCurve2::BezierControl | ( | int | i | ) | const |
Compute the i-th Bezier control point of the curve.
Computations have been optimized.
| i | Index. |
| double QuinticCurve2::Curvature | ( | const double & | t | ) | const |
Computes the signed curvature of the curve at a given point.
| t | Parameter. |
| void QuinticCurve2::Draw | ( | QGraphicsScene & | scene, |
| const QPen & | pen = QPen(), | ||
| const QBrush & | = QBrush() ) const |
Draw a quintic curve.
The brush is not used.
| scene | Graphics scene. |
| pen | The pen. |
| Vector2 QuinticCurve2::Eval | ( | const double & | t | ) | const |
Evaluates curve point at a given location.
| t | Parameter. |
| Frame2 QuinticCurve2::GetFrame | ( | const double & | u | ) | const |
Compute the frame at a given point on the curve.
| u | Parameter. |
| Matrix2 QuinticCurve2::GetMatrix | ( | const double & | u | ) | const |
Compute the Frenet vectors (tangent and normal) at a given point on the curve.
| u | Parameter. |
|
static |
Creates an Hermite quintic curve on interval [0,1] given vertex locations, tangent vectors and curvature radii.
| a,b | End vertices of the Hermite quintic curve. |
| ta,tb | Tangent vectors at the end vertices. |
| ra,rb | Signed curvature radii at the end vertices. |
|
static |
Creates an Hermite quintic curve on interval [0,1] given vertex locations and tangent vectors (in that order).
| a,b | End vertices of the Hermite quintic curve. |
| ta,tb | Tangent vectors at the end vertices. |
| aa,ab | Acceleration vectors at the end vertices. |
| double QuinticCurve2::Length | ( | const double & | a, |
| const double & | b, | ||
| int | n = 256 ) const |
Computes the length of the quintic curve over interval [a,b].
Since we have the parametric equations of the coordinates of the points on the curve, then the length is the integral of the square root of the sum of the squared derivatives where the limits of integration are [a,b].
In the general case, the function we end up with is not integrable in closed form, leading to an elliptic integral or some such. Thus we evaluate the integral numerically.
| a,b | Interval. |
| n | Discretization of the integration interval. |
| double QuinticCurve2::Length | ( | int | n = 256 | ) | const |
Computes the length of the quintic curve. Integration is performed over interval [0,1].
Simply call QuinticCurve2::Length(0.0,1.0,n) with n as the passed argument parameter.
| n | Discretization of the curve. |
| Vector2 QuinticCurve2::Normal | ( | const double & | t | ) | const |
Computes the normal vector to the quintic curve at a given position on the curve.
The normal is the obtained by evaluating the second derivative.
| t | Position. |
| Vector2 QuinticCurve2::operator() | ( | const double & | t | ) | const |
Evaluates curve point at a given location.
| t | Parameter. |
|
inline |
Access curve components (0 = x, 1 = y).
|
inline |
Access curve components (0 = x, 1 = y).
| Vector2 QuinticCurve2::Tangent | ( | const double & | t | ) | const |
Computes the tangent to the quintic curve at a given position on the curve.
The tangent is the obtained by evaluating the first derivative.
| t | Position. |
|
friend |
Overloaded.
| s | Stream. |
| curve | The quintic curve. |