You did not constrain anything!!
The format of the restriction should be
if sin(h) = (something here) then what is cos(h)
I think you didnt get what he meant....
He wants to express cos(h) using sin(h)
Using the identity cos2(h)+sin2(h)=1
Then cos(h)=(1-sin2(h))1/2 OR -1*(1-sin2(h))1/2
if -90<=h<=90 then its the first option
if -π/2<=h<=π/2 then its the first option