Is this code correct for the ellipse equation given below..?? Will I get rotated ellipse from this code..??
Show older comments
My equation is

I have used Parametric equations of an ellipse here. I need rotated ellipse from this code. But I am getting bent ellipse. Kindly check and let me know the solution asap. *.Mat file is also attached.
th = 0:pi/50:2*pi;
m1=9;
m2=9;
sd1=3;
sd2=2;
r=0.7;
x1 = m1+ (sqrt(1-r^2)*sd1).* cos(th);
x2 = m2+ (sqrt(1-r^2)*sd2).* sin(th);
knum = (2*r*((sqrt(1-r^2)*sd1).* cos(th))* (sqrt(1-r^2)*sd2).* sin(th));
kdenom = (sd1*sd2*(1-r^2));
k=-(knum/kdenom);
h = plot3(x1,x2,k, 'black','linewidth',0.3);
Bent ellipse is like this...

Kindly correct my code to get rotated ellipse properly.
Accepted Answer
More Answers (0)
Categories
Find more on Polar Plots 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!