This is an extraordinarily simple question but I can't find the answer so I'm bracing myself for the ridicule.
Given a vector:
(in this case going from 2,3 to 9,9) I want to start at 2,3 and travel up the vector a distance of length l.
How do I calculate the new point (x,y)? Thanks!
Here's the code (after implementing Dmitry's equation):
double MetersMoved = ((Dinosaurs[i].Speed * 1000) / (60 * 60)) * TimeStepInSecs;
double fi = Math.Atan2((Dinosaurs[i].Goal.Y - Dinosaurs[i].Head.Y),(Dinosaurs[i].Goal.X - Dinosaurs[i].Head.X));
Dinosaurs[i].Head.X = Dinosaurs[i].Head.X + MetersMoved * Math.Cos(fi);
Dinosaurs[i].Head.Y = Dinosaurs[i].Head.Y + MetersMoved * Math.Sin(fi);
The dinosaurs are aligning themselves on the correct vector but not advancing (one should be moving 2 pixels and the other about 7).
Dmitry's answer is correct.