The maximum the nail could be from the ground is 3 ft.
We know that cos goes from a max of 1 to a min of -1
The radius of the circle is 1.5
So at it's max it will be 3 ft from the ground and at the minimum 0 from the ground. The displacement from center is the radius or 1.5 ft
The formula for a cos function with a displacement of 1.5 ft is
f(x) = a cos (b) + 1.5
The only function of this form is 1.5 cos (16pix) + 1.5