import cmath instead of math.h

the os x c compiler was complaining that it couldn't find std::sqrt