function[Z,W]=gaussquad(Npoly)

Z = zeros(1,Npoly);
W = zeros(1,Npoly);
 
if Npoly==1
    Z(1) = 0.0;
    W(1) = 2.0;
elseif Npoly==2 
    Z(1) = -0.57735026918962576450;
    Z(2) = -Z(1);
    W(1) = 1.0;
    W(2) = 1.0;
elseif Npoly==3
    Z(1) = -0.77459666924148337703;
    Z(2) =  0.0;
    Z(3) = -Z(1);
    W(1) = 0.555555555555555555555;
    W(2) = 0.888888888888888888888;
    W(3) = 0.555555555555555555555;
elseif Npoly==4 
    Z(1) = -0.86113631159405257522;
    Z(2) = -0.33998104358485626480;
    Z(3) = -Z(2);
    Z(4) = -Z(1);
    W(1) = 0.34785484513745385737;
    W(2) = 0.65214515486254614262;
    W(3) = W(2);
    W(4) = W(1);
elseif Npoly==5 
    Z(1) = -0.90617984593866399279;
    Z(2) = -0.53846931010568309103;
    Z(3) =  0.0;
    Z(4) = -Z(2);
    Z(5) = -Z(1);
    W(1) = 0.23692688505618908751;
    W(2) = 0.47862867049936646804;
    W(3) = 0.56888888888888888889;
    W(4) = W(2);
    W(5) = W(1);
elseif Npoly==6 
    Z(1) = -0.932469514203152;
    Z(2) = -0.661209386466265;
    Z(3) = -0.238619186083197;
    Z(4) = -Z(3);
    Z(5) = -Z(2);
    Z(6) = -Z(1);
    W(1) = 0.171324492379170;
    W(2) = 0.360761573048139;
    W(3) = 0.467913934572691;
    W(4) = W(3);
    W(5) = W(2);
    W(6) = W(1);
elseif Npoly==8 
    Z(1) = -0.96028985649753623168;
    Z(2) = -0.79666647741362673959;
    Z(3) = -0.52553240991632898581;
    Z(4) = -0.18343464249564980493;
    Z(5) = -Z(4);
    Z(6) = -Z(3);
    Z(7) = -Z(2);
    Z(8) = -Z(1);
    W(1) = 0.10122853629037625915;
    W(2) = 0.22238103445337447054;
    W(3) = 0.31370664587788728733;
    W(4) = 0.36268378337836198296;
    W(5) = W(4);
    W(6) = W(3);
    W(7) = W(2);
    W(8) = W(1);
elseif Npoly==12 
    Z(1) = -0.981560634246719;
    Z(2) = -0.904117256370475;
    Z(3) = -0.769902674194305;
    Z(4) = -0.587317954286617;
    Z(5) = -0.367831498998180;
    Z(6) = -0.125233408511469;
    Z(7) = -Z(6);
    Z(8) = -Z(5);
    Z(9) = -Z(4);
    Z(10)= -Z(3);
    Z(11)= -Z(2);
    Z(12)= -Z(1);
    W(1) = 0.047175336386512;
    W(2) = 0.106939325995318;
    W(3) = 0.160078328543346;
    W(4) = 0.203167426723066;
    W(5) = 0.233492536538355;
    W(6) = 0.249147045813403;
    W(7) = W(6);
    W(8) = W(5);
    W(9) = W(4);
    W(10)= W(3);
    W(11)= W(2);
    W(12)= W(1);
elseif Npoly==20 
    Z(1) = -0.993128599185094924786;
    Z(2) = -0.963971927277913791268;
    Z(3) = -0.912234428251325905868;
    Z(4) = -0.839116971822218823395;
    Z(5) = -0.746331906460150792614;
    Z(6) = -0.636053680726515025453;
    Z(7) = -0.510867001950827098004;
    Z(8) = -0.373706088715419560673;
    Z(9) = -0.227785851141645078080;
    Z(10)= -0.076526521133497333755;
    Z(11) = -Z(10);
    Z(12) = -Z(9);
    Z(13) = -Z(8);
    Z(14) = -Z(7);
    Z(15) = -Z(6);
    Z(16) = -Z(5);
    Z(17) = -Z(4);
    Z(18) = -Z(3);
    Z(19) = -Z(2);
    Z(20) = -Z(1);
    W(1) = 0.017614007139152118312;
    W(2) = 0.040601429800386941331;
    W(3) = 0.062672048334109063570;
    W(4) = 0.083276741576704748725;
    W(5) = 0.101930119817240435037;
    W(6) = 0.118194531961518417312;
    W(7) = 0.131688638449176626898;
    W(8) = 0.142096109318382051329;
    W(9) = 0.149172986472603746788;
    W(10)= 0.152753387130725850698;
    W(11) = W(10);
    W(12) = W(9);
    W(13) = W(8);
    W(14) = W(7);
    W(15) = W(6);
    W(16) = W(5);
    W(17) = W(4);
    W(18) = W(3);
    W(19) = W(2);
    W(20) = W(1);
end
