Example #1
0
def get_tikzpicture_body_beta(fs):
    """
    This alternative visualization literally warps the x axis.
    The other one makes a smoother picture by
    computing a different function for y that is equivalent to this warping.
    """
    ncurves = fs.ncurves
    morph = fs.morph
    # define the number of segments
    nsegs = 128
    npoints = nsegs + 1
    t_initial = -1.0
    t_final = 1.0
    incr = (t_final - t_initial) / float(nsegs)
    # define the sequence of t values
    t_seq = [t_initial + t*incr for t in range(npoints)]
    t_seq_inv_warped = [
            inv_warp(t)*morph + t*(1-morph) for t in t_seq]
    # define the sequences of y values
    y_seqs = []
    for i in range(ncurves):
        mypoly = sympy.chebyshevt_poly(i+1, sympy.abc.x, polys=True)
        y_seqs.append([mypoly.eval(t) for t in t_seq])
    width = 8
    height = 4
    text = interlace.tikz_superposition(
            t_seq_inv_warped, y_seqs, width, height)
    return text
Example #2
0
def get_tikzpicture_body_gamma(fs):
    """
    This was the latest pre-bezier version.
    """
    ncurves = fs.ncurves
    morph = fs.morph
    # define the number of segments
    nsegs = 128
    npoints = nsegs + 1
    t_initial = -1.0
    t_final = 1.0
    incr = (t_final - t_initial) / float(nsegs)
    # define the sequence of t values
    t_seq = [t_initial + t*incr for t in range(npoints)]
    # define the sequences of y values
    y_seqs = []
    for i in range(ncurves):
        mypoly = sympy.chebyshevt_poly(i+1, sympy.abc.x, polys=True)
        y_seq = [mypoly.eval(warp(t)*morph + t*(1-morph)) for t in t_seq]
        y_seqs.append(y_seq)
    width = 8
    height = 4
    return interlace.tikz_superposition(t_seq, y_seqs, width, height)