Finding the equation of a periodic function from a graph or sketch