- #1
CBridgman
- 2
- 0
Homework Statement
Hi, I am working on a camera system in flash, and am trying to implement an ease in/out effect where the camera moves between two points, with positive acceleration up to the midpoint, and then negative accelaration up to the end point.
I've had a look through the equations of motion article on wikipedia, and understand how to use the various formulas, but my understanding of how to apply acceleration is not matching what the formulas tell me, and I need to understand why in order to apply the acceleration per frame.
Homework Equations
Consider the following:
Given
u (initial velocity) = 0
v (end velocity) = ?
a (acceleration) = 2
t (time interval) = 5
s (distance) = ?
Calculate end velocity
v = u + at (where: v = ?, u = 0, a = 2, t = 5)
v = 0 + 2 * 5
v = 10
Calculate distance
s = 1/2(u + v)t
s = 1/2(0 + 10)5
s = 5 * 5
s = 25
Right, so fair enough, except that I don't understand how you can end up moving a distance of 25 (an odd number) if you're adding an even acceleration number (2) to the velocity per frame. I.e:
Frame 1. Velocity = 2, Distance = 2
Frame 2. Velocity = 4, Distance = 6
Frame 3. Velocity = 6, Distance = 12
Frame 4. Velocity = 8, Distance = 20
Frame 5. Velocity = 10, Distance = 30
(Per frame, I go: velocity = velocity + acceleration)
Since the camera is moved in discrete time intervals (for the simplicity's sake, let's say it's running at one frame per second), I must add the acceleration constant to the velocity in the manner shown above, which produces a distance value that doesn't equal what the equations are telling me.
The Attempt at a Solution
Well, after filling a few pages with calculations, I decided I'd try ask here. ;)
Could anyone please tell me where I'm going wrong?
Last edited: