function Triangle3D(a, b, c) {
this.a = a;
this.b = b;
this.c = c;
}
function Triangle3D(a, b, c) {
this.a = a;
this.b = b;
this.c = c;
}
Calculates triangle area using Heron’s formula http://en.wikipedia.org/wiki/Triangle#Using_Heron.27s_formula
Triangle3D.prototype.getArea = function() {
var ab = this.a.distance(this.b);
var ac = this.a.distance(this.c);
var bc = this.b.distance(this.c);
var s = (ab + ac + bc) / 2; //perimeter
return Math.sqrt(s * (s - ab) * (s - ac) * (s - bc));
}
module.exports = Triangle3D;