pyvista.core.utilities.axis_rotation#
- axis_rotation(points, angle, inplace=False, deg=True, axis='z')[ソース]#
軸を中心に角度をつけて点を回転させます.
- パラメータ:
- 戻り値:
numpy.ndarray
回転した点.
例
点の集合をx軸を中心に90度回転させるインプレース機能.
>>> import numpy as np >>> import pyvista as pv >>> from pyvista import examples >>> points = examples.load_airplane().points >>> points_orig = points.copy() >>> pv.axis_rotation(points, 90, axis='x', deg=True, inplace=True) >>> assert np.all(np.isclose(points[:, 0], points_orig[:, 0])) >>> assert np.all(np.isclose(points[:, 1], -points_orig[:, 2])) >>> assert np.all(np.isclose(points[:, 2], points_orig[:, 1]))