I want to move two objects with these equations:
y = m*x
y = (m^2)*x
I want to move them with an equivalent speed. but my problem is that these equations are depend on the axes.And if i use them, i see different speeds.
Should i use from the parametric equations?Any suggestion?
-Ehsan-
Solve for the distance along the curve, you’ll probably have to approximate it, but pythagoras theorem will help you get approximate distance from the last position, scale back give you a new x and iterate a bit.
This problem is relatively easy to solve exactly when using parametric equations:
x = t
y = m*t (or m^2 * t for the other object)
Both objects travel along a straight line, and the length of the line l(t) = tsqrt(1+m^2) (for the first object, for the second l(t) = tsqrt(1+m^4)…)
We want both objects to travel at the same speed when using the same value of t. Let’s assume t is the time in seconds, and we want both objects to travel at v units per second. That means we want l(t) = v*t. So we just have to scale the formulas accordingly:
x = v * t / sqrt(1+m^2)
y = v * m * t / sqrt(1+m^2)
and for the second object:
x = v * t / sqrt(1+m^4)
y = v * m^2 * t / sqrt(1+m^4)
And now the length of the curve is for both objects l(t) = v*t, so both move the same distance in the same time…
EDIT:
Formulas corrected. Forgot a v :rolleyes:
Thank you Angus, thank you Overmind. now i should move the objects with the same velocity.
-Ehsan-
I’m a bit confused.
we say x = t. and l(t)=vt. So x = l(t)/v = (tsqrt( 1+m^2 ))/v --For the first object.
But as you have writte, x = t / sqrt(1+m^2).
-Ehsan-
Whoops, forgot a v in the formula…
x(t) = v * t / sqrt(1 + m^2)
y(t) = v * m * t / sqrt(1 + m^2)
From these formulas, it is obvious that y = m * x, and if you calculate the length with the pythagoras theorem, you get:
l(t) = sqrt(x^2 + y^2) =
sqrt(v^2 * t^2 / (1+m^2) + v^2 * m^2 * t^2 / (1+m^2)) =
sqrt(v^2 * t^2 / (1+m^2) * (1 + m^2)) =
sqrt(v^2 * t^2) = v * t
Remember that these are new x, y different than the ones we started with. We want formulas for x and y so that y = m * x AND the length is v * t.
The original x’(t), y’(t) have the length sqrt(1+m^2), so we have to use x(t / (1+m^2)), y(t / (1+m^2)) instead.
Well.I should say thank you :rolleyes: Another question is about moving in 3D spaces.Are there any good references about moving the models in 3D space?
-Ehsan-