differt.geometry.orthogonal_basis#
- orthogonal_basis(u)[source]#
Generate
vandw, two other arrays of unit vectors that form with inputuan orthogonal basis.- Parameters:
u (
Float[ArrayLike, '*batch 3']) – The first direction of the orthogonal basis. It must have a unit length.- Return type:
- Returns:
A pair of unit vectors,
vandw.
Examples
The following example shows how this function works on basic input vectors.
>>> from differt.geometry import ( ... normalize, ... orthogonal_basis, ... ) >>> >>> u = jnp.array([1.0, 0.0, 0.0]) >>> orthogonal_basis(u) (Array([-0., 1., 0.], dtype=float32), Array([ 0., -0., 1.], dtype=float32)) >>> u, _ = normalize(jnp.array([1.0, 1.0, 1.0])) >>> orthogonal_basis(u) (Array([-0. , -0.7071068, 0.7071068], dtype=float32), Array([ 0.8164966, -0.4082483, -0.4082483], dtype=float32))