Plotting a Parametric Line of Motion
|
07-26-2024, 02:14 PM
Post: #1
|
|||
|
|||
Plotting a Parametric Line of Motion
This program draws a 2D motion plot from an initial starting point (x, y) given initial velocity and acceleration. The rate and direction of both velocity and acceleration are assumed to be constant.
x(t) = ax * t^2 / 2 + vx * t + x0 y(t) = ay * t^2 / 2 + vy * t + y0 where: t = number of seconds. ax = acceleration in the x direction ay = acceleration in the y direction vx = initial velocity in the x direction vy = initial velocity in the y direction The HP Prime PPL program PLOTMOTION displays a traceable curve with a table of values. The Numworks python script plotmtn.py uses math and matplot.pyplot modules. A scatter plot is laid on top of the path plot. The plot begins at the initial point where it is marked green. HP Prime Program: PLOTMOTION Code: EXPORT PLOTMOTION() Source Tremblay, Christopher. Mathematics for Game Developers. Thomson Course Technology. Boston, MA. 2004. ISBN 1-59200-038-X. |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 2 Guest(s)