The Squaresine Function
Just as Sine plots the height of a point on the unit circle as a function of the distance the point has moved along the perimeter starting at (1, 0), Squaresine plots the height of a point on the unit square as a function of the distance the point has moved along the perimeter starting at (1, 0).
You can get a new periodic function with period 8 by using the same rule starting with a rotated unit square. Before you drag point A to change the orientation of the square, try to predict what the new periodic function will look like.