title: Calculate shape orientation in Java (Image analysis)
body: <p>I have an image such as this:</p>
  
  <p><img src="https://i.stack.imgur.com/TcqTV.png" alt="enter image description here"></p>
  
  <p>and I need to calculate the orientation of it. In this case the shape is pointing towards the top left of the screen. Accuracy isn't hugely important as long as 3 or 4 calculations average out to within 5 degrees or so of the actual orientation (it will be moving slightly).</p>
  
  <p>Can anyone point me towards an algorithm to do this? I don't mind if the orientation is returned as a double or as a vector. </p>