Last active
November 17, 2018 21:23
-
-
Save micycle1/c0266bc06dc79af9427226d435d424cc to your computer and use it in GitHub Desktop.
Triangle Wave Function
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment