how does ellipse use for calculating orientation?

I just want to understand the attach code,the point which i am not understanding what does ellipse(5) represent,parametric equation are used in which ellipse(3) and ellipse(4) are used as semi major and semi minor axis if I am not wrong.Please help me out in understanding what does this ellipse(3),ellipse(4) and ellipsse(5) representing.
Any help will be appreciated Thank you in advance

 Accepted Answer

Hi shoaib,
It makes sense to just make up some data, insert lines in the code and plot it out:
ellipse = [1 2 3 4 pi/6];
theta = radtodeg(ellipse(5));
t = linspace(-4,4);
NoiseLevel = 0;
x = ellipse(3) * cos(t);
y = ellipse(4) * sin(t);
figure(1)
plot(x,y)
axis equal
nx = x*cos(ellipse(5))-y*sin(ellipse(5)) + ellipse(1) + randn(size(t))*NoiseLevel;
ny = x*sin(ellipse(5))+y*cos(ellipse(5)) + ellipse(2) + randn(size(t))*NoiseLevel;
figure(2)
plot(nx,ny)
axis equal
As you said, ellipse(3) and ellipse(4)are semimajor and semiminor axes, and you can see the effect of ellipse(5) in the second plot (and also the effect of ellipse(1) and ellipse(2)).

1 Comment

Thank you David Goodmanson,it helped me alot in understanding for what I am looking for.

Sign in to comment.

More Answers (0)

Categories

Find more on MATLAB in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!