The Classroom - Enemies With Sight

i think the field of vision would have been done like this:
1st. produce your character!
2nd. get the distance from the Teacher character to the Pupil character.
3rd. if this distance is less than a certain number, test for:
4th. the angle of the pupil from the teacher being within a certain range