var vs = [
[
76.025390625,
21.207458730482642
],
[
128.14453125,
21.207458730482642
],
[
128.14453125,
46.73986059969267
],
[
76.025390625,
46.73986059969267
],
[
76.025390625,
21.207458730482642
]
]
point =[
77.6953125,
45.336701909968134
]
var bbb = geti(point,vs)
console.log(bbb)
function geti(point, vs) {
var x = point[0], y = point[1];
var inside = false;
for (var i = 0, j = vs.length - 1; i < vs.length; j = i++) {
var xi = vs[i][0], yi = vs[i][1];
var xj = vs[j][0], yj = vs[j][1];
var intersect = ((yi > y) != (yj > y))
&& (x < (xj - xi) * (y - yi) / (yj - yi) + xi);
if (intersect) inside = !inside;
}
return inside;
};