Function of distance to a moving object

171 Views Asked by At

I have few problems, I'll try to split them in an understandable way. If you are good at linear algebra, could you take a look at the second part? (Both questions are clickable links.)

(1) Two objects are situated at a arbitiary distance from one another. One is immobile (A), one is moving (B) at a constant velocity (Bv). What is the distance (d) between them at a given time?
The distance can be a scalar or a vector, either one helps. Thanks!

(2) Two same objects, but at a given time, B wants to move straight toward A with a certain speed (a). We want to find the vector (V) along which we apply the acceleration force
Think: I'm a rocket inside an asteroid formation, in a few seconds I'd like to move straight towards THAT asteroid. Which direction should I face and how long should I use my thrusters?

[PS 1] The function is meant to be used by computer script, so try to go easy on usage of square roots :)