|
| Cubic () |
| Empty.
|
|
| Cubic (const double &, const double &, const double &, const double &) |
| Creates a cubic. More...
|
|
| Cubic (const Quadric &) |
| Creates a cubic given a quadric.
|
|
| ~Cubic () |
| Empty.
|
|
constexpr double & | operator[] (int) |
| Access class components.
|
|
constexpr double | operator[] (int) const |
| Overloaded.
|
|
int | CheckDegree () const |
| Check the degree of the cubic.
|
|
Cubic | operator- () const |
| Unary.
|
|
Cubic & | operator+= (const Cubic &) |
| Destructive sum of two cubics.
|
|
Cubic & | operator-= (const Cubic &) |
| Destructive difference of two cubics.
|
|
Cubic & | operator*= (const double &) |
| Scale a cubic by a double value.
|
|
Cubic & | operator/= (const double &) |
| Scale a cubic by a double value.
|
|
constexpr double | operator() (const double &) const |
| Evaluates the cubic. More...
|
|
constexpr double | Derivative (const double &) const |
| Computes the derivative of the cubic. More...
|
|
Quadric | Prime () const |
| Computes the first derivative of a cubic, which is a quadric.
|
|
Linear | Second () const |
| Computes the second derivative of a cubic, which is a linear polynomial.
|
|
int | Solve (double *) const |
| Solve the cubic equation. More...
|
|
int | Solve (double *, const double &, const double &) const |
| Search the roots of a polynomial equation over a given interval. More...
|
|
int | SolveNormalized (double *) const |
| Solve the normalized cubic equation, i.e., the highest coefficient is 1.0. More...
|
|
void | Range (double &, double &, const double &=0.0, const double &=1.0) const |
| Compute the range of values taken by the cubic over a given interval. More...
|
|
double | K (const double &, const double &) const |
| Compute the Lipschitz constant of the cubic. More...
|
|
|
static Cubic | Compose (const Cubic &, const Linear &) |
| Compose the cubic by a linear. More...
|
|
static Cubic | Hermite (const double &, const double &, const double &, const double &) |
| Creates an Hermite cubic polynomial. More...
|
|
static Cubic | Bezier (const double &, const double &, const double &, const double &) |
| Creates a cubic Bezier polynomial. More...
|
|
static Cubic | Spline (const double &, const double &, const double &, const double &) |
| Creates a cubic Spline polynomial. More...
|
|
static double | Interpolation (const double &, const double &, const double &, const double &, const double &) |
| Bicubic interpolation based on four values. More...
|
|
static double | Smooth (const double &, const double &) |
| Compute the value of a C2 smooth interpolating function (1-x/r)3. More...
|
|
static double | SmoothCompact (const double &, const double &) |
| Compactly supported smooth interpolating function. More...
|
|
static double | SmoothCompact (const double &, const double &, const double &) |
| Compactly supported smooth interpolating function. More...
|
|
static double | Smooth (const double &) |
| Compute the value of a C1 smooth interpolating function. More...
|
|
static double | SmoothStep (const double &, const double &, const double &) |
| Compute a smooth cubic step. More...
|
|
static double | Gaussian (const double &, const double &, const double &) |
| Compute a compactly supported Gaussian-like pulse. More...
|
|
static double | GaussianThick (const double &, const double &, const double &, const double &) |
| Compute a compactly supported Gaussian-like pulse with a thick plateau. More...
|
|
static double | Sigmoid (const double &, const double &, const double &) |
| Compute the value of a compactly supported sigmoid-shaped symmetric cubic. More...
|
|
static double | Warp (const double &) |
| Unit interval warping function. More...
|
|
static Cubic | Bernstein (int) |
| Creates a quadric Bernstein polynomial. More...
|
|
static double | Bernstein (int, const double &) |
| Compute the quadric Bernstein polynomial for a given value. More...
|
|
Cubic polynomials.
Closed form expression of roots exist for such polynomials.
Constructors should provide the coefficients in descending order. Here is an example of how to code the cubic 2 x3-x+1:
Cubic p(2.0,0.0,-1.0,1.0);
Cubic polynomials.
Definition: cubic.h:8
How do I compute the interpolating smooth cubic (1-x/r)3 for values x within [0,r]?
A first solution is to use the Cubic class as follows:
double y=
Cubic(-1.0/(r*r*r),3.0/(r*r),-3.0/r,1.0)(x)
Cubic()
Empty.
Definition: cubic.h:13
Cubic also implements some inline static member function such as :
{
return (1.0-x/r)*(1.0-x/r)*(1.0-x/r);
}
static double Smooth(const double &, const double &)
Compute the value of a C2 smooth interpolating function (1-x/r)3.
Definition: cubic.h:274
This function is more efficient if only one or two function calls are needed.
How do I create a Hermite cubic spline curve?
A simple way to do this is to use the static member function of the CubicCurve class, for example:
CubicCurve c=
CubicCurve::Hermite(
Vector(0,0,0),
Vector(2,1,0),
Vector(0,1,0),
Vector(1,0,0));
Cubic curves.
Definition: curve.h:85
static CubicCurve Hermite(const Vector &, const Vector &, const Vector &, const Vector &)
Creates an Hermite cubic curve on interval [0,1] given vertex locations and tangent vectors (in that ...
Definition: curvecubic.cpp:184
double c[4]
Array of coefficients.
Definition: cubic.h:10
Vectors in three dimensions.
Definition: evector.h:21
double Cubic::Sigmoid |
( |
const double & |
x, |
|
|
const double & |
r, |
|
|
const double & |
t |
|
) |
| |
|
static |
Compute the value of a compactly supported sigmoid-shaped symmetric cubic.
The cubic was obtaied by solving the Hermite Cubic contraints: f(0)=0, f'(0)=1, f(R)=T and f'(R)=0. Coefficients are: a0=0, a1=1, a2=(3T-4R)/4R^2, a3=(R-T)/4R^3.
- See also
- Math::SigmoidQuadric
- Parameters
-
x | Real. |
r | Radius of influence. |
t | Value. |