methods get_y
This commit is contained in:
parent
1cf23ce4cf
commit
ab5b5aa6f0
|
@ -124,7 +124,14 @@ class Nodeset(list):
|
|||
self.splines = [CubicSpline(self[ii].x, a[ii], b[ii], c[ii],
|
||||
d[ii]) for ii in xrange(n)]
|
||||
|
||||
def get_y(self, t):
|
||||
def get_y(self, t, loop=False, natural=False):
|
||||
if loop:
|
||||
t %= self[-1].x
|
||||
elif not natural:
|
||||
if t < self[0].x:
|
||||
t = self[0].x
|
||||
elif t > self[-1].x:
|
||||
t = self[-1].x
|
||||
splines = self.splines
|
||||
for ii in xrange(len(splines) - 1):
|
||||
if t < splines[ii + 1].x:
|
||||
|
|
Loading…
Reference in New Issue