Surface of revolution in c++