binary matrices with directional non-zero elements
If you assume that your image origins from sampling a continuous-spatial-domain 2-dimensional function, you can perform the sampling of this function with the rotated coordinates. HAve a look at this example:

N = 32  # 32 for simplicity
N2 = N/2
x, y = np.meshgrid(np.arange(N), np.arange(N))

# exemplary rotation around 5 degrees
angle = 5*np.pi/180
# perform rotation around the image center
nx = np.cos(angle)*(x-N2) - np.sin(angle)*(y-N2) + N2
ny = np.sin(angle)*(x-N2) + np.cos(angle)*(y-N2) + N2

# three functions that fulfill your constraint of even-odd 1-0
I_func1 = lambda x, y: 0.5*(1-np.cos(np.pi*y))
I_func2 = lambda x, y: (abs((y%2)-1)&lt;=0.5).astype(float)
I_func3 = lambda x, y: (1-abs((y%2)-1)).astype(float)

# the original image
I = I_func1(x, y)

plt.figure()
t = np.linspace(0, N-1, 16*N)
t2 = np.arange(N)
plt.plot(t, I_func1(0, t))
plt.plot(t, I_func2(0, t))
plt.plot(t, I_func3(0,t))
plt.stem(t2, I_func(0, t2))
plt.xlim((0, 5))
plt.title('underlying continuous function')

plt.figure(figsize=(12,12))
plt.subplot(221)
plt.imshow(I, interpolation='none', cmap='gray')

plt.subplot(222)
plt.imshow(I_func1(nx, ny), interpolation='none', cmap='gray')
plt.title("Cos")

plt.subplot(223)
plt.imshow(I_func2(nx, ny), interpolation='none', cmap='gray')
plt.title("rect")

plt.subplot(224)
plt.imshow(I_func3(nx, ny), interpolation='none', cmap='gray')
plt.title("triang")


Output:




As you see, different functions yield different rotation results. Maybe this can help you to find an explicity formula?