bernstein1D: bernstein1D

Description Usage Arguments Value Author(s) Examples

Description

Univariate Bernstein-Bezier function.

Usage

1

Arguments

x

Numeric scalar in the closed interval [0,1]. The value at which the function will be approximated.

y

Numeric vector. The function evaluated at a regular partition of the closed interval [0,1].

Value

Numeric scalar, the value of the Bernstein-Bezier curve.

Author(s)

Francisco Mendoza-Torres (mentofran@gmail.com)

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
# Example 1:
ex <- seq(0,1, length.out=5)
ey <- sin(2*pi*ex); plot(ex, ey)
exB <- seq(0,1, by = 0.01)
eyB <- sapply(exB, bernstein1D, y = ey)
points(exB,eyB, pch = "+")

# Example 2 (Bernstein-Kantorovich)
eyE <- c(ey[1], (ey[-1] + head(ey, -1))/2, tail(ey, 1))
eyEB <- sapply(exB, bernstein1D, y = eyE)

mathphysmx/bernstein documentation built on Sept. 3, 2019, 12:57 p.m.