buggy1
that represents one of those nifty red constant velocity buggies that you may have used in class. Let's create that Particle in the Initial State pane:buggy1
- is actually moving. Go to the Calculations pane and add this line of code:buggy1
moving and now we can plot its position as a function of time.g_xpos
to represent our graph, we can now tell our graph to plot some points. The basic syntax looks like this:g_xpos.plot(independent variable, dependent variable)
t
. The X position of the buggy is our dependent variable. But just as was the case with LoggerPro, for a single plot, we can only plot a single dimension per plot command. The problem with this is that the particle's position is a matrix - it is inherently two dimensional. So for example, this code won't work:plot
command always needs to be placed in the Calculations pane because it is actually a repetitive calculation that the simulation tool must perform each frame.buggy2
using its velocity like this:g_ypos
. How would you now plot the Y positions of the two particles on this new graph? Here are the remaining goals you should try to achieve: