In [111]:
from __future__ import division

In [112]:
x_e = 0.063 / 2

In [113]:
x_e


Out[113]:
0.0315

In [114]:
d = 2

In [115]:
theta = radians(10)

In [116]:
y_e = .3

In [117]:
l_1 = .7

In [118]:
l_2 = 0.0254 / 2 # half the width of a DMD chip

In [119]:
l_2


Out[119]:
0.0127

In [120]:
x_1 = 0

In [121]:
x_2 = linspace(-l_2, l_2)

In [122]:
x_3_max = y_e * ( ( tan(2*theta) - (x_2 - l_1) / d ) / ( 1 + tan(2*theta) * (x_2 - l_1) / d ) ) + x_2

In [123]:
x_3_min = y_e * ( ( tan(2*theta) - (x_2 - (-l_1)) / d ) / ( 1 + tan(2*theta) * (x_2 - (-l_1)) / d ) ) + x_2

In [124]:
subplot(211)
hold(False)
plot(x_2, [x_e]*len(x_2), 'k--', x_2, [-x_e]*len(x_2), 'r--')
fill_between(x_2, x_3_min, x_3_max, alpha=0.25, color='b')
ylim([-.3, .3])
xlabel("Horizontal position of pixel on DMD (m)")
ylabel("Horizontal position of ray endpoint at eye height")
legend(["Right eye", "Left eye"], loc="best")
title("All Mirrors at +10 degrees")


Out[124]:
<matplotlib.text.Text at 0x110689550>

In [125]:
x_3_max_off = y_e * ( ( tan(2*-theta) - (x_2 - l_1) / d ) / ( 1 + tan(2*-theta) * (x_2 - l_1) / d ) ) + x_2

In [126]:
x_3_min_off = y_e * ( ( tan(2*-theta) - (x_2 - (-l_1)) / d ) / ( 1 + tan(2*-theta) * (x_2 - (-l_1)) / d ) ) + x_2

In [127]:
subplot(212)
hold(False)
plot(x_2, [x_e]*len(x_2), 'k--', x_2, [-x_e]*len(x_2), 'r--')
fill_between(x_2, x_3_min_off, x_3_max_off, alpha=0.25, color='b')
ylim([-.3, .3])
xlabel("Horizontal position of pixel on DMD (m)")
ylabel("Horizontal position of ray endpoint at eye height")
legend(["Right eye", "Left eye"], loc="best")
title("All Mirrors at -10 degrees")


Out[127]:
<matplotlib.text.Text at 0x10753db10>

In [127]: