Commit ae1c3552 authored by Thomas Levine's avatar Thomas Levine
Browse files

spiral

parent 21b07ac9
......@@ -96,3 +96,8 @@ def two():
xs = angles(steps, rotations)
p(xs, lambda angle: 0.1 + 0.7 * math.cos(angle/rotations))
def spiral(xmin, ymin, xmax, ymax, rotations):
all_coordinates = xmin, ymin, xmax, ymax
f = lambda a: a / rotations / (2 * math.pi)
return compose_centered_plot(all_coordinates, angles(180, rotations), f)
......@@ -8,3 +8,8 @@ def test_compose():
observed = polar.compose_centered_plot((1000,2000,1400,3300), polar.angles(4, rotations), lambda a: a / rotations / (2 * math.pi))
expected = 'PU;PD200,650,200,675,150,650,200,575,300,650,200,775,50,650,199,475;'
n.assert_equal(observed, expected)
def test_spiral():
observed = polar.spiral(1000,2000,1400,3300, 20)
expected = ''
n.assert_equal(observed, expected)
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