correct table format
[PyX.git] / manual / radii2.py
blob6a074b05568e153fe4e04f2b4346d3f488fac8ca
1 from pyx import *
2 c = canvas.canvas()
4 circle = path.circle(0, 0, 2)
5 line = path.line(-3, 1, 3, 2)
7 isects_circle, isects_line = circle.intersect(line)
9 arc1, arc2 = circle.split(isects_circle)
11 arc = arc1.arclen()<arc2.arclen() and arc1 or arc2
13 isects_line.sort()
14 line1, line2, line3 = line.split(isects_line)
16 segment = line2 << arc
18 c.fill(segment, [color.grey(0.9)])
20 c.stroke(circle, [style.linewidth.Thick])
21 c.stroke(line, [style.linewidth.Thick])
23 for isect in isects_circle:
24 c.stroke(path.line(0, 0, *circle.at(isect)))
26 c.writeEPSfile("radii2")
27 c.writePDFfile("radii2")