(N, R)
| 366 | # https://rufat.be/triangle/examples.html |
| 367 | # effective: qpa0.1 |
| 368 | def circle(N, R): |
| 369 | i = np.arange(N) |
| 370 | theta = i * 2 * np.pi / N |
| 371 | pts = np.stack([np.cos(theta), np.sin(theta)], axis=1) * R |
| 372 | seg = np.stack([i, i + 1], axis=1) % N |
| 373 | return pts, seg |
| 374 | |
| 375 | pts0, seg0 = circle(30, 1.4) |
| 376 | pts1, seg1 = circle(16, 0.6) |