Closed carlos-adir closed 7 months ago
It's possible to use Milne's method to integrate over the interval $\left[tk, \ t{k+1}\right]$
The MIlne's method is in fact:
$$\int_{0}^{1} f(u) \ du \approx \dfrac{2}{3}f\left(\frac{1}{4}\right) - \dfrac{1}{3}f\left(\frac{1}{2}\right) + \dfrac{2}{3} f\left(\frac{3}{4}\right)$$
In this case, $f(u)$ is complicated because it involves the derivatives of $x$ and $y$. It's can be done by numerical differentiation:
$$x'(u) \approx \dfrac{x(u+h) - x(u-h)}{2h}$$
Therefore
$$f\left(\frac{1}{4}\right) = x\left(\dfrac{1}{4}\right)^a \cdot y\left(\dfrac{1}{4}\right)^b \cdot \left(x\left(\dfrac{1}{4}\right) \cdot \dfrac{y(\frac{1}{4} +h ) - y(\frac{1}{4}-h)}{2h} - y\left(\dfrac{1}{4}\right) \cdot \dfrac{x(\frac{1}{4} +h ) - x(\frac{1}{4}-h)}{2h}\right)$$
$$f\left(\frac{1}{2}\right) = x\left(\dfrac{1}{2}\right)^a \cdot y\left(\dfrac{1}{2}\right)^b \cdot \left(x\left(\dfrac{1}{2}\right) \cdot \dfrac{y(\frac{1}{2} +h ) - y(\frac{1}{2}-h)}{2h} - y\left(\dfrac{1}{2}\right) \cdot \dfrac{x(\frac{1}{2} +h ) - x(\frac{1}{2}-h)}{2h}\right)$$
$$f\left(\frac{3}{4}\right) = x\left(\dfrac{3}{4}\right)^a \cdot y\left(\dfrac{3}{4}\right)^b \cdot \left(x\left(\dfrac{3}{4}\right) \cdot \dfrac{y(\frac{3}{4} +h ) - y(\frac{3}{4}-h)}{2h} - y\left(\dfrac{3}{4}\right) \cdot \dfrac{x(\frac{3}{4} +h ) - x(\frac{3}{4}-h)}{2h}\right)$$
Selecting $h = \frac{1}{4}$, $f\left(\frac{1}{4}\right)$, $f\left(\frac{1}{2}\right)$ and $f\left(\frac{3}{4}\right)$ are computed with the values of $x$ and $y$ at points $0$, $\frac{1}{4}$, $\frac{1}{2}$, $\frac{3}{4}$, $1$
We are interested in computing $I_{a,b}$ for non polygonal curves
$$I{a,b} = \int{\Omega} x^a \cdot y^b \ dx \ dy$$
This is rewritten as a boundary integral with a real parameter $\alpha$
$$I{a,b} = \dfrac{\alpha-1}{b+1} \int{\Gamma} x^a \cdot y^{b+1} \ dx + \dfrac{\alpha}{a+1} \int_{\Gamma} x^{a+1} \cdot y^b \ dy$$
Add the condition that
$$\alpha = \dfrac{a+1}{a+b+2}$$
Then
$$(a+b+2) \cdot I{a,b} = \int{\Gamma} x^a \cdot y^b \left(x \ dy - y \ dx\right) $$
The curves are divided by $n$ rational bezier segments, therefore
$$(a+b+2) \cdot I{a,b} = \sum{k=0}^{n-1}\int{t{k}}^{t_{k+1}} x^a \cdot y^b \cdot \left(\mathbf{p} \times \mathbf{p}'\right) \ dt$$
I don't know if it's possible to simplify more, even if we add the hypothesis of non-rational bezier segments.