Math algorithm question
        Posted  
        
            by Senica Gonzalez
        on Stack Overflow
        
        See other posts from Stack Overflow
        
            or by Senica Gonzalez
        
        
        
        Published on 2010-05-28T16:34:37Z
        Indexed on 
            2010/05/28
            16:41 UTC
        
        
        Read the original article
        Hit count: 472
        
I'm not sure if this can be done without some determining factor....but wanted to see if someone knew of a way to do this.
I want to create a shifting scale for numbers.
Let's say I have the number 26000. I want the outcome of this algorithm to be 6500; or 25% of the original number. But if I have the number 5000, I want the outcome to be 2500; or 50% of the original number.
The percentages don't have to be exact, this is just an example.
I just want to have like a sine wave sort of thing. As the input number gets higher, the output number is a lower percentage of the input.
Does that make sense?
© Stack Overflow or respective owner