Itseez/opencv — pull request #2358 by rohitgirdhar (2014-02-17 12:12:36+00:00)
Title: Initialize RotatedRect given endpoints

This implements feature request [#3073](http://code.opencv.org/issues/3073).
Enables initializing a RotatedRect given 3 of its endpoint in order (clockwise/anticlockwise).

Method:
Essentially, I use the 3 points to derive the center, angle and side lengths. I assume the points to be in order (clockwise/anticlockwise), hence center is the mean of first and last points. I find the 2 vectors (corresponding to the 2 edges), and surely one of the vectors must have slope between 1 and -1. That vector (and corresponding edge) becomes our width, and hence the other becomes height.

I can add documentation/tests if you think it's useful.