rot3d90(A, X, K)

版本 3.1.0.0 (2.9 KB) 作者: Jos (10584)
Rotate 3D array over 90 degrees in a particular plane
132.0 次下载
更新时间 2018/1/19

查看许可证

rot3d90 - rotate 3D array 90 degrees around a specific axis

B = rot3D90(A, X) is the 90 degree counterclockwise rotation of the 3D
array A along a specific axis. X denotes the plane of rotation,
according to the table below. For instance, when X is 1 the plane of
rotation is formed by the 2nd and 3rd dimension.

rot3d90(A, X, K) is the K*90 degree rotation of A, K = +-1,+-2,...

If A has a dimension of [N, M, L], the dimensions of the rotation
depend on X. For value of X, the subindex in the X-th dimension will be
unaffected. Therefore, specific vectors will be unaffected.
Note that rot3d90(A,3) and rot90(A) produce the same result.

X Rotation plane Dimension of B Unaffected vectors
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1 dims 2 & 3 [N, L, M] N-by-1 (row)
2 dims 1 & 3 [L, M, N] 1-by-N (column)
3 dims 1 & 2 [M, N, L] 1-by-1-by-N (plane)

Example:
A = cat(3,[1 2 ; 3 4],[5 6 ; 7 8])
B = rot3d90(A, 2) % rotation in plane formed by 1st and 3rd dimension
% B(:,:,1) = 5 6
% 1 2
% B(:,:,2) = 7 8
% 3 4

See also rot90, flip

引用格式

Jos (10584) (2024). rot3d90(A, X, K) (https://www.mathworks.com/matlabcentral/fileexchange/65753-rot3d90-a-x-k), MATLAB Central File Exchange. 检索来源 .

MATLAB 版本兼容性
创建方式 R2017b
兼容任何版本
平台兼容性
Windows macOS Linux
类别
Help CenterMATLAB Answers 中查找有关 3-D Scene Control 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
版本 已发布 发行说明
3.1.0.0

Fixed an error for 2D inputs
added picture

3.0.0.0

Incorporated a variable by which you can specify the number of rotations, similar to rot90

2.0.0.0