the getAnglePairs function now does both simple and linear approximation, though not very optimal