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