diff options
-rw-r--r-- | stokes.hpp | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -28,11 +28,12 @@ public: } Real gCoeff(unsigned i, Real t) const { - return (1 - t) * t * pow(t, i); + return (1 - t) * t * std::legendre(i, 2 * t - 1); } Real dgCoeff(unsigned i, Real t) const { - return (i + 1) * (1 - t) * pow(t, i) - pow(t, i + 1); + Real x = 2 * t - 1; + return ((i - 1) * x * std::legendre(i, x) - (i + 1) * std::legendre(i + 1, x)) / 2.0; } Vector<Scalar> f(Real t) const { |