differt.rt.image_of_vertex_with_respect_to_mirror#
- image_of_vertex_with_respect_to_mirror(vertex, mirror_vertex, mirror_normal)[source]#
Return the image of the vertex with respect to the mirror.
- Parameters:
vertex (
Float[ArrayLike, '*#batch 3']) – Vertex that will be mirrored.mirror_vertex (
Float[ArrayLike, '*#batch 3']) – Mirror vertex. For each mirror, any vertex on the infinite plane that describes the mirror is considered to be a valid vertex.mirror_normal (
Float[ArrayLike, '*#batch 3']) – Mirror normal, where each normal has a unit length and is perpendicular to the corresponding mirror.
- Return type:
- Returns:
The image of the vertex.
Examples
In the following example, we show how to compute the images of a batch of random vertices. Here, normal vectors do not have a unit length, but they should have if you want an interpretable result.
>>> from differt.rt import ( ... image_of_vertex_with_respect_to_mirror, ... ) >>> >>> key = jax.random.key(0) >>> ( ... key0, ... key1, ... key2, ... ) = jax.random.split(key, 3) >>> *batch, num_mirrors = (10, 20, 30) >>> vertices = jax.random.uniform( ... key0, ... (*batch, 1, 3), # 1 so that it can broadcast with mirrors' shape ... ) >>> mirror_vertices = jax.random.uniform( ... key1, ... (num_mirrors, 3), ... ) >>> mirror_normals = jax.random.uniform( ... key2, ... (num_mirrors, 3), ... ) >>> images = image_of_vertex_with_respect_to_mirror( ... vertices, ... mirror_vertices, ... mirror_normals, ... ) >>> images.shape (10, 20, 30, 3)