differt.geometry.path_lengths#
- path_lengths(paths)[source]#
Compute the path length of each path.
Each path is exactly made of
path_lengthvertices.- Parameters:
paths (
Float[ArrayLike, '*batch path_length 3']) – The array of path vertices.- Return type:
- Returns:
The array of path lengths.
Examples
The following example shows how to compute the length of a very simple path.
>>> from differt.geometry import ( ... path_lengths, ... ) >>> >>> path = jnp.array([[1.0, 0.0, 0.0], [1.0, 1.0, 0.0]]) >>> path_lengths(path) Array(1., dtype=float32) >>> path_lengths(jnp.vstack((path, path[::-1, :]))) Array(2., dtype=float32)