Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
graintracking
DCT
Commits
a1fd3e8d
Commit
a1fd3e8d
authored
Jul 12, 2021
by
Zheheng Liu
Browse files
Latest fix to quaternion function
Signed-off-by:
Zheheng Liu
<
zheheng.liu@esrf.fr
>
parent
aa56a264
Changes
1
Hide whitespace changes
Inline
Side-by-side
zUtil_Maths/gtMathsRod2Quat.m
View file @
a1fd3e8d
...
...
@@ -20,5 +20,5 @@ end
% |r| = tan(theta/2), so sqrt(1+|r|^2) = 1/cos(theta/2)
cosine_half_theta_reciprocal
=
sqrt
(
1
+
sum
(
abs
(
r
)
.^
2
,
1
));
% q = [cos(theta/2); cos(theta/2)*r] = [1; r] * cos(theta/2)
q
=
bsxfun
(
@
(
x
,
y
)
x
.
/
y
,
[
ones
(
size
(
cosine_half_theta_reciprocal
));
r
],
cosine_half_theta_reciprocal
);
q
=
bsxfun
(
@
rdivide
,
[
ones
(
size
(
cosine_half_theta_reciprocal
));
r
],
cosine_half_theta_reciprocal
);
end
% end of function
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment