A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: Simple Exponential Calculation

  1. #1
    Junior Member
    Join Date
    Jan 2009
    Posts
    3

    Simple Exponential Calculation

    I need to calculate a growth slowing as the percentage increases.
    The ratio is :
    60% = +25
    120% = +33
    180% = +37
    240% = +39
    300% = +40
    Which is the logarithmic equation ?
    Please help.
    Thank You!

  2. #2
    Viral tick lordofduct's Avatar
    Join Date
    May 2008
    Location
    South Florida
    Posts
    159
    Well your method is actually asymptotic to 41 which means it isn't a logarithm... anyways log would suck because it give negative infinity at 0

    What you got there is a very contorted form of f(x) = 1 / c^x OR f(x) = c^-x

    Here is what you are looking for:

    c - how much to split by every interval... in your case 2 because you are halving every interval

    p - this is the base amount you are increasing by... in your case it looks to be 32, because from 60 - 120 you raise 8, 120 - 180 you raise 4, then 2, then 1... so I just multiplied by 2 twice more to get the increase value at 0

    i - interval of this increase... in your case .6 or 60%

    b - the base value... when x is at the first interval (zero) what is your adjustment up from the p... note how 25 has no logical comparison to the rest of your values. In your case it looks like 9 to coorolate with p properly

    x - the percentage value

    This equation assumes that 9 is the value you want at 0 (which is twice the increase from 60% - 120%)

    anyways:

    value = -p * (c ^ -(x / i)) + p + b

    or

    value = -32 * (2 ^ -(x/.6)) + 32 + 9

    what we did:
    took the 2^-x

    first divide x by the interval i to squeeze the curve horizontally
    multiply it by -1 to flip it over
    multiply again by p to stretch it vertically for your scale
    add on p and b to move it up and put the asymptote where you need it




    With some more values thrown in (like 0 position), this equation might change completely... but from what you gave me this is the most logical equation I can see.
    Last edited by lordofduct; 02-08-2009 at 10:42 PM.
    I do not vow to know everything, and I can not guarantee what I say is correct. We are all learning, and I actually thank you the one with the questions for asking and stimulating my mind.

    www.lordofduct.com - check out my blog, or contact me through my website. I'm always available for freelance work in Flex3/Actionscript 3.

    how many times must I say it... the livedocs are your friend!
    http://livedocs.adobe.com/flash/9.0/...l-classes.html

  3. #3
    Viral tick lordofduct's Avatar
    Join Date
    May 2008
    Location
    South Florida
    Posts
    159
    oh and if you want it to third, or 4th, or anything like that every interval... just change 2 to the reciprocal of the split you want (note 2 is the reciprocal of halfing)

    so thirds would be 3
    4ths would be 4
    etc
    I do not vow to know everything, and I can not guarantee what I say is correct. We are all learning, and I actually thank you the one with the questions for asking and stimulating my mind.

    www.lordofduct.com - check out my blog, or contact me through my website. I'm always available for freelance work in Flex3/Actionscript 3.

    how many times must I say it... the livedocs are your friend!
    http://livedocs.adobe.com/flash/9.0/...l-classes.html

  4. #4
    Member
    Join Date
    Feb 2010
    Posts
    59
    I think you may use a natural log or the interest rate formula. I will look it up and make a tutorial. I have made one on logarithms.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center