Skip to content

Instantly share code, notes, and snippets.

@micycle1
micycle1 / Triangle Wave Function
Last active November 17, 2018 21:23
Triangle Wave Function
Function for triangle-wave y coordinate (oscillate between 0 and m).
y = m - abs(t % (2*m) - m)
Where:
y = output
m = max value (peak)
t = time