This will calculate the width and height for a given aspect ratio using JavaScript. You need to supply the hypotenuse (diagonal measurement) and tell me what the ratio is (i.e. 4x3, 16x9). The ratio is basically your width x height. Simply put, calculate 1920 * 9 / 16, you should get 1080. That is a 16:9 ratio. I'll have a Wiki up with all sorts of stuff kids, adults and others can look at.


For those inclined, algebraically speaking:

Height =  hypotenuse * height_aspect_ratio / square_root(width_aspect_ratio^2 + height_aspect_ratio^2)

Width is the same except instead of dividing height_aspect_ratio, you divide width_aspect_ratio instead.

This was found using the law of sines initially and then it struck me that pythagoreans theorem would work just as well. However, law of sines works for angles that aren't Pi/2 or 90 degrees. For the sake of ye olde JS