Commit 99762ee7 authored by Thomas Levine's avatar Thomas Levine
Browse files

spiral

parent 90b29ae5
......@@ -97,7 +97,13 @@ def two():
p(xs, lambda angle: 0.1 + 0.7 * math.cos(angle/rotations))
def spiral(xmin, ymin, xmax, ymax, max_rotations, rotations):
def spiral(xmin, ymin, xmax, ymax, max_rotations, rotations, degrees):
'''
max_rotations: the number of rotations in the largest circle possible
rotations: the number of rotations in the circle you're drawing
degrees: like in HPGL---90 degrees draws a square
'''
steps = int(360 / degrees)
all_coordinates = xmin, ymin, xmax, ymax
f = lambda a: a / max_rotations / (2 * math.pi)
return compose_centered_plot(all_coordinates, angles(180, rotations), f)
return compose_centered_plot(all_coordinates, angles(steps, rotations), f)
import irc.bot
from random import randint
from polar.polar import spiral
class ReportPlotBot(irc.bot.SingleServerIRCBot):
def __init__(self, observechannel, plotchannel, nickname, server, port=6667):
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment