Periodic function defined on [a,b]
Scripting
initial = -1
final = 1
period = abs(final-initial)
#-- Main function. You can modify this one!--#
f(x) = abs(x) + x
SetVisibleInView(f, 1, false)
#-- Auxilary functions --#
g(x) = If(initial <= x <= final, f)
SetVisibleInView(g, 1, false)
middle = initial + (final-initial)/2
r(x) = ((x - middle) / period - round((x - middle) / period, 0)) period + middle
SetVisibleInView(r, 1, false)
#-- Periodic function based on f(x)--#
h(x) = g(r(x))