2 import sys
;sys
.path
.insert(0, "..")
5 # File for invalid parametrisations of Bezier curves
6 # Check a-posteriori the sign of Delta y for the square-root solution of Delta x
9 return (-1-2*y
-sqrt((1+2*y
)**2+3))/3.0
11 return (-1-2*y
+sqrt((1+2*y
)**2+3))/3.0
13 con
= {"Dx_m":Dx_m
, "Dx_p":Dx_p
}
15 g
= graph
.graphxy(width
=10,
17 y
=graph
.axis
.lin(min=-2, max=2),
18 key
=graph
.key
.key(pos
="bl"),
20 g
.plot(graph
.data
.function("x(y)=6*y*Dx_m(y)", title
="minus-sol, lhs", context
=con
), [graph
.style
.line([color
.rgb
.red
])])
21 g
.plot(graph
.data
.function("x(y)=(1-3*Dx_m(y))*(1-y-sqrt(1+y+y*y))", title
="minus-sol, minus-rhs", context
=con
), [graph
.style
.line([color
.rgb
.blue
, style
.linestyle
.dashed
])])
22 g
.plot(graph
.data
.function("x(y)=6*y*Dx_p(y)", title
="plus-sol, lhs", context
=con
), [graph
.style
.line([color
.rgb
.green
])])
23 g
.plot(graph
.data
.function("x(y)=(1-3*Dx_p(y))*(1-y+sqrt(1+y+y*y))", title
="plus-sol, plus-rhs", context
=con
), [graph
.style
.line([style
.linestyle
.dashed
])])
24 g
.plot(graph
.data
.function("x(y)=(1-3*Dx_p(y))*(1-y-sqrt(1+y+y*y))", title
="plus-sol, minus-rhs", context
=con
), [graph
.style
.line([style
.linestyle
.dotted
])])
25 g
.plot(graph
.data
.function("x(y)=(1-3*Dx_m(y))*(1-y+sqrt(1+y+y*y))", title
="minus-sol, plus-rhs", context
=con
), [graph
.style
.line([style
.linestyle
.dotted
])])