Boxing the compass is the action of naming all thirty-two principal points of the compass in clockwise order. It was also used as in naval slang as a description of a ship (typically one that had lost a rudder or had no one manning it) slowly revolving in a calm sea in a "directionless" manner, thus pointing through all of the compass points, sometimes reversing itself.
Such names, formed by the initials of the cardinal directions and their intermediate ordinal directions, are accepted internationally, even though they have their origin in the English language, and are very handy to refer to a heading (or a course) in a general or colloquial fashion, without having to resort to computing or recalling angle numbers. Despite the name of the 1959 Alfred Hitchcockmovie, North by Northwest, there is no such direction. However, old-timers allow three letter directions to have a 'by' inserted beween the first and second letter. Hence, NNW becomes North by Northwest, per Hitchcock's title.
The set of 32 named points can be further extended to a set of 128 named points using fractions http://www.gwpda.org/naval/boxco000.htm, although these fractional points are nearly unheard of.
A simple algorithm can be used to convert a heading to an approximate cardinal direction:
Divide the heading in degrees by 360 to get the fraction around the circle.
Multiply the result by 32, in the case of 32 named points.
Add 0.5 to center the named points in their respective sectors on the circle.
Since the 32-point set is used, look up the integer part of the result in the table below after adding 1, since north corresponds to 1 in the table below instead of 0.
For example:
A heading of 75°, divided by 45 gives 1.67, multiplied by 4 gives 6.67, added to 0.5 gives 7.17. 8 in the table below corresponds to east by north.