angles.js
function(course) {

      // 0° = N
      // 90° = E
      // 180° = S
      // 270° = W

      var s = this['SCALE'];
      var k = DIRECTIONS.length;

      // floor((2ck + s) / (2s)) = round((c / s) * k)
      var dir = Math.round(course / s * k);

      return DIRECTIONS[mod(dir, k)];
    }
function(course) {

      // 0° = N
      // 90° = E
      // 180° = S
      // 270° = W

      var s = this['SCALE'];
      var k = DIRECTIONS.length;

      // floor((2ck + s) / (2s)) = round((c / s) * k)
      var dir = Math.round(course / s * k);

      return DIRECTIONS[mod(dir, k)];
    }
function ( course ) { // 0° = N // 90° = E // 180° = S // 270° = W var s = this [ 'SCALE' ] ; var k = DIRECTIONS . length ; // floor((2ck + s) / (2s)) = round((c / s) * k) var dir = Math . round ( course / s * k ) ; return DIRECTIONS [ mod ( dir , k ) ] ; }
Calculates the compass direction of the given angle

@param {number} course
@returns {string}
Calculates the compass direction of the given angle