|
| QuadricCurve () |
| Empty.
|
|
| QuadricCurve (const Quadric &, const Quadric &, const Quadric &) |
| Creates a quadric curve. More...
|
|
| ~QuadricCurve () |
| Empty.
|
|
Quadric & | operator[] (int) |
| Access curve components.
|
|
Quadric | operator[] (int) const |
| Access curve components.
|
|
QuadricCurve | operator- () const |
| Negates the coefficients of a quadric curve.
|
|
Vector | operator() (const double &) const |
| Computes the point on the curve. More...
|
|
Vector | Eval (const double &) const |
| Computes the point on the curve. More...
|
|
double | Curvature (const double &) const |
| Computes the curvature. More...
|
|
Vector | Tangent (const double &) const |
| Computes the tangent to the curve. More...
|
|
Vector | Normal (const double &) const |
| Computes the secondary derivative to the curve. More...
|
|
Box | GetBox () const |
| Compute the bounding box of the quadric curve with parameter interval [0,1].
|
|
double | R (const Vector &, 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 &, const double &) 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. More...
|
|
double | Length (const double &, const double &, int=256) const |
| Computes the length of the quadric curve over interval [a,b]. More...
|
|
Matrix | GetMatrix (const double &) const |
| Compute the Frenet vectors at a given point on the curve. More...
|
|
Frame | GetFrame (const double &) const |
| Compute the Frenet frame at a given point on the curve. More...
|
|
Quadric curves.
Quadric curves are implemented with three 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 for accelerating the computation of the bounding box of the quadric curve parameterized over the unit interval [0,1], or the distance between a point an the curve.
double QuadricCurve::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 QuadricCurve::R |
( |
const Vector & |
p, |
|
|
double & |
u |
|
) |
| const |
Compute the squared distance between a point and the quadric curve.
This function computes the projection of a 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 | Point. |
u | Parameter defining the coordinate of the projection of the argument vertex onto the curve. |