Consider the right triangle { (200,0) (350,300) (350,0) }
(see the illustration below).
Since the big and the small triangles sharing the (Xb, Yb)
corner are similar, the ratio of the length of the red side (X,Y)-(Xb,Y)
to the length of (Xb,Y)-(Xb,Yb)
is the same as the ratio of (Xa,Ya)-(Xb,Ya)
to (Xb,Ya)-(Xb,Yb)
.
Since (X,Y)-(Xb,Y)
is your only unknown, you could figure out the answer by solving the equation
Xb-X Xb-Xa
---- = -----
Yb-Y Yb-Ya
Therefore,
(Xb-Xa)*(Yb-Y)
X = Xb - --------------
Yb-Ya