% xe and ye as fractions of the distance, he as angle uncertainty fraction function configs = getsmear(px,py,dx,dy,dh,heading,xe,ye,he,num) r1 = random('norm',0,1,num,1); r2 = random('norm',0,1,num,1); r3 = random('norm',0,1,num,1); pointsx = px + dx*(1 + xe*r1).*cos(heading + dh*he*r2) + dy*(1 + ye*r3).*sin(heading + he*r2); pointsy = py + dy*(1 + ye*r3).*cos(heading + dh*he*r2) - dx*(1 + xe*r1).*sin(heading + he*r2); configs = [pointsx pointsy heading+dh*(1+he*r2)];