I want to find the x and y of the vertex P2 in below right angle triangle:
I have tried Thales's theorem and triangulation but they all return a very complicated formula to calculate x and y with multiple answers. Since all the parameters of the triangle are known except the vertex P2, I believe there should be only one answer to this question.
Please take into account that the triangle can be anywhere. So assumptions won't work. I saw some people were assuming one vertex on (0,0) position.

Note that $(x,y)$ can be any point on the circle with $P_1R$ as the diameter, i.e.
$$\left(x-\frac{x_{P_1}+x_R}2\right)^2+\left(y-\frac{y_{P_1}+y_R}2\right)^2 =\frac14(x_{P_1}-x_R)^2+\frac14(y_{P_1}-y_R)^2$$
Edit:
If the side lengths are known, then
$$x= x_R + d \cos\theta, \>\>\>\>\> y = y_R - d \sin\theta$$
where
$$\theta = \tan^{-1} \frac {y_{P_1}-y_R}{x_{P_1}-x_R}+ \tan^{-1} \frac hd $$