Double integral over triangle with known nodes

by Zhigang Wei
Tags: double, integral, nodes, triangle
Zhigang Wei
Zhigang Wei is offline
Jan17-12, 07:30 PM
P: 1
I am wondering is there any general analytic solutions to the following integrals

First moment of area

Second moment of area)

Over the triangle (x1,y1) (x2,y2) (x3,y3)


Phys.Org News Partner Science news on
NASA's space station Robonaut finally getting legs
Free the seed: OSSI nurtures growing plants without patent barriers
Going nuts? Turkey looks to pistachios to heat new eco-city
HallsofIvy is offline
Jan18-12, 02:53 PM
Sci Advisor
PF Gold
P: 38,882
It looks like basic Calculus III with some attention to different cases (x1< x2< xc3 or x1< x3< x2, etc.).

Assuming that x1< x2< x3 and that y2 is larger than either y1 or y3, We can integrate from the line between (x1, y1) and (x3, y3) to the line between (x1, y1) to (x2, y2) for x going from x1 to x2, then from the line between (x1, y1) and (x3,y3) to the line between (x2,y2) and (x3,y3).

The line between (x1, y1) and (x3, y3) is given by y= y1+ ((y3- y1)/(x3-x1))(x- x1) and the line between (x1, y1) and (x2, y2) is given by y= y1+ ((y2- y1)/(x2- x1))(x- x1) so that first integral would be
[tex]\int_{x= x1}^{x2}\int_{y= y1+ ((y3- y1)/(x3- x1))(x- x1)}^{y1+ ((y2-y1)/(x2-x1))(x- x1)}f(x,y) dydx[/tex]
where f(x,y) is x, y, x^2, y^2, or xy.
dragozarkovic is offline
Jan19-12, 01:27 PM
P: 2
I suppose this will work for given type of triangle, I am not going to check it. But most people need universal solution. I took me a lot of time to get to this and it works (all is written in Matlab code).

Lets say you have triangle (x1,y1) (x2,y2) (x3,y3) and you want to calculate integral I=x^2+y^2 over it.

First you need to declare:

Then simple do integral I1=u*I(v) from 0 to 1, and then I2=I1(v) from 0 to 1. And then you have to multiply result by 2 areas of triangle.

This works great for me i tested it, and I get great results. Matlab code would be something like this:

syms x1 y1 x2 y2 x3 y3 x y u v
A=(x2*y1 - x1*y2 + x1*y3 - x3*y1 - x2*y3 + x3*y2)/2;
%A is area (watch for orientation of nodes clockwise/counterclockwise

Let me know what you think

dragozarkovic is offline
Jan21-12, 06:51 AM
P: 2

Double integral over triangle with known nodes

%this way you went form x,y to u,v

%concerning first change from x,y to u,v I should be:
%I=(u*(v*x3 - x2*(v - 1)) - x1*(u - 1))^2 + (u*(v*y3 - y2*(v - 1)) - y1*(u - 1))^2

A=(x2*y1 - x1*y2 + x1*y3 - x3*y1 - x2*y3 + x3*y2)/2;
%A is area of triangle (watch for orientation of nodes clockwise/counterclockwise not to get negative area)

%first integral ∫u*I(v) from 0 to 1
%solution is:
%I1=(u^3*(x2 - x3)^2)/3 + (u^3*(y2 - y3)^2)/3 + u*(u*x2 - x1*(u - 1))^2 + u*(u*y2 - y1*(u - 1))^2 - u^2*(u*x2 - x1*(u - 1))*(x2 - x3) - u^2*(u*y2 - y1*(u - 1))*(y2 - y3)
%notice that there is no longer v

%twice area of triangle times second integral ∫I1(u) from 0 to 1
%solution is:
%I2=-(x1*y2 - x2*y1 - x1*y3 + x3*y1 + x2*y3 - x3*y2)*(x1^2/12 + (x1*x2)/12 + %(x1*x3)/12 + x2^2/12 + (x2*x3)/12 + x3^2/12 + y1^2/12 + (y1*y2)/12 + (y1*y3)/12 + y2^2/12 + (y2*y3)/12 + y3^2/12);
%finally you got solution without x, y, u or v just through nodes of triangle

Register to reply

Related Discussions
ANSYS - section nodes and global nodes General Engineering 2
Using polar co-ord. to change double integral into single integral involving only r. Calculus & Beyond Homework 5
convert triangle vertices to double integral polar coordiantes Calculus & Beyond Homework 3
Pressure nodes and displacement nodes Classical Physics 0
Integral, Triangle areas? Calculus 16