jax-js
    Preparing search index...

    Function trapezoid

    • Integrate along the given axis using the composite trapezoidal rule.

      If x is provided, the integral is computed with respect to those sample points. Otherwise, the samples are assumed to be evenly spaced with step dx. Both x and dx may be arrays that broadcast against y.

      Parameters

      • y: ArrayLike

        Values to integrate.

      • x: ArrayLike | null = null

        Optional sample points corresponding to the y values.

      • Optionalopts: { axis?: number; dx?: ArrayLike }

        Options dx, the spacing between samples when x is not given (default 1), and axis, the axis to integrate along (default -1).

      Returns Array