And one more suggestion: Instead of defining Pi, use the already available function in math.h: M_PI.