Chalkboard - v3.0.1
    Preparing search index...

    Function definition

    • Plots a 2D scalar function, a parametric curve, or a complex function.

      Parameters

      • func: ChalkboardFunction

        The function

      • config: {
            context: CanvasRenderingContext2D;
            domain: [number, number] | [[number, number], [number, number]];
            isInverse: boolean;
            isPolar: boolean;
            lineWidth: number;
            res: number;
            size: number;
            strokeStyle: string;
            x: number;
            y: number;
        }
        • context: CanvasRenderingContext2D

          Optional custom canvas context to draw on

        • domain: [number, number] | [[number, number], [number, number]]

          Domain over which to plot (in units of the function, not pixels)

        • isInverse: boolean

          Whether to plot the inverse of the function (only for scalar2d)

        • isPolar: boolean

          Whether to plot in polar coordinates (only for scalar2d)

        • lineWidth: number

          Stroke width

        • res: number

          Resolution (distance in pixels between sampled points), higher values result in faster plotting but less smooth plots

        • size: number

          Scale, defaults to 1, divided by 100 internally for finer control

        • strokeStyle: string

          Stroke color

        • x: number

          x-offset (canvas translation), defaults to canvas center

        • y: number

          y-offset (canvas translation), defaults to canvas center

      Returns number[][]