function coeff = center_coeff(coeff,poly_func,poly_N)
    
coeff_rx = coeff(1:poly_N);
coeff_ry = coeff(poly_N+1:2*poly_N);
% coeff_rz = coeff(2*poly_N+1:end);
rx0 = poly_func(coeff_rx,0);
rx1 = poly_func(coeff_rx,1);
ry0 = poly_func(coeff_ry,0);
ry1 = poly_func(coeff_ry,1);
% rz0 = poly_func(coeff_rz,0);
% rz1 = poly_func(coeff_rz,1);
coeff(poly_N) = coeff(poly_N)-(rx0+rx1)/2;
coeff(2*poly_N) = coeff(2*poly_N)-(ry0+ry1)/2;
% coeff(end) = coeff(end)-(rz0+rz1)/2;
