[vtkusers] TriangleArea() return the not correct value.

David Cole dlrdave at aol.com
Thu Sep 4 06:42:43 EDT 2014


Good -- glad I was just misinterpreting your email...

By the way, the comment "Heron's formula requires applying sqrt() four 
times" is because to use that formula, you need to calculate the length 
of each side of the triangle, so that requires 3 sqrt() calls, one for 
each side. The last sqrt() call comes from applying the formula itself.

With the cross product technique, there are six possible permutations 
of cross product, depending on which vectors you choose to do the cross 
product: a x b, a x c, b x a, b x c, c x a, and c x b. I think you will 
still hit a math problem with some of the permutations for your extreme 
case, won't you? If so, then whether or not your result is acceptable 
depends on being lucky about which permutation you choose.


David C.



More information about the vtkusers mailing list