stinepack (version 1.4)

stinemanSlopes: Estimate the slope of an interpolating function using an arc

Description

Returns estimates of the slope of an interpolating function that runs through a set of points in the xy-plane. The slopes are calculated using to the algorithm of Stineman (1980), i.e. from the tangent of circles passing through every three consecutive points.

Usage

stinemanSlopes(x,y,scale=FALSE)

Value

Returns an estimate of the slope of the interpolant at (x,y).

Arguments

x,y

coordinates of points defining the interpolating function.

scale

if true (default) then the x and y values are normalized prior to the slope calculation.

Author

Tomas Johannesson

References

Stineman, R. W. A Consistently Well Behaved Method of Interpolation. Creative Computing (1980), volume 6, number 7, p. 54-57.

See Also

stinterp and parabolaSlopes.

Examples

Run this code
## Interpolate a smooth curve
x <- seq(0,2*pi,by=pi/6)
y <- sin(x)
stinemanSlopes(x,y,scale=TRUE)
stinemanSlopes(x,y,scale=FALSE)

Run the code above in your browser using DataCamp Workspace