ktk.geometry.scale

Contents

ktk.geometry.scale#

scale(coordinates, /, scales)[source]#

Scale a series of coordinates.

Parameters:
  • coordinates – Array_like of shape (N, …): the coordinates to scale.

  • scales – Array_like of shape (N, ) that corresponds to the scale to apply uniformly on the three axes.

Returns:

Array_like of shape (N, …): the translated coordinates.

Return type:

np.ndarray

Examples

Scale the point (1, 0, 0) by x, for x in [0, 1, 2, 3, 4]:

>>> import kineticstoolkit.lab as ktk
>>> s = np.array([0, 1, 2, 3, 4])
>>> ktk.geometry.scale([[1, 0, 0, 1]], s)
array([[0., 0., 0., 1.],
       [1., 0., 0., 1.],
       [2., 0., 0., 1.],
       [3., 0., 0., 1.],
       [4., 0., 0., 1.]])