Artificial intelligent assistant

Right coordinates of a slanting line when slope is zero and left coordinates never changed after transformation I have a line in a program I am developing that I want to remove the slant (slope to zero) then get the new coordinates after transformation that removes the slope. This is how the line with the slope looks like together with its coordinates (79, -131) and (158, -111) This is the line without the slope ( when slope=0). How do I get the (x, y) coordinates after the transformation that changes it to a straight line at 180 degrees with no slope (slope = 0)? Note that I do not intend to change point (79,-131). I will gladly appreciate all your help on this.

$$ y-y_A=\dfrac{y_B-y_A}{x_B-x_A}(x-x_A) \iff y+131=\dfrac{-111+131}{158-79}\left(x-79\right) $$

Now Add another line with the negative of the previous slope and passing through the starting point of (79,-131). This transformation will get you a line that has zero slope and runs through the starting point .

I think this is what you are asking for.

Edit:

Initial Length of the line = $\sqrt{20^2 + 79^2} = \sqrt{6641}$

Now to preserve the length Equate $(x-79) = \sqrt{6641}$

$x= 160.4923$

The new coordiates are (160.4923, -131)

Good luck

xcX3v84RxoQ-4GxG32940ukFUIEgYdPy 08f316293dbeff23a1b1ac4c8695bc67