@@ -271,8 +271,10 @@ def polynomial_coefficients(self):
271
271
Returns
272
272
-------
273
273
coefs : float, (n+1, d) array_like
274
- coefficients after expanding in polynomial basis, where n is the
275
- degree of the bezier curve
274
+ Coefficients after expanding in polynomial basis, where `n` is the
275
+ degree of the bezier curve and `d` its dimension.
276
+ These are the numbers (:math:`C_j`) such that the curve can be
277
+ written :math:`\sum_{j=0}^n C_j t^j`.
276
278
277
279
Notes
278
280
-----
@@ -282,6 +284,7 @@ def polynomial_coefficients(self):
282
284
283
285
{n \choose j} \sum_{i=0}^j (-1)^{i+j} {j \choose i} P_i
284
286
287
+ where :math:`P_i` are the control points of the curve.
285
288
"""
286
289
n = self .degree
287
290
# matplotlib uses n <= 4. overflow plausible starting around n = 15.
@@ -299,18 +302,19 @@ def polynomial_coefficients(self):
299
302
return coefs
300
303
301
304
@property
302
- def interior_extrema (self ):
305
+ def axis_aligned_extrema (self ):
303
306
"""
304
307
Return the location along the curve's interior where its partial
305
308
derivative is zero, along with the dimension along which it is zero for
306
- each instance.
309
+ each such instance.
307
310
308
311
Returns
309
312
-------
310
313
dims : int, array_like
311
- dimension $i$ along which the corresponding zero occurs
314
+ dimension :math:`i` along which the corresponding zero occurs
312
315
dzeros : float, array_like
313
- of same size as dims. the $t$ such that $d/dx_i B(t) = 0$
316
+ of same size as dims. the :math:`t` such that :math:`d/dx_i B(t) =
317
+ 0`
314
318
"""
315
319
n = self .degree
316
320
Cj = self .polynomial_coefficients
@@ -325,7 +329,7 @@ def interior_extrema(self):
325
329
dims .append (i * np .ones_like (r ))
326
330
roots = np .concatenate (roots )
327
331
dims = np .concatenate (dims )
328
- in_range = np .isreal (roots ) & (roots > 0 ) & (roots < 1 )
332
+ in_range = np .isreal (roots ) & (roots >= 0 ) & (roots <= 1 )
329
333
return dims [in_range ], np .real (roots )[in_range ]
330
334
331
335
0 commit comments