Skip to contents

Resamples a single streamline onto a uniform arc-length grid. See reparametrize() for the full parameter documentation.

Arguments

x

A streamline object.

n_points

Number of equally-spaced arc-length points to use.

  • For a single streamline, defaults to x@n_points.

  • For a bundle, defaults to the rounded mean number of points across all streamlines.

Pass NULL to use these defaults explicitly.

Value

A streamline reparametrized onto the new grid. The returned object has @points resampled to exactly n_points rows via linear interpolation, and any numeric @point_data entries likewise resampled. Non-numeric @point_data entries are dropped with a warning. @streamline_data is preserved unchanged.

See also

Examples

sl <- streamline(
  points = cbind(X = runif(10), Y = runif(10), Z = runif(10)),
  point_data = list(FA = runif(10))
)
sl_reparam <- reparametrize(sl, n_points = 20)
sl_reparam@n_points  # 20
#> [1] 20