Hi,(adsbygoogle = window.adsbygoogle || []).push({});

I've a basic knowledge of c++, but I've never learnt graphing. What little I know, I've picked up myself. Im trying to graph the motion of a projectile launched with a given speed and at a given angle, but the graph doesnt complete. Also, its very spaced out. I know its a parabola so I can recognise it, otherwise, it very broken up. Can anyone tell me a better way to do this? Here's the code:

r=pow(v,2)*(sin(2*a))/10; //Range

s=v*sin(a);

c=v*cos(a);

for(t=0;x<=r;t=t+0.5) /*Here, instead of the range, I've also tried to use total time taken, but still the graph doesnt go to completion*/

{

x=c*t;

y=s*t - 5*t*t;

gotoxy(x,y);

cout<<".";

}

getch();

If anyone wants to see the whole program, Ill put it up.

**Physics Forums | Science Articles, Homework Help, Discussion**

Dismiss Notice

Join Physics Forums Today!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

# C++ graphing problem

Loading...

Similar Threads for graphing problem |
---|

C/++/# Problems with #include<complex.h> |

C/++/# Is it possible to make graphs using C++? |

Running a multidimensional problem on a single core |

JavaScript Problem using dat.GUI controller library |

Gambit graph |

**Physics Forums | Science Articles, Homework Help, Discussion**