Moving an object towards a point in javascript

Viewed 8299

Im struggling with the maths for this, I need to move an object evenly towards a point. I have a point at x:500 y:250 and an object at 0,0. With a movement speed of '1' how would I work out that to get the that point I would need to move at a rate of x:0.666 and y:0.333. The y speed being half of the x speed. Im sure i am just being an absolute idiot here.

3 Answers
Related