def renderTraj(pars, H):
    if (pars.shape[1] == 2):
        pars = np.concatenate((pars, np.zeros((2, 1))), 1)
        ns = 2
    else:
        ns = 5
    ns = np.max([2, ns])
    rangeint = np.linspace(0, 1, ns)
    for timeinst in range((rangeint.shape[0] - 1)):
        ti0 = rangeint[timeinst]
        ti1 = rangeint[(timeinst + 1)]
        start = ((pars[:, 0] + (pars[:, 1] * ti0)) + (pars[:, 2] * (ti0 * ti0)))
        end = ((pars[:, 0] + (pars[:, 1] * ti1)) + (pars[:, 2] * (ti1 * ti1)))
        start = np.round(start).astype(np.int32)
        end = np.round(end).astype(np.int32)
        (rr, cc, val) = line_aa(start[0], start[1], end[0], end[1])
        valid = np.logical_and(np.logical_and((rr < H.shape[0]), (cc < H.shape[1])), np.logical_and((rr > 0), (cc > 0)))
        rr = rr[valid]
        cc = cc[valid]
        val = val[valid]
        if (len(H.shape) > 2):
            H[(rr, cc, 0)] = 0
            H[(rr, cc, 1)] = 0
            H[(rr, cc, 2)] = val
        else:
            H[(rr, cc)] = val
    return H
def renderTraj(pars, H):
    if (pars.shape[1] == 2):
        pars = np.concatenate((pars, np.zeros((2, 1))), 1)
        ns = 2
    else:
        ns = 5
    ns = np.max([2, ns])
    rangeint = np.linspace(0, 1, ns)
    for timeinst in range((rangeint.shape[0] - 1)):
        ti0 = rangeint[timeinst]
        ti1 = rangeint[(timeinst + 1)]
        start = ((pars[:, 0] + (pars[:, 1] * ti0)) + (pars[:, 2] * (ti0 * ti0)))
        end = ((pars[:, 0] + (pars[:, 1] * ti1)) + (pars[:, 2] * (ti1 * ti1)))
        start = np.round(start).astype(np.int32)
        end = np.round(end).astype(np.int32)
        (rr, cc, val) = line_aa(start[0], start[1], end[0], end[1])
        valid = np.logical_and(np.logical_and((rr < H.shape[0]), (cc < H.shape[1])), np.logical_and((rr > 0), (cc > 0)))
        rr = rr[valid]
        cc = cc[valid]
        val = val[valid]
        if (len(H.shape) > 2):
            H[(rr, cc, 0)] = 0
            H[(rr, cc, 1)] = 0
            H[(rr, cc, 2)] = val
        else:
            H[(rr, cc)] = val
    return H