Scaling issue

Niallneedshelp

New member
Joined
Feb 26, 2021
Messages
1
Hi

i am programming a drawing in excel vba to help me with my work but
im having trouble scaling sizes down to fit on screen and back up again to get real measurements

this is a simplified example of what im doing but the programme is completely dynamic so the percentage and the divisor can be different

I have a starting size e.g. 424 which i need to shrink by 40% = 254.4. i then need to dived it by e.g 2 =127.2 .now i need to scale this back up so it accurately represents the divided value of 424/2. if i increase 127.2 by 40% i get 177.8 when correct answer is 212.

i know the answer is probably simple

thanks
 
Let's start with [MATH]1[/MATH] and watch what happens to it as we perform each of the transformations you described:
  • Start with [MATH]1[/MATH]
  • Shrink by [MATH]40\%[/MATH] to get [MATH]0.6[/MATH]
  • Divide by [MATH]2[/MATH] to get [MATH]0.3[/MATH]
At this point you want to scale the [MATH]0.3[/MATH] up to [MATH]0.5[/MATH].

You observed that increasing by [MATH]40\%[/MATH] didn't work: [MATH]0.3 * 1.4 = 0.42[/MATH]. The reason for this is that the [MATH]40\%[/MATH] is relative to the number being operated on, which was different when you used it to shrink [MATH]424[/MATH] than it was when you used it to increase [MATH]127.2[/MATH].

The correct scaling ratio is [MATH]\frac{0.5}{0.3} \approx +66.7\%[/MATH]. This is what it takes to scale [MATH]0.3[/MATH] to [MATH]0.5[/MATH]. Applying this to the number in the example, we get [MATH]127.2 * \frac{0.5}{0.3} = 212[/MATH], the desired result.
 
Top