straightenedBezier: Straightened Spline curves

Description Usage Arguments Value Note Author(s) References Examples

Description

Function for straightning Bezier or B-spline curves.

Usage

1
2
3
straightenedBezier(x, y, beta = 0.5, n.evals = 100)

straightenedBSpline(x, y, order = 4, beta = 0.5, n.evals = 100)

Arguments

x

A numeric vector giving the x-coordinates of the control points. Alternatively, it can be a list (or data.frame) containing two vectors of control points.

y

A numeric vector giving the y-coordinates of the control points.

beta

A numeric values that control amount of straightening. A beta of 1 is a normal spline curve and where as a value of 0 is a straight line.

n.evals

The number of evaluations of the Bezier curve.

order

The order of the B-spline. See bSpline.

Value

Returns a list of length 2 with entries x and y of x and y coordinates corresponding to the evaluations of the B-spline.

Note

The straightening is done by modifying the control points as described in the reference.

Author(s)

Anders Ellern Bilgrau

References

Holten, Danny. "Hierarchical edge bundles: Visualization of adjacency relations in hierarchical data." Visualization and Computer Graphics, IEEE Transactions on 12.5 (2006): 741-748.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
# Bezier curves
x <- list(x = cumsum(rnorm(7)), 
          y = cumsum(rnorm(7)))
plot(x, type = "b", col = "grey", pch = 16)
for (b in seq(0.1, 1, l = 9)) 
  lines(Bmisc:::straightenedBezier(x, beta = b))
# B-splines
x <- cumsum(rnorm(7))
y <- cumsum(rnorm(7))
plot(x, y, type = "b", col = "grey", pch = 16)
for (b in seq(0.1, 0.9, l = 9)) 
  lines(Bmisc:::straightenedBSpline(x, y, beta = b))

AEBilgrau/Bmisc documentation built on May 5, 2019, 11:28 a.m.