code: public static double[][] arrowEndForLineVectorAlgebra(double x1, double y1, 
        double x2, double y2, double width, double height) {
      double[][] result = new double[2][3];
      double [] baseVector = {x2-x1, y2-y1};
      double baseVectorLenght = Math.sqrt(baseVector[0]*baseVector[0] + baseVector[1]*baseVector[1]);
      double [] baseUnitVector = {baseVector[0]/baseVectorLenght, baseVector[1]/baseVectorLenght};
      double [] normal = {-baseUnitVector[1], baseUnitVector[0]};
      //Point D:
      result[0][0] = x2 - baseUnitVector[0] * width + normal[0] * height/2;
      result[1][0] = y2 - baseUnitVector[1] * width + normal[1] * height/2;
      //Point B:
      result[0][1] = x2;
      result[1][1] = y2;
      //Point E:
      result[0][2] = x2 - baseUnitVector[0] * width - normal[0] * height/2;
      result[1][2] = y2 - baseUnitVector[1] * width - normal[1] * height/2;
      return result;
    }
docs: Calculate arrow end for given line with vector algebra:<br>
  ---------------><br>
  Arrow points:<br>
  &emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;D<br>
  A--------------->B<br>
  &emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;E<br>
  
  Usage code:
  <pre>
  </pre>
  @param x1 line start A X
  @param y1 line start A Y
  @param x2 line end B X
  @param y2 line end B Y
  @param width arrow
  @param height of arrow
  @return arrays of calculated arrow points:
  triangle's points:
  [D x, B x, E x]
  [D y, B y, E y]</li>
  </ul>