fixed a raw string
[PyX/mjg.git] / examples / path / intersect.py
blob5dcee79b87082806cfcfc736b2e7e6df8b453583
1 from pyx import *
3 p1 = path.curve(0, 0, 1, 0, 1, 1, 2, 1)
4 p2 = path.circle(1, 0.5, 0.5)
6 (a1, a2), (b1, b2) = p1.intersect(p2)
8 x1, y1 = p1.at(a1)
9 x2, y2 = p1.at(a2)
11 c = canvas.canvas()
12 c.fill(path.circle(x1, y1, 0.1), [color.rgb.blue])
13 c.fill(path.circle(x2, y2, 0.1), [color.rgb.blue])
14 c.stroke(p1, [color.rgb.red])
15 c.stroke(p2, [color.rgb.green])
16 c.writeEPSfile("intersect")
17 c.writePDFfile("intersect")