Calculating azimuth from equatorial coordinates
lat2 = 0 and lmst = 0 place the vernal equinox at the zenith, so most points on the ecliptic should have azimuth either obliq degrees north of east or obliq degrees south of west. Try other values for lat2 or lmst and see if the resulting azimuths make sense.