I need to set an alpha value, which is derived of a float value.
I list the pairs of float:alpha below, and I hope you guys can give me a simple correlation:
Float:Alpha
0:0
6:0.5
12:1
18:0.5
24:0
The maximum float value is 24, alpha can't be more than 1. Inbetween values should be something parabolic/sine-like, with high resolution.
I suspect that this all involves a modulo. Please help me!
It would be helpful if you could express the formula in Objective-C syntax.
Thanks
Edit: to make myself clear: The left column is the input value, the right column is the output value.
Paraphrasing David:
"Hi, here is my input: 0, 6, 12, 18,24 and here is my output: 0, 0.5, 1, 0.5, 0. I need to generalize a solution. Halp."