How do I calculate the sun's azimuth based on zenith, hour angle, declination, and latitude?
I've confirmed that this formula is in fact correct. I did have the wrong units in the code, which @Glorfindel suggested: sun's hour angle was in hours instead of radians.

I did need to adjust the azimuth's angle offset based on the hour angle:

     // The angle offset needs to be adjusted based on whether the hour angle                                                    
     // is in the morning or the evening.                                                                                        
     //   https://en.wikipedia.org/wiki/Solar_azimuth_angle#Formulas                                                             
     if (hourAngle &lt; 0 || hourAngle &gt; Math.PI) {
         return az;
     }

     return (Math.PI * 2) - az;