Learn R Programming

kubik (version 0.2.0)

21_direct_chs_evaluation: Direct CHS Evaluation

Description

Functions for evaluating cubic Hermite splines, and their derivatives and indefinite integrals, directly.

Usage

chs.eval (cx, cy, cb, x, …,
    outside = c (NA, NA) )

chs.derivative.eval (cx, cy, cb, x, …, outside = c (NA, NA) )

chs.integral.eval (cx, cy, cb, x, …, outside = c (NA, NA), constant=0)

Arguments

cx

Vector of unique ascending control point x values. (Preferably, equally-spaced).

cy

Vector of control point y values.

cb

Vector of control slopes.

x

Vector of x values, where the spline is evaluated at.

outside

A vector of length two, giving the value of the spline outside the control points.

constant

Constant term.

.

Details

Refer to the help page for chs, for more information. (The functions described in that help page are similar to these functions).

These functions (with a .eval suffix) evaluate cubic Hermite splines, and their derivatives and indefinite integrals, without using function objects, and with minimal error checking. Alternatively, you can use function objects, which are likely to be more convenient, in most cases.

chs.eval Evaluate cubic Hermite splines.

chs.deritivative.eval Evaluate (exact) derivatives of cubic Hermite splines.

chs.integral.eval Evaluate indefinite integrals of cubic Hermite splines.

References

Please refer to the help page for chs for background information and references.

See Also

chs

Examples

Run this code
# NOT RUN {
#control points
cx <- 1:4
cy <- c (-4, -1, 1, 4)

#control slopes
cb <- chs.slopes (cx, cy)

#evaluate
#(without function object)
chs.eval (cx, cy, cb, 3.5)
# }

Run the code above in your browser using DataLab