public float GetArea() { PVector AB = this.V2.Sub(this.V1); PVector AC = this.V3.Sub(this.V1); PVector cross = AB.Cross(AC); double result = Math.Sqrt(cross.X * cross.X + cross.Y * cross.Y + cross.Z * cross.Z) / 2.0; return((float)result); }
public PVector GetNormal() { PVector edge1 = new PVector(V2.X - V1.X, V2.Y - V1.Y, V2.Z - V1.Z); PVector edge2 = new PVector(V3.X - V1.X, V3.Y - V1.Y, V3.Z - V1.Z); PVector normal = edge1.Cross(edge2); return(normal.GetNormalization()); }