def splitN(line, n):
x0, y0, x1, y1 = line<EOL>out = empty((n, <NUM_LIT:4>), dtype=type(line[<NUM_LIT:0>]))<EOL>px, py = x0, y0<EOL>dx = (x1 - x0) / n<EOL>dy = (y1 - y0) / n<EOL>for i in range(n):<EOL><INDENT>o = out[i]<EOL>o[<NUM_LIT:0>] = px<EOL>o[<NUM_LIT:1>] = py<EOL>px += dx<EOL>py += dy<EOL>o[<NUM_LIT:2>] = px<EOL>o[<NUM_LIT:3>] = py<EOL><DEDENT>return out<EOL>
split a line n times
returns n sublines