============= nc_line_exp() ============= .. admonition:: Command: nc_line_exp(x1, y1, x2, y2, nodes, delta, mode) Create a node-chain with variable node-spacing. **Parameter** | :red:`x1,y1` Start-node coordinates | :red:`x2,y2` End-node coordinates | :red:`nodes` No. of nodes | :red:`delta` Position of the node-spacing-change (*0 < delta < 1*) | :red:`mode` Mode of the node-spacing-change (possible values: *'begin', 'end', 'both'*) **Examples:** Line between points p1=(x1,y1) and p2=(x2,y2) with 9 nodes. .. sourcecode:: lua nodes = 9 delta = a/(a+b) -- in the image below, delta would be 0.25 nc_line_exp(x1,y1, x2,y2, nodes, delta, 'begin') .. figure:: nc_line_exp.png which is the same, as using the following code: .. sourcecode:: lua xm = x1 + (x2-x1)*delta ym = y1 + (y2-y1)*delta nc_line(x1,y1, xm,ym, math.floor(nodes/2)) -- draws line 'a' nc_line(xm,ym, x2,y2, math.ceil(nodes/2)) -- draws line 'b' Using ``mode = 'end'`` will automatically set ``delta = 1-delta`` interally. ``mode = 'both'`` will split the line into three parts, instead of two.