The horizontal angle is the azimuth, which is the number of degrees clockwise from North (0 = North; 90 = East, 180 = South, 270 = West) and the vertical angle is the elevation above the horizontal (0 = horizontal; +90 is up; -90 is down). I can't make it clearer than that!
_horizontalAngle, in my algorithm, is given in a range of -180 to 180, which is the normal mathematical way to show the angle, but not the way angles are normally shown in game or, for that matter, by the military. Normally, directions in ArmA are 0 to 360, such as the result from getDir, so that last line will convert it to a proper azimuth value for consistency. The "horizontal angle" and azimuth can be used interchangably in, say, setDir.