def val_zn(self, addr, tags, data, source): idx = int(re.search("(\d+)$", addr).groups()[0]) #self.cmdcenter.cmd("state.zn[%d] = %f + %fj" % (idx, data[1], data[0])) old = self.state.zn[idx] val = complex(data[1], data[0]) self.cmdcenter.radial_2d('zn', idx, self.app.midi_speed, r_to_p(old), r_to_p(val))
def linear_2d(t, data): """ 2 dimensional linear path """ if t > 1: t = data["loop"] and fmod(t, 1.0) or 1 return ( complex(data["s"].real * (1 - t) + data["e"].real * t, data["s"].imag * (1 - t) + data["e"].imag * t), t != 1 or data["loop"], )
def do(self, t): if(t > 1): t = self.loop and fmod(t, 1.0) or 1 return (complex(self.s.real * (1 - t) + self.e.real * t, self.s.imag * (1 - t) + self.e.imag * t), t != 1 or self.loop)