I have a scheme on projecting lines on another line, but I don't know how to calculate the points that are projected on the lines.
I want to calculate them using the coordinates of the rectangle corners.
If that's so, then the following may be helpful.
Suppose that has coordinates and that the equation of the line is . Suppose further that is the projection of onto , and that the coordinates of are .
Then, because lies on :
and because :
Substitute from (1) into (2):
Substitute into (1):
So equations (3) and (4) give us the coordinates of Q in terms of and .
Of course, you may be able to simplify these results if you are able to choose a particular origin of coordinates. For example, if the origin can be chosen to lie on the line , then , and equations (3) and (4) simplify to:
Or, if you could also choose two lines at to the axes, then you can make , and the equations would simplify even further to:
I hope this gives you some ideas.