#def line$(x1$; y1$; x2$; y2$; style$) = '<line x1="'x1$'" y1="'y1$'" x2="'x2$'" y2="'y2$'" style$/>
#def rect$(x$; y$; w$; h$; style$) = '<rect x="'x$'" y="'y$'" width="'w$'" height="'h$'" style$/>
#def circle$(x$; y$; style$) = '<circle cx="'x$'" cy="'y$'" r="12" style$/>
#def texth$(x$; y$; s$) = '<text x="'x$'" y="'y$'" text-anchor="middle">s$</text>
#def textv$(x$; y$; s$) = '<text x="'x$'" y="'y$'" text-anchor="middle" transform="rotate(-90,'x$','y$')">s$</text>
#def sec_style$ = style="stroke:black; stroke-width:8; fill:lightyellow"
#def axis_style$ = stroke-dasharray="60,15,10,15" style="stroke:green; stroke-width:6"
#def dim_style$ = style="stroke:goldenrod; stroke-width:4; fill:goldenrod"
#def dimh$(x1$; x2$; y$; s$)
line$(x1$; y$ - 40; x1$; y$ + 40; dim_style$)
line$(x2$; y$ - 40; x2$; y$ + 40; dim_style$)
line$(x1$ - 40; y$; x2$ + 40; y$; dim_style$)
circle$(x2$; y$; dim_style$)
circle$(x1$; y$; dim_style$)
texth$((x1$ + x2$)/2; y$ - 30; s$)
#end def
#def dimv$(x$; y1$; y2$; s$)
line$(x$ - 40; y1$; x$ + 40; y1$; dim_style$)
line$(x$ - 40; y2$; x$ + 40; y2$; dim_style$)
line$(x$; y1$ - 40; x$; y2$ + 40; dim_style$)
circle$(x$; y1$; dim_style$)
circle$(x$; y2$; dim_style$)
textv$(x$ - 30; (y1$ + y2$)/2; s$)
#end def
