While decorating your spaceship for Halloween, you have been hit by a meteor. Now you at the outer space moving with the speed of $v_i$. Luckily your spacesuit is equipt with a rocket engine, all you need to do is to set the force power and direction and for how long you wish it to be applied. For the rescue team to notice you, you need to adjust your movement direction toward the north star.
Assume that your mass is 1 KG and it does not reduce once the rocket engine turns on, so acceleration is equaled to engine force in this case.
$$a = \frac{v_f-v_i}{t}$$
$a$ is the acceleration, $v_f$ is your speed after the acceleration, $v_i$ is your current speed and $t$ is the time the engine was on. $a,v_f,v_i$ are vectors and $t$ is a scalar.
Another way to write this will be:
$$v_f=at+v_i$$
The problem is as follow: I know the values of $a$ and $v_i$ and I know the direction of $v_f$ but not it's magnitude, how with this knowledge I can calculate $t$, and is it even possible?
Edit: The vectors are in 2D
Let $\vec x$ be any vector satisfying $\vec x \cdot \vec v_f=0$ and $ \vec x \cdot \vec a \ne0 $
If no such $\vec x$ exists then $\vec a$ is either zero or parallel to $\vec x$, in which cases no solutions exist.
Then $$ 0=\vec x \cdot \vec v_f= (\vec x \cdot \vec a )t + (\vec x \cdot \vec v_i )$$ So $$t = -\frac{ (\vec x \cdot \vec v_i )}{ (\vec x \cdot \vec a) } $$
A good candidate for $\vec x$ would be the component of $\vec a$ that is perpendicular to $\vec v_f$ $$ \vec x = \vec a - \hat v_f (\vec a \cdot \hat v_f )$$
So $$t = -\frac{ (\vec a \cdot \vec v_i ) -(\vec v_i \cdot \hat v_f) (\vec a \cdot \hat v_f ) }{ (\vec a \cdot \vec a) - (\vec a \cdot \hat v_f)^2 } $$