public double getMiddleDirection()
    {
        if (leftNeighbour == null || rightNeighbour == null)    return -1024;
        double leftAngle = getDirection(leftNeighbour);
        double rightAngle = getDirection(rightNeighbour);
        if (rightAngle < leftAngle) rightAngle += Math.PI * 2;
        return (leftAngle + rightAngle) / 2;
    }