rem roots of the trigometric polynomial rem 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) rem data 3,1,2,-2,1,5,-3 rem where first data point is the number of A,B pairs" print "roots of the trigometric polynomial" print "of form f(x)=A1*sin(x)+B1*cos(x)+A2*sin(2*x)+B2*cos(2*x)..." print "enter data in data statement as: data n,A1,B1,A2,B2,..." print "where n is the number of A B pairs" print "enter 'q' at any prompt to quit" print [jump] input "Input Angle in Degrees): ";r$ if r$="q" then end r=val(r$) print z=0 read n for i=1 to n read a read b z=z+a*sin(i*r)+b*cos(i*r) next i print "f(";r;")= ";z print restore goto [jump] data 3,1,2,-2,1,5,-3