Menu

#464 Support for self-defined peridodic functions

None
closed-works-for-me
nobody
None
5
2018-10-09
2017-05-28
oliver
No

Would be nice to have a way, to plot self-defined functions, that are periodic.
e.g.
f(x) = (x-a) ^ 3, defined for -2 <= x < 2, and being periodically repeated if x < -2 or x > 2, and that ad infinitum (modulo x-range of that function).

That way a lot of real world functions could be ploted.

Discussion

  • Ethan Merritt

    Ethan Merritt - 2017-05-29
    mod(x) = (x-2)-floor((x-2)/4.)*4.
    plot f(mod(x))
    
     
  • Shigeharu TAKENO

    Another solution:
    mod(x) = (x<-2) ? mod(x+4) : (x>=2) ? mod(x-4) : x
    plot f(mod(x))

     
  • Ethan Merritt

    Ethan Merritt - 2018-10-09
    • status: open --> closed-works-for-me
    • Group: -->
     

Log in to post a comment.