bezier | R Documentation |
Various functionality for Bezier curves including derivatives and radius of curvature.
bezier(P, tee, n=100)
bezier_deriv(P, tee, n=100)
bezier_deriv2(P, tee, n=100)
bezier_radius(P, tee, n=100)
bezier_curvature(P,tee,n=100)
myseg(P, ...)
P |
Control points in the form of a 4 by 2 matrix with rows
corresponding to |
tee |
Parametric variable |
n |
Integer specifying number of points between 0 and 1 to use. Default value of 100 looks OK |
... |
Further arguments passed by |
Function bezier()
returns a two column matrix with rows
corresponding to the positions of the specified Bezier curve.
Functions bezier_deriv()
and bezier_deriv2()
give the first and second derivatives respectively.
Function bezier_radius()
gives the radius of curvature.
Functions bezier_length()
and
bezier_bending_energy()
use numerical quadrature to give the
arc length and bending energy (\int R^{-1}ds
).
Robin K. S. Hankin
bezier_angle
P <- matrix(c(0, 1, 2, 2, 2, 0, 3, 2),4,2)
xy <- bezier(P,n=100)
dx <- bezier_deriv(P,n=100)
plot(xy,asp=1)
myseg(P)
plot(xy,asp=1,cex=sqrt(rowSums(dx^2))/3.2)
plot(xy,asp=1)
segments(xy[,1],xy[,2],(xy+dx/200)[,1],(xy+dx/200)[,2])
plot(xy, asp=1,cex=bezier_radius(P,n=100)/2)
lapply(as.controlpoints(k8_9),bezier_radius)
lapply(as.controlpoints(k8_9),bezier_arclength)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.