Take the 2-minute tour ×
Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

Given:

width: 1920
height: 1080
total pixels: width * height = 2073600
aspect ratio: 1920 / 1080 ~= 1.8

How do I calculate a new resolution (width and height) with the same aspect ratio but a new pixel count? In the other words one that satisifes the following conditions:

width * height = 10000
width / height = 1.8

There are infintely many solutions to that equation system however and I want the solution that most resembles a screen resolution. I suppose that means the solution with the minimum distance abs(widht - height), but I'm not really sure.

share|improve this question
    
You mean W/H = 1.8 and W*H = 10000 then W = 10000/H; 10000/1.8 = $H^2$ and H $\ge 0$, but this gives only one solution –  Ram Jan 14 '13 at 5:26

2 Answers 2

Note that you have two variables, $width$ and $height$, and two equations. There is only one solution.

height = aspect_ratio * width
width / height = aspect_ratio

width * height = total_pixels
aspect_ratio * width² = total_pixels

Solve to $width$ and you have $height$.

share|improve this answer

You have two equations in two unknowns, so there should generally be a unique solution. In your example, you can find width^2=18000, so width is about 134. Then height is about 134/1.8 or about 74. Now the problem is that integer division and square roots are not exact, so you need to specify what you are willing to compromise. 74*134=9916, which is very close to 10000-can you live with that? If not, explore numbers nearby and choose your favorite.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.