51_solve_method: Solve Method

Description Usage Arguments Details Value References See Also Examples

Description

Solve method, for CHS objects.

Usage

1
2
## S3 method for class 'CHS'
solve(a, b=0, ..., to.list=FALSE)

Arguments

a

A CHS object.

b

A vector of y values.

to.list

If true, return list.
Ignored, if b has length two or greater.

...

Other arguments, for the roots.chs.eval function.

Details

This function is a wrapper for roots.chs.eval.
(It calls roots.chs.eval with modified cy values).

It computes x values, where the spline's y value is equal to the values in b.

Value

If to.list is false (the default), and length (b) is one:
It returns a single numeric vector.

Otherwise:
It returns a list of numeric vectors, one for each value in b.

References

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

See Also

chs, roots.chs

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
#control points
cx <- 1:4
cy <- c (-4, -1, 1, 4)

#cubic Hermite spline
#(with function object, and default slopes)
f <- chs (cx, cy)

#solve for x, given y=2
solve (f, 2)

kubik documentation built on April 15, 2021, 9:09 a.m.

Related to 51_solve_method in kubik...