Description Usage Arguments Details Value References See Also Examples
Compute roots of cubic Hermite splines, using function objects.
1 2 3 4 5 6 7 8 9 10 11 | root.chs (sf, ..., include.implied.roots=TRUE, warning=TRUE)
argmin.chs (sf, ..., include.implied.roots=TRUE, warning=TRUE)
argmax.chs (sf, ..., include.implied.roots=TRUE, warning=TRUE)
argflex.chs (sf, ..., include.implied.roots=TRUE, warning=TRUE)
roots.chs (sf, ..., include.implied.roots=TRUE, warning=TRUE)
argmins.chs (sf, ..., include.implied.roots=TRUE, warning=TRUE)
argmaxs.chs (sf, ..., include.implied.roots=TRUE, warning=TRUE)
argflexs.chs (sf, ..., include.implied.roots=TRUE, warning=TRUE)
chs.roots.derivative (sf, ..., include.implied.roots=TRUE, warning=TRUE)
|
sf |
A CHS object. |
include.implied.roots |
If true, include implied roots. |
warning |
If true, give a warning if there's relevant constant/level (or linear) sections. |
... |
Ignored. |
These functions compute roots of cubic Hermite splines, using function objects.
Alternatively, you can you can use the spline root eval functions (with a .eval suffix), without using function objects, which may be more efficient, in some cases.
By default, the functions include implied roots (defined below) and remove spurious inflection points (also, defined below).
Here, an implied root refers to a root that coincides with a constant/level section.
(Or coincides with a linear section, for inflection points).
Here, a constant/level section refers to one or more consecutive spline segments, with a constant value.
Here, a spurious inflection point refers to an inflection point within a quadratic-suggestive section.
And here, a quadratic-suggestive section refers to one or more consecutive spline segments, where all the control tangents within that section, are on the same side of the secant lines between consecutive control points.
If implied roots are included, then their value is equal to the midpoint of their combined interval.
Notes:
(1) Optima and inflection points exclude the endpoints.
(2) Currently, these functions may fail to find roots, if they're extremely close to the control points. Except, the functions should find optima in well-defined splines (with no more than one optimum per spline segment), regardless of where the optima are located.
(3) The chs.roots.derivative function is likely to be deprecated in the future, and replaced by a better function.
root.chs returns a single real root, if a single real root exists, otherwise, it returns an error.
roots.chs returns all the real roots, which will be a zero-length numeric vector, if there are no real roots.
argmin.chs returns a single global argmin, if a single global argmin exists, otherwise, it returns an error.
argmins.chs returns all argmins, which will be a zero-length numeric vector, if there are no minima.
argmax.chs and argmaxs.chs are the same as argmin.chs and argmins.chs, except they're for argmax(s) rather than argmin(s).
argflex.chs() and argflexs.chs are similar to the functions above, except that they're for inflection points.
Unlike the other functions here, chs.roots.derivative returns a two-column matrix.
The first column gives the roots of the derivative.
And the second column gives a numeric value equal to the sign of the second derivative, so:
1 (for minima), -1 (for maxima) and 0 (for stationary inflection points).
Please refer to the help page for chs for background information and references.
chs, solve.CHS, roots.chs.eval
1 2 3 4 5 6 7 8 9 10 11 | #control points
cx <- 1:4
cy <- c (1, -1, -1, 1)
#cubic hermite spline
#(with function object, and default slopes)
f <- chs (cx, cy)
#roots
roots.chs (f)
argmins.chs (f)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.