some latex2html cosmetic (its still ugly)
[PyX/mjg.git] / manual / radii2.py
blob6fe3132b6f2d7c4f8e8e505a5fa8edef33bf1b75
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")