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

Otared Kavian otared at gmail.com
Wed Dec 9 16:57:35 CET 2020


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 both the end points of this segment (that is in this example, a point before z1 and a point after z2 on the straight line) .
Indeed it is possible to write the equation of the line and then compute by hand the coordinates of the new end points, but I think there is a simpler way in Metafun to do this.

Thanks for any help: Otared

More information about the ntg-context mailing list