Re: [NTG-context] Metafun: how to draw a straight line past the end points

2020-12-09 Thread Hans Hagen
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

Re: [NTG-context] Metafun: how to draw a straight line past the end points

2020-12-09 Thread Otared Kavian
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

Re: [NTG-context] Metafun: how to draw a straight line past the end points

2020-12-09 Thread Aditya Mahajan
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

Re: [NTG-context] Metafun: how to draw a straight line past the end points

2020-12-09 Thread Otared Kavian
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))

Re: [NTG-context] Metafun: how to draw a straight line past the end points

2020-12-09 Thread Aditya Mahajan
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

Re: [NTG-context] Metafun: how to draw a straight line past the end points

2020-12-09 Thread Otared Kavian
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

Re: [NTG-context] Metafun: how to draw a straight line past the end points

2020-12-09 Thread Fabrice L
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

[NTG-context] Metafun: how to draw a straight line past the end points

2020-12-09 Thread Otared Kavian
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