Commit
·
dc9063e
1
Parent(s):
8c4cb15
Add plot title to non-reflective image
Browse files
backend/nonreflecting_ray_tracing.py
CHANGED
@@ -98,8 +98,7 @@ def nonreflecting_plotter(a = 20, b = 20, r = 15, ray_count = 50):
|
|
98 |
ax.plot(x1, y1, color='green', lw=2, linestyle='--')
|
99 |
ax.plot(x2, y2, color='green', lw=2, linestyle='--')
|
100 |
|
101 |
-
|
102 |
-
ax.set_title(f'Rays with shadow from circle at ({a},{b}) radius {r}')
|
103 |
plt.grid(True)
|
104 |
plt.show()
|
105 |
|
|
|
98 |
ax.plot(x1, y1, color='green', lw=2, linestyle='--')
|
99 |
ax.plot(x2, y2, color='green', lw=2, linestyle='--')
|
100 |
|
101 |
+
ax.set_title(f'Rays with shadow from a perfectly absorbing circle at ({a},{b}) with radius {r}')
|
|
|
102 |
plt.grid(True)
|
103 |
plt.show()
|
104 |
|
backend/reflecting_ray_tracing.py
CHANGED
@@ -102,7 +102,8 @@ def reflecting_plotter(a = 20, b = 20, r = 15, ray_count = 15):
|
|
102 |
x, y = draw_line(angle)
|
103 |
ax.plot(x, y, color='red', lw=1, zorder=5)
|
104 |
# plot_reflection_on_circle(ax, angle, center=(a, b), radius=r)
|
105 |
-
|
|
|
106 |
plt.show()
|
107 |
fig.canvas.draw()
|
108 |
image_array = np.array(fig.canvas.renderer.buffer_rgba())
|
|
|
102 |
x, y = draw_line(angle)
|
103 |
ax.plot(x, y, color='red', lw=1, zorder=5)
|
104 |
# plot_reflection_on_circle(ax, angle, center=(a, b), radius=r)
|
105 |
+
ax.set_title(f'Rays with blocked/reflected rays from a perfectly reflective circle at ({a},{b}) with radius {r}')
|
106 |
+
plt.grid(True)
|
107 |
plt.show()
|
108 |
fig.canvas.draw()
|
109 |
image_array = np.array(fig.canvas.renderer.buffer_rgba())
|