I am using this function to get centroid of an irregular shape polygon however when the polygon is an L shape the point is outside.

```
function get_polygon_centroid(pts) {
    var first = pts[0], last = pts[pts.length-1];
    if (first.x != last.x || first.y != last.y) pts.push(first);
        var twicearea=0,
        x=0, y=0,
        nPts = pts.length,
        p1, p2, f;
        for ( var i=0, j=nPts-1 ; i<nPts ; j=i++ ) {
            p1 = pts[i]; p2 = pts[j];
            f = p1.x*p2.y - p2.x*p1.y;
            twicearea += f;          
            x += ( p1.x + p2.x ) * f;
            y += ( p1.y + p2.y ) * f;
        }
        f = twicearea * 3;
    return { x:x/f, y:y/f };
}

```

My points are:

```
(-37.81418,145.13025000000002),
(-37.814330000000005,145.13022),
(-37.813970000000005,145.12727),
(-37.813750000000006,145.12543000000002),
(-37.813680000000005,145.12478000000002),
(-37.81152,145.12517000000003),
(-37.809380000000004,145.12558),
(-37.80951,145.12675000000002),
(-37.80953,145.12685000000002),
(-37.810590000000005,145.12667000000002),
(-37.812630000000006,145.12631000000002),
(-37.81275,145.12628),
(-37.81324,145.13026000000002),
(-37.81326,145.13044000000002),
(-37.81418,145.13025000000002)

```

I would like to get a point inside the polygon which is far enough off the boundary if possible.