[Xy-pic] arrow head direction

r8yjke202 at sneakemail.com r8yjke202 at sneakemail.com
Mon Sep 5 17:54:07 CEST 2005


Hello,

my way to draw automata is to define the state positions and then to draw the transitions, p.ex.:

\[
\xy
%states
(0,30)*{q_0}*\xycircle(3.5,3.5){-}="q0";
(30,30)*{q_1}*\xycircle(3.5,3.5){-}="q1";
(30,0)*{q_2}*\xycircle(3.5,3.5){-}="q2";
%final state
(0,0)*{q_3}*\xycircle(3.0,3.0){-}*\xycircle(3.5,3.5){-}="q3";
%initial
(-5,30)*+{} = "i";
\ar @( l, r) "i"; "q0" <2pt>
%transitions
\ar @( r, l) "q0"; "q1" <2pt> ^{\txt{$a$}}
\ar @(dr,ul) "q0"; "q2" <2pt>
\ar @( d, u) "q1"; "q2" <2pt> ^{\txt{$b$}}
\ar @(dl,ur) "q1"; "q3" <2pt>
\ar @( l, r) "q2"; "q3" <2pt> ^{\txt{$c$}}
\ar @(ul,dr) "q2"; "q0" <2pt>
\ar @( d, u) "q3"; "q0" <2pt> ^{\txt{$d$}}
\ar @(ur,dl) "q3"; "q1" <2pt>
\endxy
\]

The problem is, that in three cases the arrow head points to the wrong direction (q1->q3, q2->q0, q3->q1):

http://img197.imageshack.us/img197/1327/wrong7wl.png

Changing the position of q1 and q2 slightly (+1pt to the right) leads to the right behaviour:

http://img277.imageshack.us/img277/6443/right2sb.png

So, is this a bug or a failure in my code?

Greetings,

Frank.



More information about the xy-pic mailing list