MCPcopy
hub / github.com/midrender/revideo / split

Method split

packages/2d/src/lib/curves/Polynomial.ts:153–170  ·  view source on GitHub ↗

* Split the polynomial into two polynomials of the same overall shape. * * @param u - The point at which to split the polynomial.

(u: number)

Source from the content-addressed store, hash-verified

151 * @param u - The point at which to split the polynomial.
152 */
153 public split(u: number): [Polynomial, Polynomial] {
154 const d = 1 - u;
155
156 const pre = new Polynomial(
157 this.c0,
158 this.c1 * u,
159 this.c2 * u * u,
160 this.c3 * u * u * u,
161 );
162 const post = new Polynomial(
163 this.eval(0),
164 d * this.differentiate(1).eval(u),
165 ((d * d) / 2) * this.differentiate(2).eval(u),
166 ((d * d * d) / 6) * this.differentiate(3).eval(u),
167 );
168
169 return [pre, post];
170 }
171
172 /**
173 * Calculate the roots (values where this polynomial = 0).

Callers 15

updateLayoutMethod · 0.45
parseLineDashMethod · 0.45
detectFileTypeMethod · 0.45
measureStringFunction · 0.45
extractRangeFunction · 0.45
constructorMethod · 0.45
diff.test.tsFile · 0.45
drawFunction · 0.45
renderer-plugin.tsFile · 0.45
logGlslErrorFunction · 0.45
downloadVideoChunkMethod · 0.45

Calls 2

evalMethod · 0.95
differentiateMethod · 0.95

Tested by

no test coverage detected