The ratio of the width to the height of a screen is (usually) also the ratio of the two dimensions of the resolution. E.g., if resolution is 1024x768, the ratio of the width to the height is 1024/768 = 4/3.
So, from the resolution, you get the width:height ratio. Suppose it is r (e.g., r = 4/3). From the Pythagorous theorem, we know that the ratio of width to diagonal must be r / sqrt(1 + r^2) and the ratio of height to diagonal must be 1 / sqrt(1 + r^2). Hence, if the diagonal is d, then:
width = d * r / sqrt(1 + r^2)
height = d / sqrt(1 + r^2)
So, from the resolution, you get the width:height ratio. Suppose it is r (e.g., r = 4/3). From the Pythagorous theorem, we know that the ratio of width to diagonal must be r / sqrt(1 + r^2) and the ratio of height to diagonal must be 1 / sqrt(1 + r^2). Hence, if the diagonal is d, then:
width = d * r / sqrt(1 + r^2)
height = d / sqrt(1 + r^2)
-
If you know the resolution, then you know the sides of the screen since the resolution just the number of pixels along the length of the screen times the number of pixels along the width.