3

I’m in C.S. and I need a function f(x) that calculates the value for brightness.

Its values goes from 0 to 1, in the beginning it progresses linearly, then it starts slowing down halfway and keeps slowing down the closer it goes to 1.

sketch

What is a function that looks similar to this?

Rócherz
  • 3,976
Jocko
  • 133
  • 2
    More info needed. at which x value do you want it to reach 1/2? And does it actually reach 1 at some point beyond that, or is it only asymptotic to 1? – coffeemath Oct 11 '22 at 10:31
  • Is a sigmoid function not what you want? – Toby Mak Oct 11 '22 at 10:35
  • In the program, I'm gonna need to introduce another parameter, which determines what x this threshhold is actually met. For example if the parameter is set to 5, it will start slowing when x = 5, so that it's adjustable. Right now you can assume it's at like 4. – Jocko Oct 11 '22 at 10:36
  • It preferable can't hit 1 either. – Jocko Oct 11 '22 at 10:38

1 Answers1

2

There is not a specific function that always goes linear at the beginning, slows halfway in, and then converges to 1. However, a general function that has this behavior is $f(x) = x/(1+x)$.

Rócherz
  • 3,976