I'm trying to port a script from R into PHP but not sure what lines 3 and 4 (taken from the larger function discussed here) are doing. Looks like logical operations and array definition at the same time. Can someone please give me the equivalent in PHP?
cosAzPos <- (0 <= sin(dec) - sin(el) * sin(lat))
sinAzNeg <- (sin(az) < 0)
az[cosAzPos & sinAzNeg] <- az[cosAzPos & sinAzNeg] + twopi
az[!cosAzPos] <- pi - az[!cosAzPos]