I'll try to break this up in case the title is too much to digest.
Given two sets of coordinates, how do you find the required velocities of X and Y for one point that will draw a straight line to the other point? I believe this is simple subtraction of the X's and Y's, which gives you the velocities needed to move X1 and Y1 to X2 and Y2. From there, you can find the length of the straight line traveled with Pythagorean's theorem.
More importantly, how do you find the velocities if there is a desired speed across the path of the straight line? The coordinates should be able to change randomly and the speed should stay constant. For the sake of this discussion, let's say the speed should be a length of 6 per one tick of time.
I'm trying to solve this to modify a 2d video game to make the player "shoot" a fireball to where the mouse is pointing. Due to limited functions provided, I need to make this "shoot" functionality myself. The function I am able to leverage only accepts one set of coordinates and velocities for X and Y.
I have #1 down above, but using this function means the farther my mouse is away, the faster the fireball travels. After all, (5,5) and (10,10) shoot at the same angle, but (10,10) travels twice as fast since we are setting velocity here. I need to normalize this across all possible values but I don't know how.
Edit: For others with this same question related to programming, save some time and see if your language has a Vector2.Normalize function as it does the same!