Skip to contents

Visualizes a vector field using stream lines (particle traces). Particles are seeded at random or grid positions and traced through the velocity field using Euler integration.

Super classes

manimR::MObject -> manimR::VMobject -> StreamLines

Public fields

func

Vector field function f(x, y) -> c(vx, vy)

x_range

x range for seeding

y_range

y range for seeding

n_lines

Number of stream lines

dt

Integration time step

max_steps

Maximum integration steps per line

stroke_width

Line stroke width

lines

List of stream line VMobjects

Active bindings

stroke_width

Line stroke width

Methods

Inherited methods


Method new()

Create StreamLines

Usage

StreamLines$new(
  func,
  x_range = c(-5, 5),
  y_range = c(-3, 3),
  n_lines = 50,
  dt = 0.05,
  max_steps = 100,
  color = BLUE,
  stroke_width = 2,
  ...
)

Arguments

func

Function(x, y) -> c(vx, vy)

x_range

c(min, max)

y_range

c(min, max)

n_lines

Number of lines

dt

Integration step

max_steps

Max steps per line

color

Line color or color gradient

stroke_width

Stroke width

...

Additional args


Method start_animation()

Start the streaming animation

Usage

StreamLines$start_animation(scene = NULL, run_time = 3)

Arguments

scene

The scene to animate in

run_time

Animation duration


Method clone()

The objects of this class are cloneable with this method.

Usage

StreamLines$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.