Skip to content
GitLab
Menu
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
78506396
Commit
78506396
authored
Jul 04, 2020
by
Jean-Yves TINEVEZ
Browse files
Plot an ellipse give in cartesian form on the XY plane.
parent
c9908f3e
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/plot_ellipse_2d.m
0 → 100644
View file @
78506396
function
h
=
plot_ellipse_2d
(
f
,
npoints
)
%PLOT_ELLIPSE_2D Plot an ellipse in XY plane.
if
nargin
<
2
npoints
=
20
;
end
x0
=
f
(
1
);
y0
=
f
(
2
);
a
=
f
(
3
);
b
=
f
(
4
);
theta
=
f
(
5
);
R
=
[
cos
(
theta
)
sin
(
theta
)
;
-
sin
(
theta
)
cos
(
theta
)
]
;
t
=
linspace
(
0
,
2
*
pi
,
npoints
)
'
;
XY0
=
[
a
*
sin
(
t
),
b
*
cos
(
t
)
];
XY1
=
XY0
*
R
;
xr
=
XY1
(
:,
1
)
+
x0
;
yr
=
XY1
(
:,
2
)
+
y0
;
xr
=
[
xr
;
xr
(
1
,:)
];
yr
=
[
yr
;
yr
(
1
,:)
];
h
=
line
(
xr
,
yr
);
end
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