Chebyshev coefficients: Difference between revisions

(→‎{{header|VBScript}}: Section added)
Line 953:
-1.0022591709e-11
</pre>
 
=={{header|VBScript}}==
{{trans|Microsoft Small Basic}}
To run in console mode with cscript.
<lang vb>' N Chebyshev coefficients for the range 0 to 1
Dim coef(10),cheby(10)
pi=4*Atn(1)
a=0
b=1
n=10
For i=0 To n-1
coef(i)=Cos(Cos(pi/n*(i+1/2))*(b-a)/2+(b+a)/2)
Next
For i=0 To n-1
w=0
For j=0 To n-1
w=w+coef(j)*Cos(pi/n*i*(j+1/2))
Next
cheby(i)=w*2/n
t=" "
If cheby(i)<=0 Then
t=""
End If
WScript.StdOut.WriteLine i&" : "&t&cheby(i)
Next</lang>
{{out}}
<pre>
0 : 1,64716947539031
1 : -0,232299371615172
2 : -5,37151146220477E-02
3 : 2,45823526698163E-03
4 : 2,82119057433916E-04
5 : -7,72222915563781E-06
6 : -5,89855645105608E-07
7 : 1,15214275009379E-08
8 : 6,59629917354465E-10
9 : -1,0022016549982E-11
</pre>
 
 
=={{header|zkl}}==
1,392

edits