Exemple #1
0
        private double          computeAreas(Vector3 restPosV1, Vector3 restPosV2, Vector3 restPosV3, Vector3 thisPosV1, Vector3 thisPosV2, Vector3 thisPosV3)
        {
            double restArea = GeometryFunctions.computeTriangleArea(restPosV1, restPosV2, restPosV3);
            double thisArea = GeometryFunctions.computeTriangleArea(thisPosV1, thisPosV2, thisPosV3);

            //Check the magnitude to scale the areas if they are very small
            double m = Precision.Magnitude(restArea);
            if (m < 0)
            {
                restArea *= Math.Pow(10, Math.Abs(m));
                thisArea *= Math.Pow(10, Math.Abs(m));
            }

            //If there was a deformation
            return (Math.Abs(thisArea - restArea) / (restArea));
        }