增加盒子面积时如何计算宽度和高度
如果我有一个 100 像素宽 x 50 像素高的盒子,那么面积就是 500 像素的平方。如果我想将整体面积增加 20% 或 50% 或其他什么,计算容器新高度和宽度(以像素为单位)的公式是什么?
If I had a box 100px wide by 50px high, so the area is 500px squared. what is the formula for calculating the new height and width of the container in pixels if I wanted to increase the overall area by 20% or 50% or whatever?
我假设你想保持宽度/高度成比例。
如果要将面积增加 20%(乘以 1.20),请将宽度和高度都乘以 1.20 的平方根。
I'll assume you want to keep the width/height proportional.
If you want to increase the area by 20% (multiplied by 1.20), multiply both the width and height by the square root of 1.20.