Sometimes I know I& #39;m going the long way around with an algorithm, but my brain isn& #39;t awake enough to figure it out.
Today I had code like this:
((width * resizeFactor) * (height * resizeFactor)) / (width * height)
To find out the % of pixels after resizing…
Today I had code like this:
((width * resizeFactor) * (height * resizeFactor)) / (width * height)
To find out the % of pixels after resizing…
I knew it wasn& #39;t ideal, but wasn& #39;t in the mood for maths. If you& #39;re in this situation, boil it down to single-letter variables:
((x * y) * (z * y)) / (x * z)
Then give it to an online equation-solver https://bit.ly/3ddxh5n .
Turns">https://bit.ly/3ddxh5n&q... out all I needed was Math.pow(resizeFactor, 2)
((x * y) * (z * y)) / (x * z)
Then give it to an online equation-solver https://bit.ly/3ddxh5n .
Turns">https://bit.ly/3ddxh5n&q... out all I needed was Math.pow(resizeFactor, 2)
I guess I should have been able to figure it out, but the equation simplifier saved me a lot of time.
Ugh, the link got mangled. Here it is https://cutt.ly/RyGuUUU ">https://cutt.ly/RyGuUUU&q...