// Creating arrowhead
Path arrowHead = new Path(gc.getDevice());
arrowHead.moveTo(endx, endy);
arrowHead.lineTo(endx + (ey-ex)*adjSize, endy - (ex + ey)*adjSize);
arrowHead.moveTo(endx, endy);
arrowHead.lineTo(endx - (ey + ex)*adjSize, endy + (ex - ey)*adjSize);
gc.drawPath(arrowHead);
}
private double[] computeCrossProduct (double x1, double y1, double x2, double y2) {