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

Function chebpts1

numpy/polynomial/chebyshev.py:1907–1935  ·  view source on GitHub ↗

Chebyshev points of the first kind. The Chebyshev points of the first kind are the points ``cos(x)``, where ``x = [pi*(k + .5)/npts for k in range(npts)]``. Parameters ---------- npts : int Number of sample points desired. Returns ------- pts : ndarray

(npts)

Source from the content-addressed store, hash-verified

1905
1906
1907def chebpts1(npts):
1908 """
1909 Chebyshev points of the first kind.
1910
1911 The Chebyshev points of the first kind are the points ``cos(x)``,
1912 where ``x = [pi*(k + .5)/npts for k in range(npts)]``.
1913
1914 Parameters
1915 ----------
1916 npts : int
1917 Number of sample points desired.
1918
1919 Returns
1920 -------
1921 pts : ndarray
1922 The Chebyshev points of the first kind.
1923
1924 See Also
1925 --------
1926 chebpts2
1927 """
1928 _npts = int(npts)
1929 if _npts != npts:
1930 raise ValueError("npts must be integer")
1931 if _npts < 1:
1932 raise ValueError("npts must be >= 1")
1933
1934 x = 0.5 * np.pi / _npts * np.arange(-_npts + 1, _npts + 1, 2)
1935 return np.sin(x)
1936
1937
1938def chebpts2(npts):

Callers 1

chebinterpolateFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…