Results 1 to 1 of 1

Thread: Integrating over a parametrized triangle

  1. #1
    Member
    Joined
    Nov 2009
    Posts
    151
    Thanks
    64

    (Solved) Integrating over a parametrized triangle

    Hello everyone,

    I'm trying to perform a double integral over a parametrized triangle as part of computing the inertia tensor of a mesh. I'll spare the details, but the end result is that I need to evaluate the integral

    $\displaystyle \int_{v=0}^{v=1} \int_{u=0}^{u=1-v} \! \left[ (1-u-v)p_0 + up_1 + vp_2 \right] ^3 \, \mathrm{d} u \, \mathrm{d} v$

    where $\displaystyle p_0$, $\displaystyle p_1$ and $\displaystyle p_2$ are constants (represents the x-coordinate of the triangle vertex). The integral bounds come from the triangle parametrization.

    Evaluating the inside integral, I get

    $\displaystyle = \int_{v=0}^{v=1} \left. \frac{\left[ (1-u-v)p_0 + up_1 + vp_2 \right] ^4}{4(p_1 - p_0)} \, \right|_{u=0}^{u=1-v} \mathrm{d} v$

    $\displaystyle = \frac{1}{4(p_1 - p_0)} \int_{v=0}^{v=1} \left[ (1-v)p_1 + vp_2 \right]^4 - \left[ (1-v)p_0 + vp_2 \right]^4 \, \mathrm{d} v$

    Then evaluting the outside integral:

    $\displaystyle = \frac{1}{4(p_1 - p_0)} \left[ \left. \frac{\left[ (1-v)p_1 + vp_2 \right]^5}{5(p_2 - p_1)} - \frac{\left[ (1-v)p_0 + vp_2 \right]^5}{5(p_2 - p_0)} \right|_{v=0}^{v=1} \right]$

    $\displaystyle = \frac{1}{4(p_1 - p_0)} \left[ \left( \frac{p_2^5}{5(p_2 - p_1)} - \frac{p_2^5}{5(p_2 - p_0)} \right) - \left( \frac{p_1^5}{5(p_2 - p_1)} - \frac{p_0^5}{5(p_2 - p_0} \right) \right]$

    $\displaystyle = \frac{1}{20(p_1 - p_0)} \left[ \left( \frac{p_2^5 - p_1^5}{p_2 - p_1} \right) - \left( \frac{p_2^5 - p_0^5}{p_2 - p_0} \right) \right]$

    $\displaystyle = \frac{1}{20(p_1 - p_0)} \left[(p_2^4 + p_2^3p_1 + p_2^2p_1^2 + p_2p_1^3 + p_1^4) - (p_2^4 + p_2^3p_0 + p_2^2p_0^2 + p_2p_0^3 + p_0^4) \right]$

    $\displaystyle = \frac{1}{20(p_1 - p_0)} (p_2^3p_1 + p_2^2p_1^2 + p_2p_1^3 + p_1^4 - p_2^3p_0 - p_2^2p_0^2 - p_2p_0^3 - p_0^4)$

    This resembles, but doesn't quite match my expected result,

    $\displaystyle \frac{1}{20}(p_0^3 + p_1^3 + p_2^3 + p_0^2p_1 + p_0p_1^2 + p_0^2p_2 + p_0p_2^2 + p_1^2p_2 + p_1p_2^2 + p_0p_1p_2)$

    Some parts look okay, like the $\displaystyle p_1^4$ and $\displaystyle p_0^4$ terms in the numerator might eventually factor with the $\displaystyle (p_1 - p_0)$ term in my denominator to at least get the correct cubic terms, but in general the denominator is giving me trouble, and I don't see where the correct result's $\displaystyle p_0p_1p_2$ term might come from. It feels like I've done something silly somewhere, but I can't see where. (Haven't we all been there before? >_>)

    Could I trouble someone to take a look and see where things went wrong?

    Edit: Found the solution- nothing was wrong, I just missed the final factorisation:

    $\displaystyle = \frac{1}{20(p_1 - p_0)} ((p_2^3p_1 - p_2^3p_0) + (p_2^2p_1^2 - p_2^2p_0^2) + (p_2p_1^3 - p_2p_1^3) + (p_1^4 - p_0^4))$

    $\displaystyle = \frac{1}{20(p_1 - p_0)} (p_2^3(p_1 - p_0) + p_2^2(p_1^2 - p_0^2) + p_2(p_1^3 - p_0^3) + (p_1^4 - p_0^4))$

    $\displaystyle = \frac{1}{20(p_1 - p_0)} (p_2^3(p_1 - p_0) + p_2^2(p_1 - p_0)(p_1 + p_0) + p_2(p_1 - p_0)(p_1^2 + p_1p_0 + p_0^2) + (p_1 - p_0)(p_1^3 + p_1^2p_0 + p_1p_0^2 + p_0^3))$

    $\displaystyle = \frac{1}{20(p_1 - p_0)} (p_1 - p_0)(p_2^3 + p_2^2(p_1 + p_0) + p_2(p_1^2 + p_1p_0 + p_0^2) + (p_1^3 + p_1^2p_0 + p_1p_0^2 + p_0^3))$

    $\displaystyle = \frac{1}{20}(p_2^3 + p_1p_2^2 + p_0p_2^2 + p_1^2p_2 + p_1p_0p_2 + p_0^2p_2 + p_1^3 + p_1^2p_0 + p_1p_0^2 + p_0^3)$

    $\displaystyle = \frac{1}{20}(p_0^3 + p_1^3 + p_2^3 + p_0^2p_1 + p_0p_1^2 + p_0^2p_2 + p_0p_2^2 + p_1^2p_2 + p_1p_2^2 + p_0p_1p_2)$ as required.
    Last edited by Tuufless; Apr 7th 2012 at 10:05 PM. Reason: Solved it- turns out I just didn't see the final factorisation needed.
    Follow Math Help Forum on Facebook and Google+

Similar Math Help Forum Discussions

  1. Curve parametrized by arc length
    Posted in the Differential Geometry Forum
    Replies: 2
    Last Post: Sep 8th 2010, 07:36 AM
  2. Replies: 3
    Last Post: Jan 25th 2010, 04:58 AM
  3. Replies: 1
    Last Post: Aug 3rd 2009, 02:19 PM
  4. Unit Normal Vector to non-parametrized curve
    Posted in the Calculus Forum
    Replies: 2
    Last Post: Feb 25th 2009, 07:09 AM
  5. parametrized curve
    Posted in the Differential Geometry Forum
    Replies: 3
    Last Post: Sep 10th 2008, 11:26 PM

Search Tags


/mathhelpforum @mathhelpforum