2 import sys
;sys
.path
.insert(0, "..")
5 # File for invalid parametrisations of Bezier curves
9 return (-1-2*Dy
-sqrt((1+2*Dy
)**2+3))/3.0
12 return (-1-2*Dy
+sqrt((1+2*Dy
)**2+3))/3.0
14 def acurve(Dx_fct
, Dy
, Dx
=None):
17 p
= path
.curve(0,0, 0,1, Dx
,1+Dy
, 1,0)
19 c
.stroke(p
, [deco
.shownormpath()])
20 c
.text(-0.2, -10*unit
.x_pt
, r
"\noindent$\Delta x=%g $\par\noindent$\Delta y=%g$"%(Dx
,Dy
),
21 [text
.parbox(4), text
.size
.footnotesize
])
27 c
= acurve(Dx_m
, 1); cc
.insert(c
, [trafo
.translate(dx
, 0)])
28 c
= acurve(Dx_m
, -1); cc
.insert(c
, [trafo
.translate(2*dx
, 0)])
29 c
= acurve(Dx_m
, -2); cc
.insert(c
, [trafo
.translate(0, dy
)])
30 c
= acurve(Dx_p
, -1); cc
.insert(c
, [trafo
.translate(dx
, dy
)])
31 c
= acurve(Dx_p
, -3); cc
.insert(c
, [trafo
.translate(2*dx
, dy
)])