Description Usage Arguments Details Value Author(s) Examples
Calculate points on a Bezier curve and/or tangents and/or normals to the curve at those points.
1 2 3 | BezierPoints(x, range = NULL)
BezierTangent(x, range = NULL)
BezierNormal(x, range = NULL)
|
x |
A |
range |
The range of t values within which to calculate points (or tangents or normals). A numeric vector of length 2. |
The tangents and normals are 1 inch in length.
All functions return a list with components x
and y
.
For BezierPoints
these are locations on the curve.
For BezierTangent
and BezierNormal
, these are the
distances to the end
points of tangent or normal line segments.
All values are in inches.
Paul Murrell
1 2 3 4 5 6 7 8 9 10 11 12 | x <- BezierGrob(c(.2, .2, .8, .8), c(.2, .8, .8, .2),
stepFn=function(...) seq(0, 1, length.out=10))
grid.draw(x)
pts <- BezierPoints(x)
grid.circle(pts$x, pts$y, default.units="in", r=unit(.5, "mm"),
gp=gpar(fill="black"))
tan <- BezierTangent(x)
grid.segments(pts$x, pts$y, pts$x + tan$x, pts$y + tan$y,
default.units="in", gp=gpar(col="green"))
norm <- BezierNormal(x)
grid.segments(pts$x, pts$y, pts$x + norm$x, pts$y + norm$y,
default.units="in", gp=gpar(col="red"))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.