[Gambas-user] using Sin() to produce a specific range of values

Kevin Fishburne kevinfishburne at ...1887...
Sun Jul 10 07:37:39 CEST 2011


Again my thick skull prevents me from figuring this out, even with 
Google searches.

I need to use the Sin() function to calculate an output range from an 
input range. The advantage of Sin() is that it's not linear; it makes a 
nice smooth curve of values sort of like a sound wave in an audio editor.

I need to produce an output range of values from 0 to 255, then back 
from 255 to 0. A linear example would be:

0, 31, 63, 95, 127, 159, 191, 223, 255, 223, 191, 159, 127, 95, 63, 31, 0

Sin()'s output should start at 0, peak at 255, then go back down to 0. 
The input range I can control so whatever is easiest or most efficient 
will work fine.

The Greek symbols in the official math references are a bit much for 
what should be a simple equation rather than a math lesson. ;) Any help 
is appreciated as always.

-- 
Kevin Fishburne
Eight Virtues
www: http://sales.eightvirtues.com
e-mail: sales at ...1887...
phone: (770) 853-6271





More information about the User mailing list