4 from pyx
.normpath
import normpathparam
6 def mark(c
, t
, phi
, x
, y
):
7 c
.stroke(path
.line(x
-0.1, y
, x
+0.1, y
))
8 c
.stroke(path
.line(x
, y
-0.1, x
, y
+0.1))
9 t
= text
.text(x
, y
, t
, [text
.halign
.center
, text
.vshift
.mathaxis
])
10 t
.circlealign(0.2, math
.cos(phi
*math
.pi
/180), math
.sin(phi
*math
.pi
/180))
13 b
= path
.curve(0, 0, 0, 0.5, 0, 1, 4, 4).normpath()
14 l
= path
.line(*(b
.atbegin() + b
.atend()))
15 c
.draw(l
, [deco
.shownormpath()])
16 c
.draw(b
, [deco
.shownormpath()])
17 mark(c
, "A", 180, 0, 0)
18 mark(c
, "B", 180, 0, 0.5)
19 mark(c
, "C", 180, 0, 1)
21 mark(c
, "Y", -45, 2, 2)
22 mark(c
, "X", 90, *b
.at(normpathparam(b
, 0, 0.5)))
23 mark(c
, "X'", 135, *b
.at(0.5*b
.arclen()))
24 c
.writeEPSfile("beziertoline")