Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
IAH public
DeProj
Commits
9e532f94
Commit
9e532f94
authored
Jul 06, 2020
by
Jean-Yves TINEVEZ
Browse files
Compute projected angle of main orientation.
parent
97b42aa9
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/@epicell/epicell.m
View file @
9e532f94
...
...
@@ -11,6 +11,7 @@ classdef epicell
euler_angles
ellipse_fit
eccentricity
proj_direction
uncorrected_area
uncorrected_perimeter
id
...
...
@@ -50,6 +51,9 @@ classdef epicell
a
=
obj
.
ellipse_fit
(
4
);
b
=
obj
.
ellipse_fit
(
5
);
obj
.
eccentricity
=
sqrt
(
1
-
(
b
/
a
)
*
(
b
/
a
)
);
obj
.
proj_direction
=
epicell
.
compute_proj_direction
(
...
obj
.
ellipse_fit
,
...
epicell
.
euleurZXZ2rot
(
obj
.
euler_angles
)
);
end
...
...
@@ -152,7 +156,36 @@ classdef epicell
E
=
epicell
.
rot2eulerZXZ
(
v
);
end
function
sigma
=
compute_proj_direction
(
f3d
,
v
)
% Computes the angle of the semi-major axis of the ellipse,
% projected on the XY plane. There is probably an analytical way to
% do it, but I could not find it.
% Ellipse semi-major axis arrow.
a
=
f3d
(
4
);
theta
=
f3d
(
6
);
% In ellipse referential.
arrow_x
=
[
-
a
;
a
];
arrow_y
=
[
0
;
0
];
Ar0
=
[
arrow_x
,
arrow_y
];
% In epicell plane referential.
R
=
[
cos
(
theta
)
sin
(
theta
)
;
-
sin
(
theta
)
cos
(
theta
)
]
;
Ar1
=
Ar0
*
R
;
arrow_z
=
[
0
;
0
];
Ar1b
=
[
Ar1
arrow_z
];
% In main referential.
Ar2
=
Ar1b
*
v
'
;
% Compute angle.
dx
=
Ar2
(
2
,
1
)
-
Ar2
(
1
,
1
);
dy
=
Ar2
(
2
,
2
)
-
Ar2
(
1
,
2
);
sigma
=
atan
(
dy
/
dx
);
end
end
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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