See analysis in rP20383
Details
Diff Detail
- Repository
- rP 0 A.D. Public Repository
- Lint
Automatic diff as part of commit; lint not applicable. - Unit
Automatic diff as part of commit; unit tests not applicable.
Event Timeline
Successful build - Chance fights ever on the side of the prudent.
Updating workspaces... Build (release)... Build (debug)... Running release tests... Running cxxtest tests (307 tests)...................................................................................................................................................................................................................................................................................................................OK! Running debug tests... Running cxxtest tests (307 tests)...................................................................................................................................................................................................................................................................................................................OK! Checking XML files...
You can check straightly with the provided function defined by f(x)=((P * x + Q) * x + R) * x + S that:
f(0) = p1
f(1) = p2
df/dx (0) = tension * (p2-p0)
df/dx((1) = tension * (p3-p1)
Then one can understand that for tension = 1/2, the slope in p1 is well given by the slope of the line (p0,p2) and the slope in p2 is well given by the slope of the line (p1, p3), which are the requested things.
(tension 0 is something which should be rarely desirable)
check
I can confirm your computation, but I need definition of CR to conclude if it's a CR spline. I must resign.
To prevent future interpolation users from adding a redundant function, the words "cardinal spline" and "Catmull-Rom spline" should still appear, but it can be phrased in a meaningless (hence not false) way.
Generalized Catmull-Rom splines, Cardinal splines, even Catmul-Rom splines are acceptable names.
As I never read "generalized CR" anywhere, I think some future reader might want to change that if it were used.
(I took the statement that tension = 0 resluts in the Catmull-Rom spline and that the tension must be in the interval [0, 1] from here.
I guess if it is a mistake, the reason for that would be that the cardinal spline being a special case of the cubic hermite spline does not imply that the tension of the cardinal spline inherits the definition of the cubic hermite spline.)
They are also right. But for the m_k they divide by the length of the interval (to get the actual slope). [...]. And finally 1 - 2 * 1/2 = 0.
the reason for that would be that the cardinal spline being a special case of the cubic hermite spline does not imply that the tension of the cardinal spline inherits the definition of the cubic hermite spline.)
In all those cases, tension is a factor for the derivatives. For convenience one can choose T, (1-T) / interval length, (T - 1/2 ) etc...
binaries/data/mods/public/globalscripts/interpolation.js | ||
---|---|---|
4 ↗ | (On Diff #4051) | The good point is that the or can be interpreted in many ways. |
Successful build - Chance fights ever on the side of the prudent.
Updating workspaces... Build (release)... Build (debug)... Running release tests... Running cxxtest tests (307 tests)...................................................................................................................................................................................................................................................................................................................OK! Running debug tests... Running cxxtest tests (307 tests)...................................................................................................................................................................................................................................................................................................................OK! Checking XML files...