1 >>> import ion.xn.curve as amc
2 >>> amc._tile ([0,1,2,3], [40, 64, -1, 4], 1, (4,6))
3 ([0, 1, 2, 3, 4, 5, 6], [40, 64, -1, 4, 40, 64, -1])
5 >>> amc._tile ([0,1,2,3], [40, 64, -1, 4], -1, (-3, -1))
6 ([-3, -2, -1, 0, 1, 2, 3], [64, -1, 4, 40, 64, -1, 4])
8 >>> amc._extend ([0,1,2,3], [40, 64, -1, 4], 1, (4,6))
9 [0,1,2,3,4,5,6], [40, 64, -1, 4, 44, 68, 3]
11 >>> amc._extend ([0,1,2,3], [40, 64, -1, 4], -1, (-3, -1))
12 [-3, -2, -1, 0, 1, 2, 3], [24, -41, -36, 40, 64, -1, 4]
15 # XXX instead of expanding the spline, wrap the requested X values and add an appropriate offset.
16 # eg for tile with a spline ranging 0..n values of X, you would just return spl(x % max(spl))
17 # for min(spl) != 0, normalization must also be performed : spl (((x - min(spl)) % max(spl)) + min(spl))
19 >>> ms = amc.multiSpline ([0,.25,.50,.75,1.], [[0, 0, 0], [.4, .05, .1], [.5, .25, .3],
20 ... [1., 0.95, .6], [1., 1., 1.]], k = 3)
23 >>> numpy.round(ms(numpy.arange(0,1.01, 1./8)), 2)
24 array([[-0. , -0. , 0. ],
34 Notice the overflow above: >1 is not legal.
37 >>> ms = amc.multiSpline ([0,.25,.50,.75,1.], [[0, 0, 0], [.4, .05, .1], [.5, .25, .3],
38 ... [1., 0.95, .6], [1., 1., 1.]], k = 3, subdiv = True, protected = ( (0,1), (1,2), (2,3),))
40 >>> numpy.round(ms(numpy.arange(0,1.01, 1./8)), 2)
41 array([[-0. , -0. , 0. ],