autopdex.geometry.sdf_parallelogram_2d

autopdex.geometry.sdf_parallelogram_2d(x, x_p1, x_p2, x_p3)[source]

Normalized signed smooth distance function to a parallelogram, positive in the interior.

Usage for rectangle with vertices [[0,0],[0,1],[1,1],[1,0]]: sdf_parallelogram(x, [0,0], [0,1], [1,0])

Parameters:
  • x (jnp.ndarray) – The point where the distance is evaluated.

  • x_p1 (jnp.ndarray) – First vertex of the parallelogram.

  • x_p2 (jnp.ndarray) – Second vertex of the parallelogram.

  • x_p3 (jnp.ndarray) – Third vertex of the parallelogram.

Returns:

The signed distance from the point x to the parallelogram.

Return type:

float