C++ implementation convex hull