function polygonScale(polygon, scale, origin){
    if (!origin){
      origin = polygonCentroid(polygon);
    }

    var output = [];

    for (var i = 0, l = polygon.length; i < l; i++){
      var v = polygon[i];
      var d = lineLength([origin, v]);
      var a = lineAngle([origin, v]);
      output.push(pointTranslate(origin, a, d * scale));
    }

    return output;
  }
// The origin defaults to the polygon's centroid.
The origin defaults to the polygon's centroid.
The origin defaults to the polygon ' s centroid .
function polygonScale(polygon, scale, origin){
    if (!origin){
      origin = polygonCentroid(polygon);
    }
    var output = [];
    for (var i = 0, l = polygon.length; i < l; i++){
      var v = polygon[i];
      var d = lineLength([origin, v]);
      var a = lineAngle([origin, v]);
      output.push(pointTranslate(origin, a, d * scale));
    }
    return output;
  }
function polygonScale ( polygon , scale , origin ) { if ( ! origin ) { origin = polygonCentroid ( polygon ) ; } var output = [ ] ; for ( var i = 0 , l = polygon . length ; i < l ; i ++ ) { var v = polygon [ i ] ; var d = lineLength ( [ origin , v ] ) ; var a = lineAngle ( [ origin , v ] ) ; output . push ( pointTranslate ( origin , a , d * scale ) ) ; } return output ; }
The origin defaults to the polygon's centroid.
The origin defaults to the polygon ' s centroid .