Circle looks like ellipse

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

Circle looks like ellipse

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
*******************************************


Reply | Threaded
Open this post in threaded view
|

Re: Circle looks like ellipse

Andreas Weber-6
Am 25.07.19 um 14:19 schrieb Aziz YÜCELEN:
> 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 ? 

axis equal


Reply | Threaded
Open this post in threaded view
|

Re: Circle looks like ellipse

karl
In reply to this post by Aziz YÜCELEN
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:

<<a class="moz-txt-link-freetext" href="https://octave.org/doc/v4.2.1/Axis-Configuration.html#Axis-Configuration|">https://octave.org/doc/v4.2.1/Axis-Configuration.html#Axis-Configuration|

and another hint: look at example 1.

Ciao

Karl



Reply | Threaded
Open this post in threaded view
|

Ynt: Circle looks like ellipse

Aziz YÜCELEN
In reply to this post by Andreas Weber-6

Thank you. It solved my problem.

Gönderen: Andreas Weber <[hidden email]>
Gönderildi: 25 Temmuz 2019 Perşembe 15:20
Kime: Aziz YÜCELEN <[hidden email]>; [hidden email] <[hidden email]>
Konu: Re: Circle looks like ellipse
 
Am 25.07.19 um 14:19 schrieb Aziz YÜCELEN:
> 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 ? 

axis equal


Reply | Threaded
Open this post in threaded view
|

Re: Circle looks like ellipse

karl
In reply to this post by Andreas Weber-6
Am 25.07.19 um 14:20 schrieb Andreas Weber:
> Am 25.07.19 um 14:19 schrieb Aziz YÜCELEN:
>> 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 ?
> axis equal
>
>
Maybe you don't know this:

<https://www.brainyquote.com/quotes/maimonides_326751>



Reply | Threaded
Open this post in threaded view
|

Re: Circle looks like ellipse

karl
Am 25.07.19 um 16:18 schrieb Andreas Weber:
> Am 25.07.19 um 15:19 schrieb [hidden email]:
>> Maybe you don't know this:
>> <https://www.brainyquote.com/quotes/maimonides_326751>
> do you really think that is the case?

It would definitely help the OP more to show him where to find the relevant

information about plotting in the manual instead of throwing in two words

which help him in the moment. Don't you think so?



Reply | Threaded
Open this post in threaded view
|

Re: Circle looks like ellipse

karl
Am 25.07.19 um 17:34 schrieb Andreas Weber:

> Am 25.07.19 um 17:08 schrieb [hidden email]:
>> Am 25.07.19 um 16:18 schrieb Andreas Weber:
>>> Am 25.07.19 um 15:19 schrieb [hidden email]:
>>>> Maybe you don't know this:
>>>> <https://www.brainyquote.com/quotes/maimonides_326751>
>>> do you really think that is the case?
>> It would definitely help the OP more to show him where to find the relevant
>> information about plotting in the manual instead of throwing in two words
>> which help him in the moment. Don't you think so?
> You can do this if you want but don't try to indoctrinate others (in
> this case me) how to give help.

  I see. If I say my opinion, it is considered by you indoctrination.

So you think that any contradiction to your way of offering help is indoctrination?