vc_streamline: Trace a spatial field trajectory with fixed-step RK4

View source: R/vector_fields.R

vc_streamlineR Documentation

Trace a spatial field trajectory with fixed-step RK4

Description

Trace a spatial field trajectory with fixed-step RK4

Usage

vc_streamline(f, seed, interval, n = 100L, time_dependent = FALSE)

Arguments

f

Function of one Cartesian vector, or of a vector and time when time_dependent is TRUE. Returns three finite Cartesian components.

seed

Initial Cartesian position at the first endpoint.

interval

Two finite times in traversal order.

n

Number of steps, at least one.

time_dependent

Use the signature f(position,time) for a pathline.

Details

Autonomous fields give streamlines. Reversed times integrate backward. Equal endpoints give one sample. The method uses the supplied field as velocity and has no adaptive error estimate or boundary events. The visualization sampling domain does not clip the trajectory.

Value

List with type streamline3d, samples t,x,y,z,speed and field mode.

Examples

vc_streamline(function(p)c(-p[2],p[1],0),c(1,0,0),c(0,pi/2))$samples

vectorialcalculus documentation built on Nov. 17, 2026, 1:09 a.m.