Here’s a tip, you don’t have to consider the angles of those lines.
You make a bounding box surrounding two parallel lines,
Then your problem will be solved
The bounding box is parallel to the direction of your line, and the middle line is the center line you want including the farthest point.