math docs
    Preparing search index...

    Function curl3

    • Curl of a 3D noise vector potential - a divergence-free 3D flow field for volumetric smoke / fluid motion. The three potential components reuse a single sample at large, decorrelating offsets, and the flow is their curl, ∇ × psi, with derivatives taken by central differences of step eps.

      Parameters

      • out: vec3.Vec3

        the receiving Vec3 (the flow velocity)

      • sample: (x: number, y: number, z: number) => number

        the scalar potential noise, sampled at (x, y, z)

      • x: number

        x coordinate

      • y: number

        y coordinate

      • z: number

        z coordinate

      • eps: number = 1e-4

        finite-difference step (default 1e-4)

      Returns vec3.Vec3

      out