function ptsw = CS6640_poly_warp(pts,a,b)
% CS6640_poly_warp - transform points according to cubic polynomial
% On input:
%    pts (nx2 array): x,y points
%    a (10x1 vector): transform coefficients for x
%    b (10x1 vector): transform coefficients for y
% On output:
%     ptsw (nx2 array): transformed points
% Call:
%     p2 = CS6640_poly_warp([p,a,b);
% Author:
%     T. Henderson
%     UU
%     Fall 2020
%

num_pts = length(pts(:,1));
ptsw = zeros(num_pts,2);

for p = 1:num_pts
    x = pts(p,1);
    y = pts(p,2);
    ptsw(p,1) = [1 x y x*y x^2 y^2 y*x^2 x*y^2 x^3 y^3]*a;
    ptsw(p,2) = [1 x y x*y x^2 y^2 y*x^2 x*y^2 x^3 y^3]*b;
end
