atan(p.x - 128.0, abs(p.y)) / -abs(p.y) - atan(p.x, abs(p.y)) / -abs(p.y); https://docs.google.com/document/d/1vpgTsKryKSgC7_0FB0BGHZcCptA73kkSmB6VF78yQc4/edit