export function filter_lanczos3(x) {
    // assume the input is positive

    // if (x < 0) {
    //     x = -x;
    // }

    const lobes = 3;

    if (x > lobes) {
        return 0;
    }

    if (x < 1.1920929e-7) {
        // distance is very close to 0
        return 1;
    }

    const px = Math.PI * x;

    return (lobes * Math.sin(px) * Math.sin(px / lobes)) / (px * px);

}

filter_lanczos3.support = 3;
