Avoid phi exceed PI/2 to get the negative value of cos(phi).
Attach a file by drag & drop or click to upload