function F = k522(k)

% F = k522(k)
% K0 = 5, K1 = K2 = 2;
%
% k must be 1, 2, 3, or 4
% k = 1 -> min/max phase solution
% k = 3 -> most nearly symmetric solution
   
A = 1/32-1/32*6^(1/2);
h0 = [
-A+1/16
-4*A+5/16
-5*A+5/8
5/8
5*A+5/16
4*A+1/16
A
]';

if (k == 1) | (k == 2)
 if k == 1
   B = -1/22688*(7653655-35892416*A+1418*(640697344*A^2-107915584*A+7525345)^(1/2))^(1/2);
 elseif k == 2
   B = -1/22688*(7653655-35892416*A-1418*(640697344*A^2-107915584*A+7525345)^(1/2))^(1/2);
 end
 C = -1/9667960*(-12992996923725+16062050591440896*B^2*A+2635012142349824*B^2+27224018740800*A)^(1/2);
 h1 = [
 -32246726656/33392625*B^3*A-2199102464/33392625*B^3+14847872/1335705*B*A+1737518/1335705*B
 401472/89047*B-15008202752/6678525*B^3*A-1356197888/6678525*B^3+1684864/89047*B*A
 639219335168/634459875*B^3*A+2005256192/634459875*B^3-135543616/8459465*B*A+12755621/8459465*B
 -83975200/5075679*B+51901431808/6042475*B^3*A+109927534592/126891975*B^3-40882624/725097*B*A
 6075596/1208495*B-192876314624/30212375*B^3*A-18143865856/30212375*B^3+35732544/1208495*B*A
 64/5*B*A+16/5*B
 B
 ]';
 h2 = [
 14974349/5268795*C-120483807232/43906625*C*B^2*A-23242676224/131719875*C*B^2+152431616/5268795*C*A
 -171827658752/26343975*C*B^2*A-14075998208/26343975*C*B^2+98703168/1756265*C*A+3358028/351253*C
 2802630852608/131719875*C*B^2*A+210488010752/131719875*C*B^2-349837952/1756265*C*A-46798364/1756265*C
 -11895046144/990375*C*B^2*A-2050269184/2310875*C*B^2+4518592/39615*C*A+3672712/277305*C
 C
 0
 0
 ]';
elseif (k == 3) | (k == 4)
 if k == 3
   B = -1/8548512*(356033503455-1983237686976*A+534282*(13778706433024*A^2-2844013344064*A+169187913745)^(1/2))^(1/2);
 elseif k == 4
   B = -1/8548512*(356033503455-1983237686976*A-534282*(13778706433024*A^2-2844013344064*A+169187913745)^(1/2))^(1/2);
 end
 C = -1/107768*(161001308160*B^2*A+24063437312*B^2-352889152*A+20199410)^(1/2);
 h1 = [
 -955121664/88625*B^3*A-65135616/88625*B^3+101248/3545*B*A+15262/3545*B
 -444530688/17725*B^3*A-40169472/17725*B^3+25728/709*B*A+10944/709*B
 128119799808/1683875*B^3*A+10264676352/1683875*B^3-7406528/67355*B*A-2002337/67355*B
 -56959107072/1683875*B^3*A-4130746368/1683875*B^3+647872/67355*B*A+75968/67355*B
 -2156593152/336775*B^3*A-216050688/336775*B^3+305728/13471*B*A+62764/13471*B
 64/5*B*A+16/5*B
 B
 ]';
 h2 = [
 -377147817984/9250625*C*B^2*A-26754717696/9250625*C*B^2+29378944/370025*C*A+5382691/370025*C
 754295635968/9250625*C*B^2*A+53509435392/9250625*C*B^2-54021568/370025*C*A-8841252/370025*C
 -377147817984/9250625*C*B^2*A-26754717696/9250625*C*B^2+19906304/370025*C*A+1904456/370025*C
 64/5*C*A+16/5*C
 C
 0
 0
]';
end

F = [h0; h1; h2]/sqrt(2);

