Celeb Glow
general | April 22, 2026

How to calculate the length of the sides of a rectangle given the diagonal coordinates

$\begingroup$

I have the top left corner and bottom right corner coordinates of a rectangle. The length of the diagonal is just the distance between the top left corner and bottom right corner. How can i solve for the length of the sides of the rectangle.

$\endgroup$ 5

3 Answers

$\begingroup$

There are infinitely many answers with the information given. As you can easily imagine, there are lots of rectangles, of different sizes that have the same diagonal. Certainly, if the sides of the rectangle are $a$ and $b$, and the length of the diagonal is $d$, then $a^2+b^2=d^2$. You're trying to use one number $d$ to find two numbers $a$ and $b$. This should upset you, philosophically. To solve the problem, we need more information. Either the other diagonal, or perhaps you seek only integer solutions...?

$\endgroup$ 3 $\begingroup$

If the two points are $A(x_a,y_a)$ and $B=(x_b,y_b)$ than the sides of the rectangle with sides parallel to the coordinate axis are: $|x_b-x_a| $ and $|y_b-y_a|$.

If $d=\overline{AB}=\sqrt{(x_b-x_a)^2+(y_b-y_a)^2}$, a rectangle that has the sides not parallel to the axis can have a side of length $a \in (0,d)$ and the other side of length $b=\sqrt{d^2-a^2}$

$\endgroup$ 7 $\begingroup$

This is related to Thales' theorem

See the infinite many different pairs of legs here

$\endgroup$

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy