static int[] oneStepPt_l = { 0, 1, 1, 1, 1, 0, 1, -1, 0, -1, -1, -1, -1, 0, -1, 1, }; static Pt oneStepPt(Pt p, int baseX, int baseY) { ret oneStepPt(new Pt(p.x-baseX, p.y-baseY)); } static Pt oneStepPt(Pt p) { int i = mod(iround(Math.atan2(p.x, p.y)*8/2/pi()), 8); ret new Pt(oneStepPt_l[i*2], oneStepPt_l[i*2+1]); }