def METHOD_NAME(P1, P2, points):
    """
    Calculate only squared distance, only needed for comparison
    """
    xdiff = P2[0] - P1[0]
    ydiff = P2[1] - P1[1]
    nom = (ydiff * points[:, 0] - xdiff * points[:, 1] + P2[0] * P1[1] - P2[1] * P1[0]) ** 2
    denom = ydiff**2 + xdiff**2
    return np.divide(nom, denom)