|
| QuadricCurve2 () |
| Empty.
|
|
| QuadricCurve2 (const Quadric &, const Quadric &) |
| Creates a quadric curve. More...
|
|
| QuadricCurve2 (const QuadricCurve &) |
| Creates a quadric curve in the plane. More...
|
|
| ~QuadricCurve2 () |
| Empty.
|
|
Quadric & | operator[] (int) |
| Access curve components.
|
|
Quadric | operator[] (int) const |
| Access curve components.
|
|
QuadricCurve2 | operator- () const |
| Negates the coefficients of a quadric curve.
|
|
Vector2 | operator() (const double &) const |
| Computes the point on the curve. More...
|
|
Vector2 | Eval (const double &) const |
| Computes the point on the curve. More...
|
|
double | Curvature (const double &) const |
| Computes the signed curvature of the curve at a given point p(t). More...
|
|
Vector2 | Tangent (const double &) const |
| Computes the tangent to the curve. More...
|
|
Vector2 | Normal (const double &) const |
| Computes the normal vector to the quadric curve at a given position on the curve. More...
|
|
Box2 | GetBox () const |
| Compute the bounding box of the quadric curve with parameter interval [0,1].
|
|
void | Translate (const Vector2 &) |
| Translate the curve. More...
|
|
double | R (const Vector2 &, double &) const |
| Compute the squared distance between a point and the quadric curve. More...
|
|
double | S (const double &, int=256) const |
| Compute the curvilign absisca of a point on the curve. More...
|
|
double | U (const double &, int=256) const |
| Compute the parameter corresponding to the argument curvilign absisca of a point on the curve. More...
|
|
double | LengthIntegral (const double &=0.0, const double &=1.0) const |
| Computes the length of the quadric curve over interval [a,b] using a closed form integral. More...
|
|
double | Length (int=256) const |
| Computes the length of the cubic curve. Integration is performed over interval [0,1].
|
|
double | Length (const double &, const double &, int=256) const |
| Computes the length of the quadric curve over interval [a,b]. More...
|
|
double | UV (const Vector2 &, double &, double &) const |
| Compute the inverse mapping for a given input point. More...
|
|
Vector2 | Normal (const Vector2 &, double &) const |
| Compute the projection of a point on the curve. More...
|
|
int | Intersect (const Ray2 &, double[2]) const |
| Compute the intersection between the curve and a ray. More...
|
|
void | Draw (QGraphicsScene &, const QPen &=QPen(), const QBrush &=QBrush()) const |
| Draw a quadric curve. More...
|
|
Quadric curves in the plane.
Quadric curves are implemented with two quadric polynomials defining the coordinates of the points on the curve. It is a minimum storage class in the sense that it does not keep extra constant data which may be useful for computing the bounding box of the quadric curve parameterized over the unit interval [0,1] or the distance between a point an the curve.
double QuadricCurve2::Length |
( |
const double & |
a, |
|
|
const double & |
b, |
|
|
int |
n = 256 |
|
) |
| const |
Computes the length of the quadric 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].
s = Integral Sqrt((dx/dt)2 + (dy/dt)2) dt,
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.
- Parameters
-
a,b | Interval. |
n | Discretization of the integration interval. |
double QuadricCurve2::R |
( |
const Vector2 & |
p, |
|
|
double & |
u |
|
) |
| const |
Compute the squared distance between a point and the quadric curve.
This function computes the projection of the point p onto the curve by minimizing the distance function along the curve, expressed as a cubic polynomial.
Most of the coefficients of this cubic polynomial are constant, and could be pre-processed in the constructor.
Warning This function does not work if the quadric degenerates to a linear curve.
- Parameters
-
p | Vertex. |
u | Parameter defining the coordinate of the projection of the argument vertex onto the curve. |