function Points = CubicBezier(CP,tol)
t = 0:1/(tol-1):1;
x = CP(:,1)';
y = CP(:,2)';

for i = 1 : length(t)
	Points(1,i) = ((1-t(i))^3*x(1)) + ((3*(1-t(i))^2)*t(i)*x(2)) +((3*(1-t(i))*t(i)^2)*x(3))+(t(i)^3)*x(4);
	Points(2,i) = ((1-t(i))^3*y(1)) + ((3*(1-t(i))^2)*t(i)*y(2)) +((3*(1-t(i))*t(i)^2)*y(3))+(t(i)^3)*y(4);
end
