A look at function I wrote for a university project. It checks what quadrant the subject is in relative to the object and slowly turns until the angle between the vectors equals zero.