differt.rt.image_of_vertex_with_respect_to_mirror

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:
Return type:

Float[Array, '*batch 3']

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)