Ellipse in parametric form ?

5 次查看(过去 30 天)
I'm trying to create an ellipse in parametric form. I have just two Foci along the major axis. So, how shall I get r1, r2 etc.
point1 = 10 8
point2 = 25 20
The syntax is
t = linspace(0, 2*pi, 200);
xt = r1 * cos(t) + xc;
yt = r2 * sin(t) + yc;
cot = cos(theta); sit = sin(theta);
x = xt * cot - yt * sit;
y = xt * sit - yt * cot;
plot(x, y, '-');
  1 个评论
Ramesh Bala
Ramesh Bala 2018-7-26
编辑:Matt J 2018-7-26
% or in other general forms :
% data
t = linspace(0,2*pi,80); % the domain of the parameter t.
x = @(t)r1.*cos(t);
y = @(t)r2.*sin(t);
figure(1)
ELLIPSE = plot(x(t),y(t));
hold off

请先登录,再进行评论。

采纳的回答

Matt J
Matt J 2018-7-26
编辑:Matt J 2018-7-26
You cannot determine the ellipse with only the foci. You also need to know r1. Once you know that however, you can determine r2 readily,
xc_yc=(point1+point2)/2;
c=norm(point1-xc_yc);
r2 = r1^2-c^2;
  6 个评论
Matt J
Matt J 2018-9-6
I already told you that it was impossible. The foci alone aren't enough.
Ramesh Bala
Ramesh Bala 2018-9-7
yeah I know that ,I thought to take the surrounding rectangle boundary as tangent and then to draw an ellipse ?

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Install Products 的更多信息

产品


版本

R2018a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by