次の情報が提供されています。
width = 1920
height = 1080
area = 2073600
ratio = width / height =~ 1.77778
ここで、たとえば、領域が現在のサイズの 25% に縮小したときに、新しい幅と高さを計算したいとします。それでは、次のことがわかります。
area = 0.25 * 2073600 = 518400
height = h (Variable, because it is unknown at the moment)
width = w (Variable, because it is unknown at the moment)
ratio = 1.77778 (Ratio should stay the same or image becomes warped/stretched)
だからあなたは持っています
w / h = 1.77778 (Your unknown new width divided by unknown height equals ratio)
w * h = 518400 (Your unknown width times unknown height equals area)
これで、数学的に比較的簡単に解くことができます。これは、2 つの変数を持つ単純な 2 つの方程式です。
w = 1.77778 * h (from first equation)
(1.77778 * h) * h) = 518400 (by plugging above into second equation)
h =~ 540
w =~ 960
それは理にかなっていますか?