We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7b11566 commit 1a53ba3Copy full SHA for 1a53ba3
Model_Generation/TMS_package/E-Field_Coupling/couple_script.m
@@ -45,6 +45,12 @@ function couple_script(paramfile)
45
theta = acos(v1*v2'); % Angle between v1 and v2
46
axis_rot = cross(v1,v2)/norm(cross(v1,v2)); % axis around which v1 should turn to align with v2
47
48
+% in case v1 and v2 are parallel use an orthagonal vector
49
+if any(isnan(axis_rot))
50
+ axis_rot = null(v1);
51
+ axis_rot = axis_rot(:,1)';
52
+end
53
+
54
% A skew symmetric representation of the normalized axis
55
axis_skewed = [0 -axis_rot(3) axis_rot(2); axis_rot(3) 0 -axis_rot(1); -axis_rot(2) axis_rot(1) 0];
56
0 commit comments