docs: function limit(out, a, max) {
    var mSq = a[0] * a[0] + a[1] * a[1];
  
    if (mSq > max * max) {
      var n = Math.sqrt(mSq);
      out[0] = a[0] / n * max;
      out[1] = a[1] / n * max;
    } else {
      out[0] = a[0];
      out[1] = a[1];
    }
  
    return out;
  }