ellipse arc

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

ellipse arc

titusdt
Hello,

I am trying to picture a sphere in perspective using the ellipseArc function

Here is my MWE : it seems like ellipseArc can't properly complete the
ellipse arc for angles 180 to 360°. Unless I'm doing something wrong ?

%%%%%%%%%%%%%%%%%%%
% 3D earth with girth
figure(1);clf
drawCircle(0,0,2,'Color','k');
axis square
hold on;
%drawEllipseArc([0,0,2,.1,0,0,180],'Color','k','LineStyle','--');
drawEllipseArc([0,0,2,.1,182,350],'Color','k');

hold off
axis off
%%%%%%%%%%%%%%%%%%%%

<https://octave.1599824.n4.nabble.com/file/t373487/untitled.jpg>

Best regards
Augustin



--
Sent from: https://octave.1599824.n4.nabble.com/Octave-General-f1599825.html


Reply | Threaded
Open this post in threaded view
|

Re: ellipse arc

titusdt
Hello, sorry I misread the doc.

The second argument is the extent, so the solution is to write

drawEllipseArc([0,0,2,.1,180,180],'Color','k');

so that the angle runs from 180 to 180+180 = 360 degrees

Best regards



--
Sent from: https://octave.1599824.n4.nabble.com/Octave-General-f1599825.html


Reply | Threaded
Open this post in threaded view
|

Re: ellipse arc

Doug Stewart-4
In reply to this post by titusdt


On Sun, Sep 15, 2019 at 10:43 AM titusdt <[hidden email]> wrote:
Hello,

I am trying to picture a sphere in perspective using the ellipseArc function

Here is my MWE : it seems like ellipseArc can't properly complete the
ellipse arc for angles 180 to 360°. Unless I'm doing something wrong ?

%%%%%%%%%%%%%%%%%%%
% 3D earth with girth
figure(1);clf
drawCircle(0,0,2,'Color','k');
axis square
hold on;
%drawEllipseArc([0,0,2,.1,0,0,180],'Color','k','LineStyle','--');
drawEllipseArc([0,0,2,.1,182,350],'Color','k');

hold off
axis off
%%%%%%%%%%%%%%%%%%%%

<https://octave.1599824.n4.nabble.com/file/t373487/untitled.jpg>

Best regards
Augustin



--
Sent from: https://octave.1599824.n4.nabble.com/Octave-General-f1599825.html




You might want to edit drawEllipseArc.m
and change the 60 on line 126 to a bigger number so that you get a smother curve.
I tried 600 and it made a nice picture from  your code.




--
DASCertificate for 206392