How can I rotate an object about an arbitrary pivot point P and axis to face a world position X?

For example, in a 2d world in the xy plane, I have a quad that represents the line AB. I would like to be able to rotate that quad about the z-axis at pivot point A or B so that it always points at position X (like a clock hand but the rotation pivots around a user specified end).

I have a solution for this but it varies depending on which end is selected to be the pivot.

Is there a more general solution?

Many thanks for any help.

Maybe this: http://unity3d.com/support/documentation/ScriptReference/Transform.RotateAround.html