Ask your own question, for FREE!
Computer Science 19 Online
OpenStudy (anonymous):

Help please! I'm asked to write a python program to calculate the trajectory of a projectile. I've started writing the program but I'm stuck at the plotting part. I don't know how to store the trajectory points and plot them on graph.

OpenStudy (e.mccormick):

The answer to that depends o a lot of things. Are you using one of the math packages to do this and does it have a plotting part built in? Are you using a graphics package? So on and so forth. If you are just using Python itself, that may be the issue. Without a library to do the work, you will have to start from scratch and that is a big deal. You may want a basic graphics or computational library that has plotting built in. Then you just need to store you data in a way that is appropriate for feeding to that that package.

OpenStudy (espex):

On a basic level you could create two arrays, xArray and yArray, of a length equal to the number of points you're interested in using. Once you populate your arrays you will have a collection of ordered pairs that you can call at will.

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!