def add_arrow_coord(self, line, arrow_height, arrow_width, recess):
        """ Determine the coordinates of an arrow head polygon
            with height (h) and width (w) and recess (r)
            pointing from the one but last to the last point of (poly)line (line).
            Note that the coordinates of an SvgLine and an SvgPolyline
            are stored in different variables.
        """
        # arrow = SvgPolygon(_maxlen=4)
        if line.type == 'polyline':
            xe = line.coordsX[-1]
            ye = line.coordsY[-1]
            xp = line.coordsX[-2]
            yp = line.coordsY[-2]
        else:
            xe = line.attributes['x2']
            ye = line.attributes['y2']
            xp = line.attributes['x1']
            yp = line.attributes['y1']
        h = arrow_height
        if arrow_width == 0:
            w = arrow_height / 3
        else:
            w = arrow_width
        r = recess
        self.add_coord(xe, ye)
        dx = xe - xp
        dy = ye - yp
        de = math.sqrt(dx**2 + dy**2)
        xh = xe - h * dx / de
        yh = ye - h * dy / de
        x1 = xh + w * dy / de
        y1 = yh - w * dx / de
        self.add_coord(x1, y1)
        x2 = xe - (h - r) * dx / de
        y2 = ye - (h - r) * dy / de
        self.add_coord(x2, y2)
        x3 = xh - w * dy / de
        y3 = yh + w * dx / de
        self.add_coord(x3, y3)