errors

getting red line under sqrt and atan in c++ 2010


f_mag= sqrt((fx)^2)+((fy)^2);
theta=atan((fx)/(fy));
closed account (18hRX9L8)
Well for power use pow() function. Also, make sure that fx and fy are floats. And include <math.h> or <cmath>.
atan is correct now but pow is under red line
What does your call to pow() look like, and what are the types of the variables or values used? Please show the code.
This topic continues from this one:

http://www.cplusplus.com/forum/beginner/93590/


@sweetgirl

How are you getting along with the advice I gave you?

Why are you working out f_mag & theta - you already have those, the assignment is asking for the sum of the X & Y values.
Topic archived. No new replies allowed.