Cheap sensor for angular rotation (not rotation rate)

@johnerrington beat me to it. Paint a 4-circle Grey code or binary code (not sure what the difference between those two types is, they seem the same to me) and detect the angle with 4 IR sensors. This will give you an accuracy of 22.5 degrees. If you can't find IR sensors cheaply enough, 4 LEDs and 4 LDRs would probably work.