py3dframe.Transform.transform#

Transform.transform(*, point: ndarray | None = None, vector: ndarray | None = None) ndarray[source]#

Transform a point or a vector from the input frame to the output frame.

If the point is provided, the method will return the coordinates of the point in the output frame. If the vector is provided, the method will return the coordinates of the vector in the output frame.

Several points / vectors can be transformed at the same time by providing a 2D numpy array with shape (3, N).

If both the point and the vector are provided, the method will raise a ValueError. If neither the point nor the vector is provided, the method will return None.

In the convention 0:

\[X_{\text{output_frame}} = R^{-1} * (X_{\text{input_frame}} - T)\]
\[V_{\text{output_frame}} = R^{-1} * V_{\text{input_frame}}\]
Parameters:
  • point (Optional[array_like], optional) – The coordinates of the point in the input frame with shape (3, 1). Default is None.

  • vector (Optional[array_like], optional) – The coordinates of the vector in the input frame with shape (3, 1). Default is None.

Returns:

The coordinates of the point or the vector in the output frame with shape (3, 1).

Return type:

numpy.ndarray

Raises:

ValueError – If the point or the vector is not provided.