I am pretty sure this can be solved by some basic trigonometry equations but unfortunately I cant figure it out.
What I need is:

Given the x,y coordinates of two points in 2d I need to find the next point on the vector from one point towards another. Basically finding the closest linear path.
For example: on the image above we are given two points, we want to get from blue point to red point moving along path, therefore we need to find the next (gray point) each step until we reach it.
Any help is much appreciated!
Have a look at Bresenham’s line algorithm