# Can Grapher plot periodic functions, other than trigonometric ones?

That is, something like:

f(x) = f(x+c)

Where `c` is an arbitrary constant. Examples: How might I get grapher to chart this or select an appropriate tool to visualize these functions?

• This is essentially a mathematical question. The answer isn't specific to Grapher.
– user101978
Aug 25 '18 at 17:36
• I'm voting to close this question as off-topic because it doesn't apply to Apple hardware or software. Aug 25 '18 at 20:08
• This is totally on topic here. Using any software on covered hardware is explicitly allowed and encouraged. See help center for details. Ask, an answer explaining how this is about math and not about grapher might be the correct answer to post here as an answer and not just a comment.
– bmike
Aug 25 '18 at 20:58

• Square wave: try something like `y = (-1)^round(x)`(but with proper formatting). Something like `y = (round(x+0.5) - round(x)) - 0.5` would also work.
• Sawtooth wave: try something like `y = x mod 1` or, more elaborately, `y = 2((x-0.5) mod 1) - 1`. However, something like `y = x - round(x)` would also work. If you don't like any of these, try something like `y = x - floor(x)`.
• Awesome, thanks! If anyone reads this comment, you can also find some really good stuff in the menu bar under `Examples`. There's one item for periodic functions. Aug 25 '18 at 22:11