At 02:47 PM 9/26/2001 -0700, David Arnold wrote:
>In the second image in this file, I am disappointed to find that the vector
>doesn't look tangent to the path at the tip of the position vector.
now, are your disappointed in me, metapost, or yourself -)
how about: d:=direction 1 of p; since you *know* that 1,2 (not 1u,2u !) is
point 1 there is no need for time calculations
also, keep in mind that this times/point stuff is sensitive to rounding
errors (in that respect you can indeed be disappointed in mp)
now, your error result from calculating a time for a scaled point (watch
the 1u,2u) while you have no scaled path but scale it afterwards.
i think that your code snippet will become more clean if you say p := p
scaled u after setting p and then work on the scaled path, or alternatively
use no u's and only scale the whole to u, but this is a matter of taste.
i've fallen in this trap some times too [at first i thought that your
sample was a rounding error; suggestion: in such case draw d withpen
pencircle scaled 5 helps; add this to your code and you will see that you
got the point + 1,2 near point zero which indeed has the tangent you got.
Hans
-------------------------------------------------------------------------
Hans Hagen | PRAGMA ADE | [EMAIL PROTECTED]
Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
tel: +31 (0)38 477 53 69 | fax: +31 (0)38 477 53 74 | www.pragma-ade.com
-------------------------------------------------------------------------