Description Usage Arguments Value Author(s) Examples
Univariate Bernstein-Bezier function.
1 | bernstein1D(x, y)
|
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]. |
Numeric scalar, the value of the Bernstein-Bezier curve.
Francisco Mendoza-Torres (mentofran@gmail.com)
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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.