MCPcopy Create free account
hub / github.com/numpy/numpy / chebsub

Function chebsub

numpy/polynomial/chebyshev.py:611–652  ·  view source on GitHub ↗

Subtract one Chebyshev series from another. Returns the difference of two Chebyshev series `c1` - `c2`. The sequences of coefficients are from lowest order term to highest, i.e., [1,2,3] represents the series ``T_0 + 2*T_1 + 3*T_2``. Parameters ---------- c1, c2 : arr

(c1, c2)

Source from the content-addressed store, hash-verified

609
610
611def chebsub(c1, c2):
612 """
613 Subtract one Chebyshev series from another.
614
615 Returns the difference of two Chebyshev series `c1` - `c2`. The
616 sequences of coefficients are from lowest order term to highest, i.e.,
617 [1,2,3] represents the series ``T_0 + 2*T_1 + 3*T_2``.
618
619 Parameters
620 ----------
621 c1, c2 : array_like
622 1-D arrays of Chebyshev series coefficients ordered from low to
623 high.
624
625 Returns
626 -------
627 out : ndarray
628 Of Chebyshev series coefficients representing their difference.
629
630 See Also
631 --------
632 chebadd, chebmulx, chebmul, chebdiv, chebpow
633
634 Notes
635 -----
636 Unlike multiplication, division, etc., the difference of two Chebyshev
637 series is a Chebyshev series (without having to "reproject" the result
638 onto the basis set) so subtraction, just like that of "standard"
639 polynomials, is simply "component-wise."
640
641 Examples
642 --------
643 >>> from numpy.polynomial import chebyshev as C
644 >>> c1 = (1,2,3)
645 >>> c2 = (3,2,1)
646 >>> C.chebsub(c1,c2)
647 array([-2., 0., 2.])
648 >>> C.chebsub(c2,c1) # -C.chebsub(c1,c2)
649 array([ 2., 0., -2.])
650
651 """
652 return pu._sub(c1, c2)
653
654
655def chebmulx(c):

Callers

nothing calls this directly

Calls 1

_subMethod · 0.80

Tested by

no test coverage detected