[metapost] Cannot draw line at specified direction

Taco Hoekwater taco at elvenkind.com
Mon Nov 8 15:15:17 CET 2010


On 11/07/2010 05:59 PM, Yasir Malik wrote:
> Hello,
>
> I am unable to draw a line at the angle specified in the dir() function.
> Here's what I'm doing:
> beginfig(1);
> u = 1cm;
> pair C, D;
> cdLen = 4u;
>
> C = (3u, 0);
> D = cdLen*dir(91);
>
> draw C--D;
>
> endfig;
>
>
> The line is not at 91 degrees.

Your point D is at 4cm*91 degrees from (0,0), and it has no relation to
C at all. Did you mean to do this?

   D = cdLen*dir(91) + C;

Best wishes,
Taco


More information about the metapost mailing list