Some functions for use in Graphwar
(Work in progress)
Credit to: My schooling, and https://youtu.be/E_MmkxTO5kg (kudos to whoever chose the music for this video)
NOTE: I am not a mathematician. I apologise for any errors.
y = mx
Where m
is the gradient.
y = a(x-h)^2
where a
is the dilation and (h, k)
is the co-ordinate of the turning point.
y = a*abs(x-b)
where a
is the slope and b
is the x coordinate of the turning point.
Absolutes can be chained by simply adding (or subtracting) them together.
y=a*abs(x-b)-a*abs(x-c)
or ((h/2)/(b-c))(abs(x+b)-abs(x+c))
where a
is half of the gradient, h
is the total height of the slope, b
is the x coord of the slope's start, and c
is the x coord of the slope's end.
y = a/(1+(x-b)^2)
where a
is the amplitude of the spike (pos = up, neg = down) and b
is the x coordinate of the spike's tip.
y = a*sin(b*(x-c))/(b*(x-c))
where a
is the amplitude of the spike, b
is the frequency, and c
is the x coordinate.
y = k/(1+exp(a*(x-c)))
where k
is the height of the step, a
is the steepness of the step, and c
is the x coordinate of the step.
y = a*sin(bx)
where a
is the amplitude and b
is the frequency.
sin(kx)/(1+exp(-a*(x+c)))
where k
is frequency, a
is the rate at which to wave starts, and c
is the x coord of the beginning of the wave.
y = (a*exp(b*sin(kx)))/(1+exp(-j*(x+c)))
where a
is top amplitude, b
is top and bottom amplitude, k
is spike freq, j
is spike progressive height, c
is the x displacement from center.
Delayed sine is
(h*sin(kx))/(1+exp(-a*(x-c)))
the variables are self explanatory.