Chebyshev coefficients: Difference between revisions
Content added Content deleted
PatGarrett (talk | contribs) (→{{header|VBScript}}: Section added) |
PatGarrett (talk | contribs) (→{{header|VBScript}}: Shorter version) |
||
Line 960: | Line 960: | ||
Dim coef(10),cheby(10) |
Dim coef(10),cheby(10) |
||
pi=4*Atn(1) |
pi=4*Atn(1) |
||
a=0 |
a=0: b=1: n=10 |
||
b=1 |
|||
n=10 |
|||
For i=0 To n-1 |
For i=0 To n-1 |
||
coef(i)=Cos(Cos(pi/n*(i+1/2))*(b-a)/2+(b+a)/2) |
coef(i)=Cos(Cos(pi/n*(i+1/2))*(b-a)/2+(b+a)/2) |
||
Line 972: | Line 970: | ||
Next |
Next |
||
cheby(i)=w*2/n |
cheby(i)=w*2/n |
||
t=" " |
If cheby(i)<=0 Then t="" Else t=" " |
||
If cheby(i)<=0 Then |
|||
t="" |
|||
End If |
|||
WScript.StdOut.WriteLine i&" : "&t&cheby(i) |
WScript.StdOut.WriteLine i&" : "&t&cheby(i) |
||
Next</lang> |
Next</lang> |
||
Line 991: | Line 986: | ||
9 : -1,0022016549982E-11 |
9 : -1,0022016549982E-11 |
||
</pre> |
</pre> |
||
=={{header|zkl}}== |
=={{header|zkl}}== |