javascript - Relative "crossing" percent calculation -
I have this math problem: I should know the formula to get something like this: 70% (x) = 100 150% (x) = 150% of 150% (x) = 50% = 70% of% (x) = 70% 200% (x) = 25% of 70%
It sounds easy, but I'm stuck with this small issue. Please note, For more information, I am computing the offset of an image, the offset should be relative to the resizing. This is an example (the width test is 1920 px, the original offset is 70 px): The final code is in javascript. * Edit * In fact, I need to understand how I increase a value and at the same time synchronize each other Subtract is render (sorry that it is created quickly) I am afraid that it is not at least one linear equation: (x) is a variable and is irrelevant to this calculation.
50% of 1920 = 150 = 150% = 105 100% = 100 = 70% 70 = 70 150% of 1920 = 70% = 50% = 20 = 20% 200 = 25% 70 = 17,5 ...
... 25% ==> 200% 50% ==> 150% 100% ==> 100% 150% == & gt; 50% 200% ==> 25% ...
In fact, for my calculations, "70" is more stable My image is bigger (> 100%) More My offset should be small It also applies in the opposite position (my image is small & lt; 100%, more my offset should be bigger)
Comments
Post a Comment