Since three.js document recommend using maximum PI/2 for angle, this max() should work correctly in range [0-1] based on cos(0)-cos(PI/2).
If someone choose angle of larger than PI/2 or we enter if-statement because of negative dot product, then base of pow() will become negative.