right now I am using slope calculations to determine the direction a selected unit needs to go

basically the equation is (x2 - x1) / (x2 - x1) + (y2 - y1)to calculate the ratio of change in x to the total change in position.

(y2 - y1) / (x2 - x1) + (y2 - y1)to calculate the ratio of change in y to the total change in position

I want to see other options of handling direction just to see if I can find a better working way. All I need is to move one point towards the second. I am using C++ of course and the graphics library SFML for rendering and input.