# predictiveTrajectory

**URL:** https://forum.kirupa.com/t/predictivetrajectory/327201
**Category:** flash
**Created:** [February 12, 2012, 8:37pm UTC](https://forum.kirupa.com/t/predictivetrajectory/327201 "2012-02-12T20:37:43Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![rimacy](https://avatars.discourse-cdn.com/v4/letter/r/839c29/32.png) [@rimacy](https://forum.kirupa.com/u/rimacy)
#### Post date: [February 12, 2012, 8:37pm UTC](https://forum.kirupa.com/t/predictivetrajectory/327201/1 "2012-02-12T20:37:43Z")

</div>

I’d like to show a predictive trajectory line based on current conditions. I saw Mr. Emmanuel Ferrantos piece on this using box2D. I’m using AS3 and I am a little(read as more than a little)lost as to this step:

[COLOR=#0033FF] **for** [/COLOR] [COLOR=#000000]([/COLOR][COLOR=#6699CC] **var** [/COLOR] i[COLOR=#000066] **:** [/COLOR][COLOR=#004993]int[/COLOR]=[COLOR=#000000] **1** [/COLOR][COLOR=#000066] **;** [/COLOR] i[COLOR=#000066] **\<** [/COLOR]=[COLOR=#000000] **150** [/COLOR][COLOR=#000066] **;** [/COLOR] i[COLOR=#000066] **++** [/COLOR][COLOR=#000000])[/COLOR] [COLOR=#000000]{[/COLOR] world[COLOR=#000066] **.** [/COLOR]StepCOLOR=#000000[/COLOR][COLOR=#000066] **;** [/COLOR] preview[COLOR=#000066] **.** [/COLOR][COLOR=#004993]graphics[/COLOR][COLOR=#000066] **.** [/COLOR][COLOR=#004993]drawCircle[/COLOR]COLOR=#000000[/COLOR][COLOR=#000066]**; [/COLOR][COLOR=#110000] world[/COLOR][COLOR=#000066].**[/COLOR][COLOR=#110000]ClearForces[/COLOR]COLOR=#000000[/COLOR][COLOR=#000066] **;** [/COLOR]

I think that in every update I should calculate 60 positions into the future…

so in each loop i calculate using the position and xVel and yVel (with gravity adjustments)

so maybe an array in which each member has an x and y position. and then i draw a curve using the first and last points???

Any ideas?
