quadPoints: Calculate Points on a Bezier Curve In gridBezier: Bezier Curves in 'grid'

Description

Calculate points on a Bezier curve and/or tangents and/or normals to the curve at those points.

Usage

 ```1 2 3``` ```quadPoints(x, range = NULL) quadTangent(x, range = NULL) quadNormal(x, range = NULL) ```

Arguments

 `x` A `"quadGrob"` object. `range` The range of t values within which to calculate points (or tangents or normals). A numeric vector of length 2.

Details

The tangents and normals are 1 inch in length.

Value

All functions return a list with components `x` and `y`. For `quadPoints` these are locations on the curve. For `quadTangent` and `quadNormal`, these are the distances to the end points of tangent or normal line segments. All values are in inches.

Paul Murrell

Examples

 ``` 1 2 3 4 5 6 7 8 9 10 11 12``` ```x <- quadGrob(c(.2, .5, .8), c(.2, .8, .2), stepFn=function(...) seq(0, 1, length.out=10)) grid.draw(x) pts <- quadPoints(x) grid.circle(pts\$x, pts\$y, default.units="in", r=unit(.5, "mm"), gp=gpar(fill="black")) tan <- quadTangent(x) grid.segments(pts\$x, pts\$y, pts\$x + tan\$x, pts\$y + tan\$y, default.units="in", gp=gpar(col="green")) norm <- quadNormal(x) grid.segments(pts\$x, pts\$y, pts\$x + norm\$x, pts\$y + norm\$y, default.units="in", gp=gpar(col="red")) ```

Example output

```Loading required package: grid
```

gridBezier documentation built on May 22, 2019, 5:02 p.m.