help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Circle looks like ellipse


From: fibonacci4
Subject: Re: Circle looks like ellipse
Date: Thu, 25 Jul 2019 14:24:18 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.7.2

Am 25.07.19 um 14:19 schrieb Aziz YÜCELEN:
Hi 

I want to plot a simple tear drop-like a function.  I have a problem while plot screen. Circle looks like ellipse so that  X and Y axis scale not equal. Full code is below. Please can you help me ? 

***********************************************
%circle center: (center_x,center_y)
%circle radius:radius
y axis component of any top point
% (x1,y1)->(x2,y2)<-(x3,y3)
%
function tear_drop(center_x,center_y,radius,top_y_point)
th = linspace( pi, (2*pi), 100);
R = radius/2;  %or whatever radius you want
x = R*cos(th)+center_x;
y = R*sin(th)+center_y;
x1=center_x-(R);
x2=center_x;
x3=center_x+(R);
y1=y3=0;
y2=top_y_point;
plot([x1 x2], [y1 y2],'r')
hold on
plot([x2 x3], [y2 y3],'r')
hold on
plot(x,y,'k');
hold on
endfunction
*******************************************


    

Hi,


there is a manual online and it is always helpful to have a look there.

Maybe this helps you:

<https://octave.org/doc/v4.2.1/Axis-Configuration.html#Axis-Configuration|

and another hint: look at example 1.

Ciao

Karl


reply via email to

[Prev in Thread] Current Thread [Next in Thread]