function b = compassbox(d) b = ceil(mod(d+360/64,360)*32/360); end;