POV-Ray : Newsgroups : povray.newusers : Mesh and polygons area Server Time
29 Jul 2024 00:37:56 EDT (-0400)
  Mesh and polygons area (Message 21 to 23 of 23)  
<<< Previous 10 Messages Goto Initial 10 Messages
From: Grassblade
Subject: Re: Mesh and polygons area
Date: 5 Nov 2007 15:35:00
Message: <web.472f7d3f881ace7c2d65e3b10@news.povray.org>
Le Forgeron <jgr### [at] freefr> wrote:
> Le 04.11.2007 17:16, alphaQuad nous fit lire :
>
> > apparently I am in similiar company as no else can either.
> >
>
> Stop whining... it won't help to get any result.
>
> > the task:
> > Area = abs(   (xB*yA - xA*yB)  + (xC*yB -x B*yC)+( xA*yC - xC*yA ) ) /2
>
> This formula looks bogus.
>
> We already know that
>
> Area = || AB x AC ||
>            -------------
>                    2
>
> Let's make a numerical application with A(0,-1) B(1,0) and C(0,1)
>
>  abs ( (-1 - 0) + (0 - 1) + ( 0 +1 ) ) /2 ---> abs ( -1 ) /2 --> 1/2
> (wrong)
I get ( (-1 - 0) + (0 - 1) + ( 0 + 0 ) ) /2= -1, which is correct.


Post a reply to this message

From: Le Forgeron
Subject: Re: Mesh and polygons area
Date: 5 Nov 2007 16:36:14
Message: <472f8cce$1@news.povray.org>
Le 05.11.2007 21:30, Grassblade nous fit lire :
> Le Forgeron <jgr### [at] freefr> wrote:
>> Le 04.11.2007 17:16, alphaQuad nous fit lire :
>>> the task:
>>> Area = abs(   (xB*yA - xA*yB)  + (xC*yB -x B*yC)+( xA*yC - xC*yA ) ) /2

>> Let's make a numerical application with A(0,-1) B(1,0) and C(0,1)
>>
>>  abs ( (-1 - 0) + (0 - 1) + ( 0 +1 ) ) /2 ---> abs ( -1 ) /2 --> 1/2
>> (wrong)
> I get ( (-1 - 0) + (0 - 1) + ( 0 + 0 ) ) /2= -1, which is correct.
>
Ok, my fault.

So, I let you with alphaQuad trying to generalize that to 3D.

And I will keep using length(crossproduct(B-A,C-A))/2.

-- 
The superior man understands what is right;
the inferior man understands what will sell.
-- Confucius


Post a reply to this message

From: Grassblade
Subject: Re: Mesh and polygons area
Date: 6 Nov 2007 06:50:00
Message: <web.473053e7881ace7cbc320f9a0@news.povray.org>
Le Forgeron <jgr### [at] freefr> wrote:
> Le 05.11.2007 21:30, Grassblade nous fit lire :
> > Le Forgeron <jgr### [at] freefr> wrote:
> >> Le 04.11.2007 17:16, alphaQuad nous fit lire :
> >>> the task:
> >>> Area = abs(   (xB*yA - xA*yB)  + (xC*yB -x B*yC)+( xA*yC - xC*yA ) ) /2
>
> >> Let's make a numerical application with A(0,-1) B(1,0) and C(0,1)
> >>
> >>  abs ( (-1 - 0) + (0 - 1) + ( 0 +1 ) ) /2 ---> abs ( -1 ) /2 --> 1/2
> >> (wrong)
> > I get ( (-1 - 0) + (0 - 1) + ( 0 + 0 ) ) /2= -1, which is correct.
> >
> Ok, my fault.
>
> So, I let you with alphaQuad trying to generalize that to 3D.
>
> And I will keep using length(crossproduct(B-A,C-A))/2.
>
> --
> The superior man understands what is right;
> the inferior man understands what will sell.
> -- Confucius

I didn't say anything against cross product, did I? It's a useful tool, but it
doesn't work on four or more dimensions. What if I go nuts and want a mesh in
4D?
But to take you up to the task, let's start with the big formula on wikipedia.
With no loss of generality, we can consider A to be in the origin by simply
taking the difference between B and A and C and A. Consequently two of the
determinants are nil, and the square root cancels out with the square. Sarrus'
rule yields: (xB*yC+yB*zC+zB*xC-xB*zC-yB*xC-zB*yC)/2, or
(xB*(yC-zC)+yB*(zC-xC)+zB*(xC-yC))/2. You can reintroduce the coordinates of A
by substitution if you want. I bet that's exactly the same result as the cross
product. :-p


Post a reply to this message

<<< Previous 10 Messages Goto Initial 10 Messages

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.