On 12/9/2020 9:38 PM, Aditya Mahajan wrote:
Or just redefine shortened to accept a pair!
\startMPdefinitions
primarydef p shortened d =
reverse ( ( reverse (p enlonged -xpart paired(d)) ) enlonged -ypart
paired(d) )
enddef ;
\stopMPdefinitions
patched but then also:
primarydef p
Thanks Aditya!
One can learn a lot with your answers !
In the Metafun manual I see enlonged but I did not know to use it.
Best regards: Otared
> On 9 Dec 2020, at 21:38, Aditya Mahajan wrote:
>
> On Wed, 9 Dec 2020, Otared Kavian wrote:
>
>> Hi Aditya,
>>
>> Thanks for the alternative
On Wed, 9 Dec 2020, Otared Kavian wrote:
> Hi Aditya,
>
> Thanks for the alternative method, which comes handy if one wishes to extend
> the straight line by a different amount at either end:
>
> \starttext
> \startMPcode
>z1 = (1cm,3cm) ;
>z2 = (5cm, 9cm) ;
>z3 = 1cm * dir(angle
Hi Aditya,
Thanks for the alternative method, which comes handy if one wishes to extend
the straight line by a different amount at either end:
\starttext
\startMPcode
z1 = (1cm,3cm) ;
z2 = (5cm, 9cm) ;
z3 = 1cm * dir(angle (z2 - z1)) shifted z2 ;
z4 = -.5cm*dir(angle(z2 - z1))
On Wed, 9 Dec 2020, Otared Kavian wrote:
> Thanks a lot ! Indeed that does the job, which shows how wonderful Metafun is
> !
Or, if you want to use high school algebra:
\starttext
\startMPcode
z1 = (1cm,3cm) ;
z2 = (5cm, 9cm) ;
z3 = 1cm * dir(angle (z2 - z1)) shifted z2;
draw
Hi Fabrice,
Thanks a lot ! Indeed that does the job, which shows how wonderful Metafun is !
Best regards: Otared
> On 9 Dec 2020, at 17:19, Fabrice L wrote:
>
> Hi,
>
>> Le 9 déc. 2020 à 10:57, Otared Kavian a écrit :
>>
>> Hi,
>>
>> I have a silly question: given two points in the plane
Hi,
> Le 9 déc. 2020 à 10:57, Otared Kavian a écrit :
>
> Hi,
>
> I have a silly question: given two points in the plane
> z1 = (1cm,3cm) ;
> z2 = (5cm, 9cm) ;
> the command
> draw z1 -- z2 withpen pencircle scaled .5pt ;
> draws the line segment joining z1 and z2. How could
Hi,
I have a silly question: given two points in the plane
z1 = (1cm,3cm) ;
z2 = (5cm, 9cm) ;
the command
draw z1 -- z2 withpen pencircle scaled .5pt ;
draws the line segment joining z1 and z2. How could I draw the line segment
which goes a little further (say 1cm) than