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일

1 개 추천

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

Ramesh Bala
Ramesh Bala 2018년 7월 27일
Danke ! how to get that r1. I think r1 = 2a ? major axis length so how to get a from foci (xy ) coords??
Matt J
Matt J 2018년 7월 27일
편집: Matt J 2018년 7월 27일
The major axis length needs to be given. You cannot derive it from the foci. Two different ellipses with different major axis lengths can have the same foci.
Ramesh Bala
Ramesh Bala 2018년 7월 30일
Alright ! Lemme have a check
Thanks for the answer.
Ramesh Bala
Ramesh Bala 2018년 9월 6일
I couldn't get the proper work out for this. Could you share any code regarding this case
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개)

카테고리

도움말 센터File Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기

제품

릴리스

R2018a

질문:

2018년 7월 26일

댓글:

2018년 9월 7일

Community Treasure Hunt

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

Start Hunting!

Translated by