В чём моя ошибка?
function MakePoint() {
this.x = Math.round(Math.random() * 200);
this.y = Math.round(Math.random() * 200);
};
function getLengthBetween(point1, point2) {
return Math.sqrt(Math.pow((point1.x - point2.x), 2) + Math.pow((point1.y - point2.y), 2))
};
function doesTriangleCanExist(p1, p2, p3, p4, p5, p6) {
var len1 = getLengthBetween(p1, p2);
var len2 = getLengthBetween(p3, p4);
var len3 = getLengthBetween(p5, p6);
if (len1 < (len2 + len3) && len2 < (len1 + len3) && len3 < (Len1 + len2)) {
return true;
} else {
return false;
}
}
console.log(getLengthBetween(new MakePoint(), new MakePoint(), new MakePoint(),
new MakePoint(), new MakePoint(), new MakePoint()));