~ubuntu-branches/ubuntu/trusty/pyx/trusty

« back to all changes in this revision

Viewing changes to examples/path/intersect.py

  • Committer: Bazaar Package Importer
  • Author(s): Thomas Viehmann
  • Date: 2006-11-26 14:04:53 UTC
  • mfrom: (2.1.3 edgy)
  • Revision ID: james.westby@ubuntu.com-20061126140453-1dq3cycpspmlik2t
Tags: 0.9-3
* New maintainer. Thank you for more than three years of
  maintenance,  Graham! Closes: #400087
* Don't hard-code python 2.3 in manual/Makefile.
  Thanks to Matthias Klose for the bug report and patch.
  Closes: #392634
* Remove obsolete dh_python call from debian/rules.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
from pyx import *
 
2
 
 
3
p1 = path.curve(0, 0, 1, 0, 1, 1, 2, 1)
 
4
p2 = path.circle(1, 0.5, 0.5)
 
5
 
 
6
(a1, a2), (b1, b2) = p1.intersect(p2)
 
7
 
 
8
x1, y1 = p1.at(a1)
 
9
x2, y2 = p1.at(a2)
 
10
 
 
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")