Good morning everyone,
I'm writing my first program using windows form. i have included math.h.
when evaluation a cosinus of a number. the value i get is wrong, i have searched all over the internet for a solution for that. i need help, here is a portion of my code:
y=ib*cos(phi);
if my phi is 1.57 and ib is 2 i should get 1.59e-03 for y. i get something like 3.58e-009.
Please i need help debuging this, i'am a mechanical engineer. this is my first program. i have basics in c++ but it's limited to function and loops. this first program i first coded it in c++ in a console windows. everything workd fine. as soon as i wanted to give it a graphical interface, it's not working as it should. i'm using visual c++ by the way.
Thanks for replying,
the phi is in degrees. i converted it into radian using phi*pi/180.
either ways, when i put that on my calculator, it gives me a different value, than the 3.58e-009. (radians or degrees)