convex hull converted to C++; other 2 functions in convhull.cpp are yet to be finished.