Dear Telemac fellows,
I was looking at the code for calculating the sediment sliding.
There is part of the code giving the TRIANGLE AREA.
DO IELEM=1,NELEM
!
I1=IKLE(IELEM,1)
I2=IKLE(IELEM,2)
I3=IKLE(IELEM,3)
!
X2=XEL(IELEM,2)
X3=XEL(IELEM,3)
Y2=YEL(IELEM,2)
Y3=YEL(IELEM,3)
Z2=ZF(I2)-ZF(I1)
Z3=ZF(I3)-ZF(I1)
!
! TWICE THE TRIANGLE AREA
!
DEUXSURF=X2*Y3-X3*Y2
......
ENDDO
I'm wondering is XEL(IELEM,n) arranged in certain order? As far as I know, the area is given differently by:
AREA = abs(X1*(Y2-Y3)+X2*(Y3-Y1)+X3*(Y1-Y2))/2
For example, if in an element,
X1 81082.82 Y1 352921.469
X2 81078.203 Y2 352906.344
X3 81094.32 Y3 352905.25
The area is 124.4103. But according to DEUXSURF, it's -5.7765e+06...
What's the theory behind the calculation of DEUXSURF?
Thanks!
Best regards,
Qilong