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 - The Fusion of Science and Community**

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 - graphing problem | Date |
---|---|

Gambit graph | Dec 3, 2017 |

How should I represent a financial market as a graph? | Mar 10, 2017 |

Line Styles in a Graph in MATLAB | Jan 26, 2017 |

Winnie the Pooh Graph Problem | Jun 9, 2011 |

Problems on running graph with c | Feb 18, 2008 |

**Physics Forums - The Fusion of Science and Community**