Consider the fact that if P(x,y) is the unknown point, then when you apply rotation around that point, the point P1(x1, y1) goes to (gets mapped to) P2(x2,y2). From this you can construct equations and solve them to get the x and y. Just lookup the formulas for rotation in the 2D plane. The rotation angles are nice in both cases: 90 and 60 degrees. If you do this, you should get the answers you have posted here.
Say you rotate the point (x1,y1) around the point (a,b) on an angle of $\theta$.
Then the point (x1,y1) gets mapped to (x2, y2) where:
$x_2 = (x_1-a) * cos(\theta) - (y_1-b) * sin(\theta) + a$
$y_2 = (x_1-a) * sin(\theta) + (y_1-b) * cos(\theta) + b$
In your case you don't know the $a$ and $b$, you want to find them.
The $\theta$ is $\pm \pi/2$ and $\pm \pi/3$ respectively.
The $x_1, y_1, x_2, y_2$ - these you know.
Here is how one can solve the case: $\pi/3$. You have 3 more cases to solve.
See also:
Rotation
Rotation matrix
Geometrically speaking, all points that are equidistance from points, p and q, all lie on the perdendicular bisector of pq.
So if $p = (x1, y1)$ and $q =(x2, y2)$ are the points, the line pq has slope, $\frac {y2 - y1}{x2 - x1}$. So the slope of a perpendicular line will have slope m = $- \frac {x2 - x1}{y2 - y1}$ As the line is a bisector, it will contain the midpoint $mid = (\frac{x1+x2}{2},\frac{y1+y2}{2})$. So the perpendicular bisector is the line with the equation $y - \frac{y1+y2}{2} = m(x - \frac{x1+x2}{2}) = y - \frac{y1+y2}{2} = - \frac {x2 - x1}{y2 - y1}(x - \frac{x1+x2}{2})$.
You want to find the points (x,y) where distance((x1,y1),(x,y)) = distance((x2,y2)(x,y)) = distance((x1,y1),(x2, y2)). Where (x,y) are on the line $y - \frac{y1+y2}{2} = - \frac {x2 - x1}{y2 - y1}(x - \frac{x1+x2}{2})$.
So you have three equations:
$y - \frac{y1+y2}{2} = - \frac {x2 - x1}{y2 - y1}(x - \frac{x1+x2}{2})$
$\sqrt{(x1 - x)^2 + (y1 - y)^2} = \sqrt{(x1 - x2)^2 + (y1 - y2)^2}$
and $\sqrt{(x2 - x)^2 + (y2 - y)^2} = \sqrt{(x1 - x2)^2 + (y1 - y2)^2}$
There will be two possible points that satisfy the the equations.
Okay, that's hard. BUT if you are given one of the two points the other will be symmetrically placed on the other side of the midpoint.
Ex: A=(7,3), B=(6,0), and C=(14,−1).
So the midpoint of A and B is M = (6.5, 1.5). C is 14 - 6.5 = 7.5 away from M in the x direction. C is -1 - 1.5 = -2.5 away in the y directions. So the 4th point X will also be 7.5 away in the x direction and -2.5 away in the y direction. So X = (6.5 - 7.5, 1.5 - (-2.5)) = (-1, 4).
Best Answer
Take $P$ to be the origin. Then the equation of the hypotenuse is
$ y = \dfrac{b}{a} x , \hspace{15pt} x \in [0, a] $
Now pick a point $ (x_1, y_1) $ such that $ y_1 \in [0, \dfrac{b}{a} x_1 ], then its perpendicular distance from the hypotenuse is
$d (x_1) = \dfrac{ \dfrac{b}{a} x_1 - y_1 } {\sqrt{1 + \left(\dfrac{b}{a}\right)^2} } = \dfrac{ b x_1 - a y_1 }{\sqrt{a^2 + b^2}}$
So the average distance is
$ \overline{d} = \displaystyle \dfrac{1}{A} \int_{x_1=0}^{a} \int_{y_1 = 0 }^{\dfrac{b}{a} x_1} \dfrac{ b x_1 - a y_1}{\sqrt{a^2 + b^2}} dy_1 dx_1 $
where $A = \displaystyle \int_{x_1=0}^{a} \int_{y_1 = 0 }^{\dfrac{b}{a} x_1} dy_1 dx_1 = \dfrac{1}{2} a b $
Integrating with respect to $y_1$,
$\overline{d} = \dfrac{2}{ab \sqrt{a^2 + b^2}} \displaystyle \int_{x_1=0}^{a} \dfrac{b^2}{2a} x_1^2 dx_1 = \left(\dfrac{b}{a^2 \sqrt{a^2 + b^2}}\right) \left(\dfrac{a^3}{3}\right) =\dfrac{ab}{3 \sqrt{a^2 + b^2}} $