Skip to content

Instantly share code, notes, and snippets.

@paulhayes
Created February 11, 2020 17:04
Show Gist options
  • Save paulhayes/565e9d776b157aeb482f4d74b99016df to your computer and use it in GitHub Desktop.
Save paulhayes/565e9d776b157aeb482f4d74b99016df to your computer and use it in GitHub Desktop.
zigzag oscillating function
int zigzag(int t, int scale){
return abs(scale-((t+scale)%(2*scale)));
}
function zigzag(t, scale){
return Math.abs(scale-((t+scale)%(2*scale)));
}
def zigzag(t, scale):
return abs(scale-((t+scale)%(2*scale)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment