Move the point P with your mouse. If we were to plot a graph using the slope of the tangent at the various points P we would end up with a cosine curve as shown below.