|
Post by Wolfeattehkitty on Jun 17, 2007 3:28:49 GMT -5
Ok im trying to make a simple program in c++ That uses a formula with inputs to calculate shot distances in pixels. So far here is my formula lines in c++. Z = V*V; U = sin(2*B)*Z; R = U/g;
In essence it should be the same as saying V^2*sin(2*B)/g
|
|
|
Post by WolfeatTehkitty on Jun 17, 2007 3:29:47 GMT -5
Oh and here is my source code #include <iostream> using namespace std; double R,V,B,g,Z,U,K; int main() { cout << "What is The gravity of your shot I would start with 98?: "; cin >> g; cout << "What is The angle of the shot?: "; cin >> B; cout << "What is the power of the shot in pixels?: "; cin >> V; Z = V*V; U = sin(2*B)*Z; R = U/g; cout << "The distance traveled is: " << R << endl; system("PAUSE"); return 0; }
|
|
|
Post by wolfeattehkitty on Jun 17, 2007 3:37:16 GMT -5
Ok now im a member sorry for the triple post but all i need is some one to correct my formula.
|
|