MCPcopy Create free account
hub / github.com/NatronGitHub/Natron / cubicIntegrate

Function cubicIntegrate

Engine/Interpolation.cpp:81–94  ·  view source on GitHub ↗

integrate from 0 to t

Source from the content-addressed store, hash-verified

79
80// integrate from 0 to t
81static double
82cubicIntegrate(double c0,
83 double c1,
84 double c2,
85 double c3,
86 double t)
87{
88 const double t2 = t * t;
89 const double t3 = t2 * t;
90 const double t4 = t3 * t;
91 assert(t == t && t2 == t2 && t3 == t3 && t4 == t4 && c0 == c0 && c1 == c1 && c2 == c2 && c3 == c3);
92
93 return (c0 ? c0 * t : 0.) + (c1 ? c1 * t2 / 2. : 0.) + (c2 ? c2 * t3 / 3 : 0.) + (c3 ? c3 * t4 / 4 : 0.);
94}
95
96// derive at t
97static double

Callers 2

integrateMethod · 0.85
integrate_clampMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected