Trigonometric

This simple program finds roots of the trigometric polynomial
of form f(x)=A1*sin(x)+B1*cos(x)+A2*sin(2*x)+B2*cos(2*x)...
You enter data in data statement as: data n,A1,B1,A2,B2,...
where n is the number of A B pairs.  An example would be:

f(x)=sin(x)+2*cos(x)-2*sin(2*x)+cos(2*x)+.5*sin(3*x)-3*cos(3*x)
giving a data statement of: data 3,1,2,-2,1,5,-3
where first data point is the number of A,B pairs"

Downloads:

Basic program - trigpoly.bas

 

Test case:

Embedded example is: f(x)=sin(x)+2*cos(x)-2*sin(2*x)+cos(2*x)+.5*sin(3*x)-3*cos(3*x)
giving a data statement of: data 3,1,2,-2,1,5,-3
where first data point is the number of A,B pairs"
 

roots of the trigometric polynomial
of form f(x)=A1*sin(x)+B1*cos(x)+A2*sin(2*x)+B2*cos(2*x)...
enter data in data statement as: data n,A1,B1,A2,B2,...
where n is the number of A B pairs
enter 'q' at any prompt to quit

Input Angle in Degrees): 45

f(45)= 3.09558749

Input Angle in Degrees): 90

f(90)= -2.83168095

Input Angle in Degrees): 105

f(105)= -1.54684837

Input Angle in Degrees): q