xopto.mcbase.mcutil.boundary module¶
- cos_critical(n1: float, n2: float) → float[source]¶
Cosine of the critical angle of incidence beyond which the incident beam is reflected at the boundary n1 => n2.
- Parameters
n1 (float) – Refractive index of the material on the incident side of the boundary.
n2 (float) – Refractive index of the material across the boundary.
- reflect(direction: numpy.ndarray, normal: numpy.ndarray) → numpy.ndarray[source]¶
Reflect the beam direction from a boundary with the given normal.
- Parameters
direction (np.ndarray) – Propagation direction of the incident beam.
normal (np.ndarray) – Boundary surface normal (pointing inwards or outwards).
- Returns
reflected_dir – Propagation direction of the reflected beam.
- Return type
np.ndarray
- reflectance(n1: float, n2: float, costheta: float = 1.0) → float[source]¶
Computes reflectance of unpolarized light at the specified boundary.
- Parameters
n1 (float) – Refractive index of the material on the side of the incident beam.
n2 (float) – Refractive index of the material across the boundary.
costheta (float) – Cosine of the angle of incidence - perpendicular incidence by default (90 deg, cosine is 1).
- Returns
- Return type
Returns the reflectance of unpolarized light.
- refract(direction: numpy.ndarray, normal: numpy.ndarray, n1: float, n2: float) → numpy.ndarray[source]¶
Refract the beam across the given boundary with refractive indices n1 and n2.
- Parameters
direction (np.ndarray) – Propagation direction of the incident beam.
normal (np.ndarray) – Boundary surface normal (pointing inwards or outwards).
n1 (float) – Refractive index on the incident side of the medium.
n2 (float) – Refractive index across the boundary.
- Returns
direction – Propagation direction of the refracted beam.
- Return type
np.ndarray