% Context file
% Filename: test.tex
% Willi Egger
% 12-04-2021

\startuniqueMPgraphic{Hive}
	numeric b,d,u ;
	path p[], line[] ;
	pair Pkt[],destination[];

	u :=  0.1 mm ;	
	b :=  360u ;
	d :=  260u ;

	
	p[1] := fullsquare xscaled b yscaled d ;

	destination[1] := dir(-60) * 200u ;
	destination[2] := dir(-120) * 200u	;
	
	line[1] := llcorner p[1]--lrcorner p[1];

	line[2] := ulcorner p[1] -- destination[1] ;
	line[3] := urcorner p[1] -- destination[2] ;
	
	line[10] := (ulcorner p[1]--urcorner p[1]) rotatedaround(ulcorner p[1],-60) ;
	line[11] := (urcorner p[1]--ulcorner p[1]) rotatedaround(urcorner p[1],60) ;
	
	Pkt[1] := line[2] intersectionpoint line[1] ;
	Pkt[2] := line[3] intersectionpoint line[1] ;
	
	draw p[1] ;
	
	draw ulcorner p[1] -- Pkt[1] withcolor yellow;
	draw urcorner p[1] -- Pkt[2] withcolor yellow;
	draw destination[1] withpen pencircle scaled 3pt withcolor red;
	draw destination[2] withpen pencircle scaled 3pt withcolor green;
	
	draw  line[10] withcolor blue ;
	draw line[11] withcolor blue ;
	draw origin withpen pencircle scaled 3pt withcolor blue;
\stopuniqueMPgraphic

\starttext

	\useMPgraphic{Hive}

\stoptext