QUOTE(Magic @ 30 Apr, 2007 - 03:49 AM)

hi. i need help graphing the projectile motion in C++. i need to do it as a sin wave. i got this far but i think the x axis and the y axis are on the opposite sides. can someone plz tell me how to flip this sin wave so it can look like a projectile motion. here is my code. thanx
#include <iostream.h>
#include <iomanip.h>
#include <math.h>
#include <cstdlib>
void main()
{
const float PI = 3.1416;
const int STEPS = 16;
const int SIZE = 15;
const char STAR = '*';
const char BLANK = ' ';
int step;
float angle;
int indent;
char again = 'n';
do
{
system("cls");
cout << " SINEWAVE SAMPLE PROGRAM\n\n";
cin.get();
angle = 0;
indent = 0;
for (step=0; step<=STEPS; step++)
{
angle = (PI) * step / STEPS;
indent = 5.5 + SIZE + SIZE * sin(angle);
cout << setiosflags(ios::showpoint|ios::fixed)
<<setprecision(2)
<< setw(6) << angle/PI << "pi";
for (int i = 1; i <= indent; i++)
cout << BLANK;
cout << STAR << "\n";
}
cout << "Angle\n(radians)\n\n";
cin.get();
system("cls");
cout << "Do you want to run the program again (y/n) ??? ";
cin >> again;
}
while ((again == 'y') || (again == 'Y'));
return;
}
how can can simulate your code in a vertical motion? a ball from the ground..