Sophie

Sophie

distrib > Fedora > 15 > i386 > by-pkgid > 9b3ef98d82282343cfac7f840aa5ab34 > files > 350

PyX-0.11.1-1.fc15.i686.rpm

from pyx import *

def mark(x, y):
    return path.circle(x, y, 0.1)

c = canvas.canvas()

p1 = path.curve(0, 0, 1, 0, 1, 1, 2, 1)
c.stroke(p1)
c.fill(mark(*p1.atbegin()))
c.fill(mark(*p1.at(0.5*p1.arclen())))
c.fill(mark(*p1.atend()))

p2 = path.curve(3, 0, 4, 0, 4, 1, 5, 1)
c.stroke(p2)
c.fill(mark(*p2.at(p2.begin()+0.5)))
c.fill(mark(*p2.at(p2.end()-0.5)))

c.writeEPSfile("at")
c.writePDFfile("at")