Finding curve's formula having the max the min and the mid?

adrjork's icon

Hi everybody,

my problem is perhaps more a math problem than a max problem... Anyway if you are so kind to help me, this is the question: I have 3 values, the max the min and the mid of a curve, and I need to find the formula to draw the curve, or the 5th argument for [scale], or something similar.

Thanks in advance.

Christopher Dobrian's icon

I think I'm correct in saying:
where
"beg" is the starting value of the curve,
"end" is the ending value of the curve, and
"mid" is the value halfway along the curve,
the exponent "exp" that you seek is
exp=log((mid-beg)/(end-beg))/log(0.5)
and you could replace the 0.5 with any number 0 to 1 to represent any point along the curve, provided you use the appropriate "mid" value that corresponds to that point on the curve.

adrjork's icon

Fantastic Mr. Dobrian! Thank you so much!

This formula comes from which math topic?

Christopher Dobrian's icon

I just "reverse engineered" it from an exponential mapping function.

adrjork's icon

Perfect. Thanks so much!

adrjork's icon

I'm looking for a 2 points [function] object alternative without graphic, because I need to change the (setcurve 1 $1) with a [line 0.] object and this makes function too much heavy.
Using only 2 points (x 0. y 0., X 1. Y 1.) and a float for (setcurve 1 $1) message, which is the formula I could use in an [expr] object in order to replace [function]?

Thanks really a lot.