how to make a sinusoidal function given max min point period