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)
| 1905 | |
| 1906 | |
| 1907 | def 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 | |
| 1938 | def chebpts2(npts): |
no outgoing calls
no test coverage detected
searching dependent graphs…