thought i would share some code snippet that i more or less copied from here:
http://docs.opencv.org/3.1.0/d1/dee/tutorial_introduction_to_pca.html#gsc.tab=0
i used it to give me the orientation of an array of points. in my case the array was the contour of a blob.
my blob rotated around it’s centre. but PCA was only good at 180 degree range.