Pict2e package limitation

Hello,

It seems that the included pict2e package lacks important macro as \Vector:

) (ot1enc.dfu) (omsenc.dfu))) (pict2eo.sty (pict2eo.cfg) (p2eo-objecttex.def))
(C:\Users\User\AppData\Local\Temp\P_TEMP\texput.aux)
geometry detected driver: objecttex
(omscmr.fd)
! Undefined control sequence.
l.208 \Vector
(-7698.4,1883.2)(7698.4,-1883.2)

This macro is very important because the standard \vector macro is very limited.

What can I do?

An example with using the picture environment follows:
\setlength{\unitlength}{0.0045779mm}
\begin{picture}(16383,16383)(-8191.0,-8191.0)
\linethickness{0.5pt}
\put(-8191.0,0){\vector(1,0){16383}}
\put(0,-8191.0){\vector(0,1){16383}}
\linethickness{1pt}
\moveto(6553.2,0.0)
\lineto(6153.7,1408.7)
\lineto(5340.6,2891.4)
\lineto(4198.5,4198.5)
\lineto(2891.4,5340.6)
\lineto(1408.7,6153.7)
\lineto(0.0,6553.2)
\lineto(-1408.7,6153.7)
\lineto(-2891.4,5340.6)
\lineto(-4198.5,4198.5)
\lineto(-5340.6,2891.4)
\lineto(-6153.7,1408.7)
\lineto(-6553.2,0.0)
\lineto(-6153.7,-1408.7)
\lineto(-5340.6,-2891.4)
\lineto(-4198.5,-4198.5)
\lineto(-2891.4,-5340.6)
\lineto(-1408.7,-6153.7)
\lineto(0.0,-6553.2)
\lineto(1408.7,-6153.7)
\lineto(2891.4,-5340.6)
\lineto(4198.5,-4198.5)
\lineto(5340.6,-2891.4)
\lineto(6153.7,-1408.7)
\closepath
\strokepath
\put(40.4,-9.9){\circle*{300}}
\Vector(-7698.4,1883.2)(7698.4,-1883.2)
\put(8192.0,-163.8){\makebox(0,0)[tr]{$M_3$}}
\put(-163.8,8192.0){\makebox(0,0)[tr]{$M_2$}}
\put(7737.3,-1724.1){\makebox(0,0)[bl]{$M$}}
\linethickness{0.5pt}
\arc[0, 346.2541]{3276.6}
\put(-3415.7,411.7){\makebox(0,0)[br]{$\alpha$}}
\end{picture}

Thanks,
Stenio

Hello,
Yes, the included version of the pict2e package contains no \Vector definition.
\Vector can be converted to \vector as follows:
Suppose you want to draw \Vector(x1,y1)(x2,y2). Then let d = sqrt((x1-x2)^2+(y1-y2)^2) - the length of the vector. Also, let M=min(x2,y2). Then you can replace your \Vector with \put(x1,y1){\vector(x2/M,y2/M){d}}. In your case that would be \put(-7698.4,1883.2){\vector(4.0879,-1){15850.78}}.

Hello,

There is something that I don’t understand:
M = min(x2,y2) = min(7698.4,-1883.2) = -1883.2
so x2/M = 7698.4 / -1883.2 = -4.0879
and y2/M = 1
Furthermore M could be 0.
Another important issue is with nearly vertical vectors (x1 = -1.6, y1 = -8191.1, x2 = 1.6, y2 = 8191.1): the \Line macro works fine while the code above produce this:
\put(-1.64,-8191.12){\vector(1.00,5000.00){16382.24}}
which gives this error:
! Package pict2eo Error: Bad \line or \vector argument.

while the macro \Line(-1.6,-8191.1)(1.6,8191.1) works fine.

Thanks,
Stenio

You’re right. That was the special case, and not quite correct. The replacement in common case will be:
\put(x1,y1){\vector((x2-x1)/d,(y2-y1)/d){d}}. So in your example, \Vector(-7698.4,1883.2)(7698.4,-1883.2) can be converted to \put(-7698.4,1883.2){\vector(0.971,-0.238){15850.78}}. And \Vector(-1.6,-8191.1)(1.6,8191.1) to \put(-1.6,-8191.1){\vector(0,1){16382.2}}.

Thank you. Now it works perfectly.

Unfortunatelly I found something wrong with the length of the vector. In the example below the vector should start on the first circle and end on the second one, but it is not.
\put(-5204.80,3105.52){\circle*{300}}
\put(5204.80,-3105.52){\circle*{300}}
\put(-5204.80,3105.52){\vector(0.86,-0.51){12121.75}}

Yes, you’re right again. It’s a kind of an exercise to find the truth in docs. It turned out that the second argument of the \vector command is not the length of the vector, but the length of the Y-projection (y2 - y1) for vertical vectors and the length of the X-projection (x2-x1) for all other vectors. Thus, \Vector(-7698.4,1883.2)(7698.4,-1883.2) turns to \put(-7698.4,1883.2){\vector(0.971,-0.238){15396.8}}. The vertical one was correct. And the last one, the one between circles, turns to \put(-5204.80,3105.52){\vector(0.86,-0.51){10409.6}.