|
| Cubic () |
| Empty.
|
|
| Cubic (const double &, const double &, const double &, const double &) |
| Creates a cubic.
|
|
| 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.
|
|
constexpr double | Derivative (const double &) const |
| Computes the derivative of the cubic.
|
|
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.
|
|
int | Solve (double *, const double &, const double &) const |
| Search the roots of a polynomial equation over a given interval.
|
|
int | SolveNormalized (double *) const |
| Solve a normalized cubic equation.
|
|
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.
|
|
double | K (const double &, const double &) const |
| Compute the Lipschitz constant of the cubic.
|
|
|
static Cubic | Compose (const Cubic &, const Linear &) |
| Compose the cubic by a linear.
|
|
static Cubic | Hermite (const double &, const double &, const double &, const double &) |
| Creates an Hermite cubic polynomial.
|
|
static Cubic | Bezier (const double &, const double &, const double &, const double &) |
| Creates a cubic Bezier polynomial.
|
|
static Cubic | Spline (const double &, const double &, const double &, const double &) |
| Creates a cubic Spline polynomial.
|
|
static double | Interpolation (const double &, const double &, const double &, const double &, const double &) |
| Bicubic interpolation based on four values.
|
|
static double | Smooth (const double &, const double &) |
| Compute the value of a C2 smooth interpolating function (1-x/r)3.
|
|
static double | SmoothCompact (const double &, const double &) |
| Compactly supported smooth interpolating function.
|
|
static double | SmoothCompact (const double &, const double &, const double &) |
| Compactly supported smooth interpolating function.
|
|
static double | Smooth (const double &) |
| Compute the value of a C1 smooth interpolating function.
|
|
static double | SmoothStep (const double &, const double &, const double &) |
| Compute a smooth cubic step.
|
|
static double | Gaussian (const double &, const double &, const double &) |
| Compute a compactly supported Gaussian-like pulse.
|
|
static double | GaussianThick (const double &, const double &, const double &, const double &) |
| Compute a compactly supported Gaussian-like pulse with a thick plateau.
|
|
static double | Sigmoid (const double &, const double &, const double &) |
| Compute the value of a compactly supported sigmoid-shaped symmetric cubic.
|
|
static double | Warp (const double &) |
| Unit interval warping function.
|
|
static Cubic | Bernstein (int) |
| Creates a cubic Bernstein polynomial.
|
|
static double | Bernstein (int, const double &) |
| Compute the quadric Bernstein polynomial for a given value.
|
|
|
Cubic | operator+ (const Cubic &u, const Cubic &v) |
| Overloaded.
|
|
Cubic | operator- (const Cubic &v, const Cubic &u) |
| Overloaded.
|
|
Cubic | operator* (const Cubic &u, const double &e) |
| Multiply a cubic by a scalar value.
|
|
Cubic | operator* (const double &a, const Cubic &p) |
| Overloaded.
|
|
Cubic | operator/ (const Cubic &p, const double &a) |
| Overloaded.
|
|
Cubic | operator* (const Quadric &q, const Linear &l) |
| Multiply a quadric by a linear polynomial.
|
|
std::ostream & | operator<< (std::ostream &s, const Cubic &c) |
| Overloaded output-stream operator.
|
|
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()
Empty.
Definition cubic.h:12
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 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:86
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:197
double c[4]
Array of coefficients.
Definition cubic.h:9
Vectors in three dimensions.
Definition evector.h:20
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. |