ktk.geometry.scale#
- scale(coordinates, /, scales)[source]#
Scale a series of coordinates.
- Parameters:
coordinates – ArrayLike of shape (N, …): the coordinates to scale.
scales – ArrayLike of shape (N, ) that corresponds to the scale to apply uniformly on the three axes.
- Returns:
ArrayLike of shape (N, …): the scaled 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.]])