title: How do you get the 4 corners of a rectangle for any line that has a start coord and end coord in Java
body: <p>I would like to know how to calculate the four corners of a rectangle.
  I have various straight lines at different orientations. I would like
  to use the start and end coordinates of each of these lines to determine a rectangle i.e using the addition or subtraction of diffx, diffy to the start and end points of the line dependent on the bearing of the line in whole circle quadrant. I am trying to do this in java.</p>
  
  <p>My end goal is the have a rectangle (sleeve) to contain the line. The line would
  appear as a centre-line to the rectangle or (rectangle buffer of the line).
  Grateful for any help</p>
  
  <p>Please see the slide on Assignment 2 on this link. It is a link to someone elses page and shows the image of what I am trying to do
  <a href="http://blog.wijono.org/2015/07/simple-2d-tesselation-and-twist-with.html" rel="nofollow">http://blog.wijono.org/2015/07/simple-2d-tesselation-and-twist-with.html</a>
  <a href="http://blog.wijono.org/2015/07/simple-2d-tesselation-and-twist-with.html" rel="nofollow">link</a>
  link</p>