MathGroup Archive 2005

[Date Index] [Thread Index] [Author Index]

Search the Archive

Why is the Arrow routine so poor?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg55465] Why is the Arrow routine so poor?
  • From: "David Park" <djmp at earthlink.net>
  • Date: Thu, 24 Mar 2005 03:42:09 -0500 (EST)
  • Sender: owner-wri-mathgroup at wolfram.com

Here is some code that draws small arrows anchored at {1,0}.

Needs["Graphics`Arrow`"]

SetOptions[Arrow, HeadScaling -> Relative, HeadCenter -> 1/2, HeadWidth -> 1, 
   HeadLength -> 0.2]; 
frame[n_] := Show[Graphics[{Arrow[{1., 0}, {1. + 10^(-n), 0}], 
      Text["n = "n, Scaled[{0.1, 0.9}], {-1, 0}]}], Frame -> True, 
    FrameTicks -> None, PlotRange -> {{1. - 10^(-n), 1. + 2/10^n}, 
      {-2/10^n, 2/10^n}}]; 
Table[frame[n], {n, 4, 6, 0.1}]; 
SelectionMove[EvaluationNotebook[], All, GeneratedCell]
FrontEndTokenExecute["OpenCloseGroup"]; Pause[0.5]; 
FrontEndExecute[{FrontEnd`SelectionAnimate[200, AnimationDisplayTime -> 0.1, 
    AnimationDirection -> Forward]}]

You will see that the arrowhead becomes detached from its normal position at the end of the line and moves all over the line, eventually being lost from view.

Obviously, if we make the arrow too short we are going to run into precision problems - but these arrows don't seem to be that short as we still have 10 places of machine precision left.

It seems to me that the fundamental design of Arrow is flawed in that it specifies the starting and ending point of the arrow. Wouldn't it have been better to specify the starting location and then the vector itself, anchored at zero? I don't know how the internals of the routine work, but it seems things would have worked better if the vector were first drawn and then shifted to the starting point.

(Incidentally, you can also try the following experiment. Open the Help browser to any Help page and open the example section. Then paste the above code at the bottom of the Help page. Then evaluate and try to stop the animation. I'd be interested if I am the only one who has a problem with this.)

David Park
djmp at earthlink.net
http://home.earthlink.net/~djmp/ 




  • Prev by Date: Re: Re: TrigExpand - Odd behavior
  • Next by Date: Re: Newbie Question About An Error Message
  • Previous by thread: Re: Hypergeometric integral looks wrong ?
  • Next by thread: Re: Why is the Arrow routine so poor?