Returns `True` is the ray is reflected.
(self, ray, geometry, container, adjacent)
| 229 | return self._delegate |
| 230 | |
| 231 | def is_reflected(self, ray, geometry, container, adjacent): |
| 232 | """ Returns `True` is the ray is reflected. |
| 233 | """ |
| 234 | r = self.delegate.reflectivity(self, ray, geometry, container, adjacent) |
| 235 | if not isinstance(r, (int, float, np.float, np.int)): |
| 236 | raise ValueError("Reflectivity must be a number.") |
| 237 | if r == 0.0: |
| 238 | return False |
| 239 | gamma = np.random.uniform() |
| 240 | return gamma < r |
| 241 | |
| 242 | def reflect(self, ray, geometry, container, adjacent): |
| 243 | """ Returns ray which is reflected from the interface. |