Rotate object based on angle between two touch positions

I've written a script that:

  1. Detects the start and end position of a swipe gesture on the iPhone.
  2. Positions a game object at the midpoint of the start and end of the swipe.
  3. Resizes the game object based on the distance between the gesture points.

I'm having a lot of trouble determining the angle between the two gesture points and rotating the game object accordingly. I've included a sketch.!

alt text

You can compute the orientation using Atan2(), e.g. (untested C#-ish pseudocode):

Vector3 diff = p2 - p1;
float angle = Mathf.Atan2(diff.y, diff.x);
transform.rotation = Quaternion.Euler(0f, 0f, RadToDeg(angle));

Or by using Quaternion.LookRotation(), e.g.:

transform.rotation = Quaternion.LookRotation(p2 - p1, Vector3.forward);

I spend 2 days, tried own solutions and other posts from this forums, but this answer working for me.
Thanks a lot!