مرحبا اخواني واخواتي ...
والله اتمنى منكم انكم تساعدوني في تصحيح الكود ولكم جزيل الشكر والله بتنقذون حياتي ....
#include
#include
using namespace std;
float A,B,R,x,y,z,Ax,Ay,Rx,Ry,Bx,By;
int main()
{
cout<<"Enter the magnitude of vector A(A is the first displacement that the man pushs)"< cin>>A;
cout<<"Enter the angle of dgrees which with the positive x-axis "< cin>>x;
cout<<"Enter the magnitude of resultant displacement R "< cin>>R;
cout<<"Enter the angle which is directed with the positive x-axis "< cin>>y;
if ((A!=0) && (R!=0))
{
Ax= A*cos(x);
Ay= A*sin(x);
Rx= R*cos(y);
Ry= R*sin(y);
Bx=Rx-Ax;
By=Ry-Ay;
B= sqrt(pow(Bx,2)+pow(By,2));
z= cos(By)/sin(Bx); //to find the angle
}
else
{
cout<<" A and R can't be zero ";
}
cout<<"The magnitude of vector B(B is the second displacemet) is: "< cout<<"The direction of vector B is "< return 0;
}