MCPcopy
hub / github.com/tum-pbs/PhiFlow / orthogonal_vector

Function orthogonal_vector

phi/geom/_functions.py:235–240  ·  view source on GitHub ↗
(vector: Tensor)

Source from the content-addressed store, hash-verified

233
234
235def orthogonal_vector(vector: Tensor):
236 if vector.vector.size == 3:
237 x_not_parallel = (vector.vector[0] != 0)
238 ref = where(x_not_parallel, (0, 0, 1), (1, 0, 0))
239 return vec_normalize(cross(vector, ref))
240 raise NotImplementedError
241
242
243def rotation_matrix(x: Union[float, math.Tensor, None], matrix_dim=channel('vector'), none_to_unit=False) -> Optional[Tensor]:

Callers 1

to_splineFunction · 0.85

Calls 3

whereFunction · 0.90
vec_normalizeFunction · 0.85
crossFunction · 0.85

Tested by

no test coverage detected