def render(self, c): self.draw_centered_axes(c) ui.draw_ellipse(c, self.centerx, self.centery, self.width/4. * amplitude.value, self.height/4. * amplitude.value, 100) x = int(self.centerx + self.width/4. * amplitude.value * math.cos(2 * math.pi * (frequency.value * time + phase.value))) y = int(self.centery - self.height/4. * amplitude.value * math.sin(2 * math.pi * (frequency.value * time + phase.value))) ui.draw_ellipse(c, x, y, 5, 5, 16)
def render(self, c): self.draw_centered_axes(c) x = self.centerx y1 = int(self.height/4. * amplitude1.value * math.sin(2 * math.pi * (frequency1.value * time + phase1.value))) y2 = int(self.height/4. * amplitude2.value * math.sin(2 * math.pi * (frequency2.value * time + phase2.value))) y = self.centery - (y1 + y2) ui.draw_ellipse(c, x, y, 5, 5, 16)
def render(self, c): self.draw_left_aligned_axes(c) count = resolution.value * 20 for n in range(int(count)): i = n / count x = self.left + i * self.width y = self.centery - self.height/4. * amplitude.value * math.sin(2 * math.pi * (frequency.value * i + phase.value)) if n != 0 and not ((x < 0 or x > width) and (y < 0 or y > width) and (prevx < 0 or prevx > height) and (prevy < 0 or prevy > height)): ui.draw_line(c, prevx, prevy, x, y) prevx = x prevy = y if mode != 0: x = self.left + time * self.width y = int(self.centery - self.height/4. * amplitude.value * math.sin(2 * math.pi * (frequency.value * time + phase.value))) ui.draw_ellipse(c, x, y, 5, 5, 16)
def render(self, c): self.draw_centered_axes(c) x1 = int(self.width/4. * amplitude1.value * math.cos(2 * math.pi * (frequency1.value * time + phase1.value))) x2 = int(self.width/4. * amplitude2.value * math.cos(2 * math.pi * (frequency2.value * time + phase2.value))) y1 = int(self.height/4. * amplitude1.value * math.sin(2 * math.pi * (frequency1.value * time + phase1.value))) y2 = int(self.height/4. * amplitude2.value * math.sin(2 * math.pi * (frequency2.value * time + phase2.value))) x = self.centerx + x1 + x2 y = self.centery - (y1 + y2) ui.draw_ellipse(c, self.centerx, self.centery, self.width/4. * amplitude1.value, self.height/4. * amplitude1.value, 100) ui.draw_ellipse(c, self.centerx + x1, self.centery - y1, self.width/4. * amplitude2.value, self.height/4. * amplitude2.value, 100) ui.draw_ellipse(c, x, y, 5, 5, 16) if mode >= 4: for n in range(int(time*100)): i = n / 100. x1 = int(self.width/4. * amplitude1.value * math.cos(2 * math.pi * (frequency1.value * i + phase1.value))) x2 = int(self.width/4. * amplitude2.value * math.cos(2 * math.pi * (frequency2.value * i + phase2.value))) y1 = int(self.height/4. * amplitude1.value * math.sin(2 * math.pi * (frequency1.value * i + phase1.value))) y2 = int(self.height/4. * amplitude2.value * math.sin(2 * math.pi * (frequency2.value * i + phase2.value))) x = self.centerx + x1 + x2 y = self.centery - (y1 + y2) if n != 0: ui.draw_line(c, x, y, prevx, prevy) prevx = x prevy = y
def render(self, c): self.draw_centered_axes(c) x = self.centerx y = int(self.centery - self.height/4. * amplitude.value * math.sin(2 * math.pi * (frequency.value * time + phase.value))) ui.draw_ellipse(c, x, y, 5, 5, 16)