Skip to content
Snippets Groups Projects
Commit d8d37f6d authored by Achilles Kappis's avatar Achilles Kappis
Browse files

Update geometry generation functions to support the new interface of rotMat3d.m

parent dccbbc7e
Branches
No related tags found
1 merge request!10Update 3D rotations function interface
......@@ -3,7 +3,7 @@
% Author: Achilles Kappis
% e-mail: axilleaz@protonmail.com
%
% Date: 29/09/2024 (DD/MM/YYYY)
% Date: 14/11/2024 (DD/MM/YYYY)
%
% Copyright: MIT
% --------------------------------------------------
......@@ -339,7 +339,7 @@ function [omniPos, fig8Pos, triPos, boxPos, box2DPos, tetPos, fig8Vec, triVec, b
end
% Rotate and position
tetPos(:, measPosIdx, :) = omniPos(:, measPosIdx) + rotMat3d(0, 0, tetRot, [], "Degs") * tmpPos;
tetPos(:, measPosIdx, :) = omniPos(:, measPosIdx) + rotMat3d(0, 0, tetRot, [], true) * tmpPos;
end
case "uca"
% Get the angle of the positions on the circle
......@@ -347,10 +347,10 @@ function [omniPos, fig8Pos, triPos, boxPos, box2DPos, tetPos, fig8Vec, triVec, b
% Rotate and position tetrahedrals
for measPosIdx = numel(az):-1:1
tetPos(:, measPosIdx, :) = omniPos(:, measPosIdx) + rotMat3d(0, 0, az(measPosIdx), [], "Degs") * tmpPos;
tetPos(:, measPosIdx, :) = omniPos(:, measPosIdx) + rotMat3d(0, 0, az(measPosIdx), [], true) * tmpPos;
end
case "single"
tetPos = omniPos + rotMat3d(30, 30, 0, [], "Degs") * tmpPos;
tetPos = omniPos + rotMat3d(30, 30, 0, [], true) * tmpPos;
end
end
......@@ -358,32 +358,32 @@ function [omniPos, fig8Pos, triPos, boxPos, box2DPos, tetPos, fig8Vec, triVec, b
% Translate and rotate geometries
% ====================================================
for mIdx = size(omniPos, 3):-1:1
omniPos(:, :, mIdx) = rotMat3d(rot(1), rot(2), rot(3), rotOrd, "Degs") * omniPos(:, :, mIdx) + trans(:);
omniPos(:, :, mIdx) = rotMat3d(rot(1), rot(2), rot(3), rotOrd, true) * omniPos(:, :, mIdx) + trans(:);
end
if exist("fig8Pos", "var")
for mIdx = size(fig8Pos, 3):-1:1
fig8Pos(:, :, mIdx) = rotMat3d(rot(1), rot(2), rot(3), rotOrd, "Degs") * fig8Pos(:, :, mIdx) + trans(:);
fig8Pos(:, :, mIdx) = rotMat3d(rot(1), rot(2), rot(3), rotOrd, true) * fig8Pos(:, :, mIdx) + trans(:);
end
for mIdx = size(triPos, 3):-1:1
triPos(:, :, mIdx) = rotMat3d(rot(1), rot(2), rot(3), rotOrd, "Degs") * triPos(:, :, mIdx) + trans(:);
triPos(:, :, mIdx) = rotMat3d(rot(1), rot(2), rot(3), rotOrd, true) * triPos(:, :, mIdx) + trans(:);
end
for mIdx = size(boxPos, 4):-1:1
for mmIdx = size(boxPos, 3):-1:1
boxPos(:, :, mmIdx, mIdx) = rotMat3d(rot(1), rot(2), rot(3), rotOrd, "Degs") * boxPos(:, :, mmIdx, mIdx) + trans(:);
boxPos(:, :, mmIdx, mIdx) = rotMat3d(rot(1), rot(2), rot(3), rotOrd, true) * boxPos(:, :, mmIdx, mIdx) + trans(:);
end
end
for mIdx = size(box2DPos, 4):-1:1
for mmIdx = size(box2DPos, 3):-1:1
box2DPos(:, :, mmIdx, mIdx) = rotMat3d(rot(1), rot(2), rot(3), rotOrd, "Degs") * box2DPos(:, :, mmIdx, mIdx) + trans(:);
box2DPos(:, :, mmIdx, mIdx) = rotMat3d(rot(1), rot(2), rot(3), rotOrd, true) * box2DPos(:, :, mmIdx, mIdx) + trans(:);
end
end
for mIdx = size(tetPos, 3):-1:1
tetPos(:, :, mIdx) = rotMat3d(rot(1), rot(2), rot(3), rotOrd, "Degs") * tetPos(:, :, mIdx) + trans(:);
tetPos(:, :, mIdx) = rotMat3d(rot(1), rot(2), rot(3), rotOrd, true) * tetPos(:, :, mIdx) + trans(:);
end
% ====================================================
......
......@@ -3,7 +3,7 @@
% Author: Achilles Kappis
% e-mail: axilleaz@protonmail.com
%
% Date: 29/09/2024 (DD/MM/YYYY)
% Date: 14/11/2024 (DD/MM/YYYY)
%
% Copyright: MIT
% --------------------------------------------------
......@@ -195,11 +195,11 @@ function [sPos, Q, domIdx] = srcGeo(gType, srcLen, originDist, ang, nSrc, azim,
if nSrc ~= 0
switch lower(gType)
case {"anti-causal", "anticausal"}
sPos = rotMat3d(0, 0, 180, [], "Degs") * sPos; % Rotate 180 degrees (anti-clockwise)
sPos = rotMat3d(0, 0, 180, [], true) * sPos; % Rotate 180 degrees (anti-clockwise)
case "side"
sPos = rotMat3d(0, 0, 90, [], "Degs") * sPos; % Rotate 90 degrees (anti-clockwise)
sPos = rotMat3d(0, 0, 90, [], true) * sPos; % Rotate 90 degrees (anti-clockwise)
case "diagonal"
sPos = rotMat3d(0, 0, -90 + ang, [], "Degs") * sPos; % Rotate specified degrees (anti-clockwise)
sPos = rotMat3d(0, 0, -90 + ang, [], true) * sPos; % Rotate specified degrees (anti-clockwise)
end
end
domIdx = [];
......
......@@ -3,7 +3,7 @@
% Author: Achilles Kappis
% e-mail: axilleaz@protonmail.com
%
% Date: 10/10/2024 (DD/MM/YYYY)
% Date: 14/11/2024 (DD/MM/YYYY)
%
% Copyright: MIT
% --------------------------------------------------
......@@ -194,7 +194,7 @@ function [vPos, vPosMesh] = virtMicGeo(gType, geoDim, nSens, trans, rot, rotOrd)
end
% Rotate and translate
vPos = rotMat3d(rot(1), rot(2), rot(3), rotOrd, "Degs") * vPos + trans(:);
vPos = rotMat3d(rot(1), rot(2), rot(3), rotOrd, true) * vPos + trans(:);
% For "Cube" geometry provide the coordinates in a "mesh format"
if nargout > 1 && strcmpi(gType, "Cube")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment