periodic_wrap

periodic_wrap(point, reference, period=6.283185307179586)[source]

Wrap point to the closest periodic copy relative to reference.

For each element, the returned value satisfies |wrapped[i] - reference[i]| <= period / 2 (up to floating-point rounding). This is the element-wise equivalent of orqviz’s relative_periodic_wrap.

Parameters:
  • point (TypeAliasType) – Parameter vector to wrap.

  • reference (TypeAliasType) – Reference parameter vector.

  • period (float) – Periodicity of each parameter. Defaults to \(2\pi\).

Return type:

ndarray[tuple[Any, ...], dtype[double]]

Returns:

Wrapped copy of point.