### Need help with magnitude

I need help writing a function for magnitude. I commented it out to see if the polar coordinates would work but i still need to define magnitude before it will work.

 ``123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263`` `````` #include #include using namespace std; //double mag=sqrt((pow(x,2))+(pow(y,2))); double Radius(double x, double y); double Theta (double x, double y); //............................................................ int main(void) { double x = 0; double y = 0; double v=3.0, w=4.0; double m; cout << "Please enter the X coordinate: "; cin >> x; cout << "Please enter the Y coordinate: "; cin >> y; m=mag(x,y); // you need to write this function! cout << "The magnitude of ( "<< x << " , "<< y <<" ) is: " << m << endl; m=mag(v,w); // now get the magnitude of vector (v,w) cout << "The magnitude of ( "<< v << " , "<< w <<" ) is: " << m << endl; } double r, theta; rect2polar(x,y,r,theta); cout << "the polar form of ( "<< x << " , "<< y <<" ) is: ( " << r << " , " << theta << " )"<
Topic archived. No new replies allowed.