You must first calculate the distance between the points. For x this will be 500-100 = 400 and the y will be -90.
The ratio of these numbers is −4.444, so for every y value you decrement, the x value must be added with 4,444.
Or for every x value you increment, the y value must be decreased by 0,225.
I hope you will be able to put that into a code, I don't have time for it now.