Question

I have a, hopefully, simple question. Im using Nuke to do a linear animation and I have 2 points. point1 @ frame 1 is (5,90) point2 @ frame 10 is (346,204)

Using a linear interpolation type, I want to fiqure out where the x and y point is at frame 30. The way i tried is using the slope formula and then finding the y intercept.

m = (204 - 90) / (346 - 5)
m =  114/341 = .3343

then I got the intercept by:

Y = Mx + b
90 = .3343(5) + b
90 = 1.6715 + b
88.3285 = b

so...I got the formula for my line. y = .3343X + 88.3285

Can someone help me figure out where the point is going to be at any given frame? If you'd please refer to the image attached... you can see image of my graph.

I guess the problem I'm having is relating the time to the coord points.

Thanks

enter image description here

Was it helpful?

Solution

Just consider x as a function of time (t).

Here's some coordinates:

(t, x)
(1, 5)
(10, 346)

and some calculation of the line equation:

x = mt+b

m = (346-5) / (10-1)
m = 341/9

b = 5 - (341/9)*1
b = - 296/9

x = (341t - 296)/9

And using my formula (t -> x) and your formula (x -> y), I can calculate where things are at t=30

t = 30
x = 1103 + 7/9
y = 457.3214
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top