comparator for point, template for brute and fast