Python – 234234 201
# example for defining lists and n
l=[[1,2,3,4],
[5],
[6,7,8,9]]
n=1
# counting code
j=1j
r=[1m=max(map(len,l))+len(l)
M=range(-m,m)
e=enumerate
d=[[v for x in M for i,u in e(l)for k,v in e(u)if[1,1+j,j,j-1,-1,-j-1,-j,1-j][n]j][n]*(k-(len(u)-1)/2+j*i)==x+y*j]for y in M]
m=maxprint[x for x in d if x]
Ungolfed Version
rotation = [1,1+1j,1j,1j-1,-1,-1j-1,-1j,1-1j][n]
m = max(map(len,l))*len+len(l)*9
M=rangeoutput = []
for y in range(-m,m)
D=[]:
for y in M:
d=[]line = []
for x in Mrange(-m,m):
for i,usublist in enumerate(l):
for k,ventry in enumerate(usublist):
if r*rotation * ( k-(len(usublist)-1)/2+1j*i2 + i*1j )==x+y*1j == x + y*1j:d+=[v]
line += [entry]
if dline != []:D+=[d]
output += [line]
print Doutput
Preliminary answer, as I haveThis uses that multiplication (of a complex number) by a complex number corresponds to do other stuff now. I will likely further golf this down later todayrotating and stretching. The value of m[1,1+1j,1j,1j-1,-1,-1j-1,-1j,1-1j]
are complex numbers corresponding to the required angles and using the smallest scaling factor such that for an integer complex input the output is a blatant overestimationagain integer complex.