Problem trying to get sin to work in a program

I put together a small program and for the life of me I can't get sin to work properly. Been at it for 3 hours trying to get it done. Any help would be aprreciated.

Usually get the error:
error C2064: term does not evaluate to a function taking 1 arguments

I shortened everything to save room and make it easier to read.

#include <iostream>
#include <math.h>

using namespace std;

const double PI = 3.14159;

int main()

{


double VP;
double PA;

cout << "\nDetermine V of SV" << "\n" <<endl;
cout << "Enter The Peak of SV:" <<endl;
cin >> VP;
cout << "Enter Phase angle degrees:" <<endl;
cin >> PA;

double AIR;

AIR = PA /180 * PI;

double V;
double sin;


V = sin(AIR) * VP; //Probelm is in this line.

cout << "\nThe IV for SV with a PV of" << " " << VP << "\n"
<< " and a Phase Angle of " << " " << PA << " is "<< V << endl;

cout << "Press Enter to Continue." <<endl;
cin.ignore(2);

return 0;
}
Last edited on
I'm not sure, but try to
#include <cmath>
instead of
#include <math.h>
Nah, in my compiler all cmath does is disable the warning and include math.h...the problem is you are delcaring a double called "sin", when there is already a function called that. You also never use it...so just take it out and it should work.
oh, yes, i've overlooked double sin;, shame on me
I've tried both math.h and cmath, I'll try taking out double sin, but I think I'll still have the problem with not declaring it.

I'll let you know.
Wow I knew it was some minute little detail I was overlooking.

This helps more then you know, THANK YOU VERY MUCH!!!
Topic archived. No new replies allowed.