It is still not clear what you mean.

For instance:

Let the object turn towards another object:

function turn_to_object()
{
vec_set(temp,your.x);
vec_sub(temp,my.x);
vec_to_angle(my.pan,temp); // now MY looks at YOU
}

Or, let an entity turn away from a certain object:

function turn_away_from_object()
{
vec_set(temp,your.x);
vec_sub(temp,my.x);
vec_inverse(temp);
vec_to_angle(my.pan,temp); // now YOU looks away from MY
}

I don't know whether this snippets give you a hint in the right direction.
At least, it gives you an idea what I didn't understand of your question.