Trig Functions explained here
Sector is 1 through 8, as shown:
sector=Floor(ATan2(MouseX()-GraphicsWidth()/2,GraphicsHeight()/2-MouseY())/45)
Sector is 1 through 8, as shown:
\ 3|2 / <u>4 \|/ 1</u> 5 /|\ 8 / 6|7 \