Skip to main content

Function: stepVectorField()

stepVectorField(func, x, y, dt, integrator): [number, number]

Defined in: src/mobjects/graphing/VectorField.ts:47

Advance one integration step of dX/dt = func(X) from (x, y) over dt.

This is the single source of truth for both schemes, so StreamLines and direct callers trace identical paths. The 'euler' branch reproduces the legacy x + dt * v update exactly, so the default output never changes.

Parameters​

func​

VectorFunction

The field, mapping (x, y) to [vx, vy]

x​

number

Current X coordinate

y​

number

Current Y coordinate

dt​

number

Step size (virtual time)

integrator​

Integrator = 'euler'

Scheme to use. Default: 'euler'

Returns​

[number, number]

The next [x, y] position