|
![](/i/fill.gif) |
Le 03.11.2007 10:23, Francesco nous fit lire :
> "Francesco" <nas### [at] gmail com> wrote:
>> Calculating area triangle per triangle I can always suppose z=0 (translating
>> and rotating axis) as triangles are 2D. So I think the formula posted by >
>> Penelope20k is good.
>>
>
> If I rotate axis the coordinates are different, so I am really confused : ))
Illumination is on its way... continue.
>
> May be I could also use Eron's formula, Area= sqrt (s(s-a)(s-b)(s-c)).
>
It's Heron... and why do you want to compute the length of the side,
when all you need from the 3 vertices are their coordinaates.
Heron's formula is fine when you only have the lengths.
Actually, from a mesh's triangle:
On one hand, two vectors differences, a cross product, three
squaring, a sum and a square root ending with a division.
On the other end, three vectors differences, nine squaring, three
sums, three square root, an intermediate variable (yet a sum and a
division), then three differences, a product of four element, and a
square root.
Of course, you can use Area = 1/4*sqrt( (a+b+c)(a+b-c)(b+c-a)(c+b-a) )
this will avoid the intermediate variable, but the costy part is
computing the length a, b and c anyway!
--
The superior man understands what is right;
the inferior man understands what will sell.
-- Confucius
Post a reply to this message
|
![](/i/fill.gif) |