src/main/java/de/javagl/geom/ArrowCreator.java
/**
     * Build a simple arrow that only consists of lines, from the start
     * to the end, and from the head tips to the end.
     * 
     * @param x0 The x-coordinate of the start point of the arrow
     * @param y0 The y-coordinate of the start point of the arrow
     * @param x1 The x-coordinate of the end point of the arrow
     * @param y1 The y-coordinate of the end point of the arrow 
     * @return The shape, only consisting of lines
     */
Build a simple arrow that only consists of lines, from the start
to the end, and from the head tips to the end.


Build a simple arrow that only consists of lines from the start to the end and from the head tips to the end .
public Shape buildLines(
        double x0, double y0, double x1, double y1)
    {
        double dx = x1-x0;
        double dy = y1-y0;
        double length = Math.sqrt(dx*dx+dy*dy);
        double invLength = 1.0 / length;
        double dirX = dx * invLength;
        double dirY = dy * invLength;
        double perpDirX = dirY;
        double perpDirY = -dirX;
        double perpDirOffsetX = perpDirX * 0.5;
        double perpDirOffsetY = perpDirY * 0.5;
        double actualHeadLength = computeActualHeadLength(length);
        double actualHeadWidth = computeActualHeadWidth(length);
        double headTipsX = x1 - actualHeadLength * dirX;
        double headTipsY = y1 - actualHeadLength * dirY;
        double headTipOffsetX = actualHeadWidth * perpDirOffsetX;
        double headTipOffsetY = actualHeadWidth * perpDirOffsetY;
        double headTipLx = headTipsX + headTipOffsetX;
        double headTipLy = headTipsY + headTipOffsetY;
        double headTipRx = headTipsX - headTipOffsetX;
        double headTipRy = headTipsY - headTipOffsetY;
        Path2D p = new Path2D.Double();
        p.moveTo(x0, y0);
        p.lineTo(x1, y1);
        p.moveTo(headTipLx, headTipLy);
        p.lineTo(x1, y1);
        p.moveTo(headTipRx, headTipRy);
        p.lineTo(x1, y1);
        return p;
    }
public Shape buildLines ( double x0 , double y0 , double x1 , double y1 ) { double dx = x1 - x0 ; double dy = y1 - y0 ; double length = Math . sqrt ( dx * dx + dy * dy ) ; double invLength = 1.0 / length ; double dirX = dx * invLength ; double dirY = dy * invLength ; double perpDirX = dirY ; double perpDirY = - dirX ; double perpDirOffsetX = perpDirX * 0.5 ; double perpDirOffsetY = perpDirY * 0.5 ; double actualHeadLength = computeActualHeadLength ( length ) ; double actualHeadWidth = computeActualHeadWidth ( length ) ; double headTipsX = x1 - actualHeadLength * dirX ; double headTipsY = y1 - actualHeadLength * dirY ; double headTipOffsetX = actualHeadWidth * perpDirOffsetX ; double headTipOffsetY = actualHeadWidth * perpDirOffsetY ; double headTipLx = headTipsX + headTipOffsetX ; double headTipLy = headTipsY + headTipOffsetY ; double headTipRx = headTipsX - headTipOffsetX ; double headTipRy = headTipsY - headTipOffsetY ; Path2D p = new Path2D . Double ( ) ; p . moveTo ( x0 , y0 ) ; p . lineTo ( x1 , y1 ) ; p . moveTo ( headTipLx , headTipLy ) ; p . lineTo ( x1 , y1 ) ; p . moveTo ( headTipRx , headTipRy ) ; p . lineTo ( x1 , y1 ) ; return p ; }
Build a simple arrow that only consists of lines, from the start
 to the end, and from the head tips to the end.
Build a simple arrow that only consists of lines from the start to the end and from the head tips to the end .
// To do: Avoid code duplication here and in buildShape
