1
$\begingroup$

I'm trying to figure out something observed in a graphic format I'm trying to re-create for programming (please don't send me to SO, they'll just downvote me and send me back here).

It is this: I have $3$ triangles, all with a height multiplier of $5$. So if my constant number is $25$, the height will be $125$. I have different width multipliers: $5, 3, 2$.

If the width multiplier is $5$, then the height of the triangle remains $125$. But if it is $3$, the height of the triangle becomes $116$ (or thereabouts) - or $93\%$ of $125$. And if the width multiplier is $2$, the height of the triangle becomes $114$ (or $91\%$) of $125$.

This is not any kind of math that I know. It's hard to believe that the program that creates these graphics (where I set the $h$ multiplier and $w$ multiplier) is just using a set of seemingly hard-coded percentages (i.e. if $5$ height multiplier has a width multiplier of $5$, $\text{triangle height} = 25 \times 5$, else if $5$ height multiplier has a width multiplier of $2$, $\text{triangle height} = 25 \times 4.56$).

Sorry if this is not entirely clear. I'm happy to give more examples of other height multiplier ($3$ and $2$) that have the same width multipliers ($2, 3$ and $5$).

Actually, let me provide another. Let's take $2 h$ multiplier and $2 w$ multiplier as an example and say the constant is $25$, so $2 h \times 25 = 50$, right? Yes.

  1. Now let's take $2 h$ multiplier and $5 w$ multiplier . Fact: the answer is $72$ (or $144\%$ of $50$). Why?
  2. Let's take $2 h$ multiplier and $3 w$ multiplier . Fact: the answer is $56$ (or $112\%$ of $50$). Why?

The constant both examples is the same : $25$. But it doesn't have to be that number, it could be $15$ or $33$ or $1$. The $\%$ values (like $93\%$ for $5\text{-}3$ or $91\%$ for $5\text{-}2$) produced are consistent)

Does anything here make sense? Is this is even math (i.e. not hard-coded values)?

P.S. Tagging as "trig", but I'm not sure if it is. P.P.S. The issue I'm trying to solve for is (B) on https://msdn.microsoft.com/en-us/library/ff535489(v=office.12).aspx. Just FYI.


EDIT: I input 5 and

  • ...5. Output: 100%
  • ...3. Output: 93%
  • ...2. Output: 91%

I input 3 and

  • 5. Output: 117%
  • 3. Output: 100%
  • 2. Output: 93%

I input 2 and...

  • ...5. Output: 144%
  • ...3. Output: 112%
  • ...2. Output: 100%

How is the output created based on the two input values? Is it math?


EDIT #2: I have some more data with a slightly different set of numbers. Hoping someone here can see a pattern they recognize.

I input 4.5 and...

  • ...5. Output: 120%
  • ...3.5. Output: 139%
  • ...2.5. Output: 168%

I input 3 and...

  • ...5. Output: 135%
  • ...3.5. Output: 149%
  • ...2.5. Output: 175%

I input 2 and...

  • ...5. Output: 164%
  • ...3.5. Output: 169%
  • ...2.5. Output: 187%
$\endgroup$
  • $\begingroup$ Sorry, but what you wrote is not clear at all. What are you trying to do? What is a "multiplier"? What is a "constant number"? I get that you are doing some "scaling". Does that mean you have an image with HxW pixels and you want to scale it? Or do you mean that an existing program is doing the scaling and you are trying to duplicate what it is doing? $\endgroup$ – Somos Dec 21 '17 at 3:36
  • $\begingroup$ Sorry for not being clear. I'm trying to duplicate. I can do it with known values (as above - if 5 and 3, height is 93% of 5 x 25), but I'm trying to figure out if the known values are the result of math. I can put up images to show some of this if that would help. $\endgroup$ – Todd Main Dec 21 '17 at 3:40
  • $\begingroup$ Again, to repeat, what is input and what is output? Do you have a number of HxW pixel input images, and what extra numerical information is being provided to the program? What is the HxW of the output image in pixels? What is a "multiplier"? What is a "constant number"? $\endgroup$ – Somos Dec 21 '17 at 4:09
  • $\begingroup$ Again, sorry, I think I wrote too much. I've edited the post with the basics of what I'm looking for if I give two input numbers, a % value (the output) is created by the program I'm using. Is that program just using those hard-coded % values or is it using math to create those % values (the output) based on the two inputs? $\endgroup$ – Todd Main Dec 21 '17 at 4:58
  • $\begingroup$ Okay, let me see if I understand what you just wrote. You input two positive integers into a program. It outputs a positive real number expressed as a percentage. You are trying to find a way to express this a $f(x,y)=z$ for some mathematical function. It seems $f(x,x)=100\%$. $\endgroup$ – Somos Dec 21 '17 at 5:03
0
$\begingroup$

Okay, it seems we have a function $f(y,x)=z$ where $x,y$ are numbers in $\{2,3,5\}$ and $z$ is written as a percentage. From the example data, it appears that $f(y,y)=100\%.$ It also appears that the function $f$ is monotonically increasing in one variable and decreasing in the other. With just this limited amount of data, you might as well use a lookup table. If there were hundreds of cases, then you might have to be more creative. That is all the advice I have now.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.