I have two points that I want to connect in a specific way - see the first picture. I know the coordinates of all four points. I then need to move the whole shape to coordinates [0, 0] and rotate it, so the main two points are both on x-axis (see the second picture). Next I need to "squeeze" the shape on the x-axis only so that the last point has coordinates [0, 1] (see the last picture).
My question is - how do I compute the coordinates of the middle two points effectively in Java without getting into manual analytical maths?