# Rotating lines around points

```import matplotlib.pyplot as plt from math import radians, sin, cos from PIL import Image fig = plt.figure(figsize=(6,6)) r, big_r = 100, 300 center_x, center_y = 0, 0 first_level_points, second_level_points = 2, 100 fname = 'params_{0}_{1}.png'.format(first_level_points, second_level_points) angle_step = 360 / first_level_points angle_step1 = 360 / second_level_points for p in range(first_level_points): rad = radians(p * angle_step) px = center_x + r * cos(rad) py = center_y + r * sin(rad) # Make points in circle now around these points and connect them! ps = [] for p in range(second_level_points): rad1 = radians(p * angle_step1) pxp = px + big_r * cos(rad1) pyp = py + big_r * sin(rad1) ps.append((pxp, pyp)) # Connect every k-point, where k is points/2 point_diff = int(second_level_points/2) for i in range(point_diff): p1x, p1y = ps[i] p2x, p2y = ps[i+point_diff] plt.plot([p1x, p2x], [p1y, p2y], '-', alpha=0.5, lw=0.3) plt.xlim(-150,150) plt.ylim(-150,150) plt.axis('off') plt.tight_layout() plt.savefig(fname, bbox_inches='tight', pad_inches=0) #plt.show() # Crop useless whitespace im = Image.open(fname) im = im.crop((48,5,557,545)) im.save(fname)```

We select the viewing area with xlim and ylim. To test various results, we vary the parameters for the first and second level points.