Find the quadratic and cubic Bezier curve for the given points

qbezier(x, y, t)

cbezier(x, y, t)

Arguments

x

a vector of x values

y

a vector of y values

t

a vector of t values for which the curve will be computed

Value

a list composed of an x-vector and a y-vector

Details

qbezier finds the quadratic Bezier curve for the given three points and cbezier finds the cubic Bezier curve for the given four points. The curve will be computed at all values in the vector t and a list of x and y values returned.

See also

Other interp: bilinear(), cubicspline(), linterp(), nn(), polyinterp(), pwiselinterp()

Examples

x <- c(1, 2, 3)
y <- c(2, 3, 5)
f <- qbezier(x, y, seq(0, 1, 1/100))

x <- c(-1, 1, 0, -2)
y <- c(-2, 2, -1, -1)
f <- cbezier(x, y, seq(0, 1, 1/100))