Mercurial Hosting > traffic-intelligence
comparison python/moving.py @ 253:44704f53ffc8
Fusion
author | Jeep-Tour@Jeep-Tour-PC |
---|---|
date | Mon, 23 Jul 2012 12:35:35 -0400 |
parents | 99173da7afae |
children | 59f547aebaac |
comparison
equal
deleted
inserted
replaced
252:933e400ee53b | 253:44704f53ffc8 |
---|---|
229 scatter([p.x for p in points],[p.y for p in points], c=color) | 229 scatter([p.x for p in points],[p.y for p in points], c=color) |
230 | 230 |
231 | 231 |
232 def predictPosition(nTimeSteps, initialPosition, initialVelocity, initialAcceleration = Point(0,0)): | 232 def predictPosition(nTimeSteps, initialPosition, initialVelocity, initialAcceleration = Point(0,0)): |
233 '''Predicts the position in nTimeSteps at constant speed/acceleration''' | 233 '''Predicts the position in nTimeSteps at constant speed/acceleration''' |
234 return initalPosition+velocity.multiply(nTimeSteps) + initialAcceleration.multiply(nTimeSteps**2) | 234 return initialPosition+initialVelocity.multiply(nTimeSteps) + initialAcceleration.multiply(nTimeSteps**2) |
235 | 235 |
236 | 236 |
237 class FlowVector: | 237 class FlowVector: |
238 '''Class to represent 4-D flow vectors, | 238 '''Class to represent 4-D flow vectors, |
239 ie a position and a velocity''' | 239 ie a position and a velocity''' |