Reply To: Spikey’s Math Lab

Forum Archive Spikey’s Math Lab Reply To: Spikey’s Math Lab

#64352
spikeyxxx
Participant

    @adrian2301 treating it as a math question; you can write every curve as a mathematical expression. In your example that would be a cubic formula, but you could approximate it with a quadratic one like so:

    You have 3 points given on that curve (I simplified the numbers a bit), so if the expression you are looking for is of the form:

    ax² + bx + c

    then you get 3 equations:

    for x= -0.5:      0.25a +  (-0.5)b + c  = -1

    for x=0:                                                  c = 0.5

    for x= 1:                      a +              b + c = 1

    You know c from the second equation, so you are left with a and b, but multiplying the first one with 2 and adding it to the third one gets rid of the b, therefor you can evaluate a and from there you can calculate b.

    Had to make a correction, b/c your curve is not quadratic, but cubic, but….

    The thing is, in general, if it has to be exact, you’re in trouble, but to approximate a curve can be as difficult as how good the approximation has to be 😉