import math


def quadratic_grad(r, h):
    """Implements the gradient of a quadratic kernel function with support radius of 2h."""
    if r/h < 2:
        return 15 / (16 * math.pi * h**4) * (r/h/2 - 1)
    else:
        return 0