19 namespace PhysicsTools {
36 d += coeffs[1]; tmp =
x;
37 d += coeffs[2] * tmp * 2.0; tmp *=
x;
38 d += coeffs[3] * tmp * 3.0;
46 area += coeffs[0] *
tmp; tmp *=
x;
47 area += coeffs[1] * tmp * (1.0 / 2.0); tmp *=
x;
48 area += coeffs[2] * tmp * (1.0 / 3.0); tmp *=
x;
49 area += coeffs[3] * tmp * (1.0 / 4.0);
63 n(0), segments(0), area(0.0)
77 seg->
coeffs[1] = vals[1] - vals[0];
87 m0 = 0.0, m1 = 0.5 * (vals[2] - vals[0]);
89 seg->
coeffs[1] = -2.0 * vals[0] + 2.0 * vals[1] - m1;
90 seg->
coeffs[2] = vals[0] - vals[1] + m1;
97 for(
unsigned int i = 1;
i <
n - 1;
i++, seg++, vals++) {
98 m1 = 0.5 * (vals[2] - vals[0]);
101 seg->coeffs[2] = -3.0 * vals[0] - 2.0 * m0 + 3.0 * vals[1] - m1;
102 seg->coeffs[3] = 2.0 * vals[0] + m0 - 2.0 * vals[1] + m1;
104 area = seg->integral(1.0);
108 seg->coeffs[0] = vals[0];
110 seg->coeffs[2] = - vals[0] - m0 + vals[1];
111 seg->coeffs[3] = 0.0;
113 area = seg->integral(1.0);
139 float rest = std::modf(x *
n, &total);
146 if (x < 0.0 || x > 1.0)
154 float rest = std::modf(x *
n, &total);
170 float rest = std::modf(x *
n, &total);
std::vector< std::vector< double > > tmp