Re: How to draw an ellipse?
- To: mathgroup@smc.vnet.net
- Subject: [mg10393] Re: How to draw an ellipse?
- From: Allan Hayes <hay@haystack.demon.co.uk>
- Date: Mon, 12 Jan 1998 04:10:32 -0500
- References: <694b5p$kjs@smc.vnet.net>
Krishnan Jayakrishnan wrote:
> Does any one know how to construct an ellipse? For example an ellipse
> centered at (0,0) with intercepts at (-a,0,(a,0),(0,-b),(0,b) with
> parametric equation
> x(t) = a*cos(t)
> y(t) = b*sin(t)
> with t increasin from 0 to 2pi radians. --
In[2]:=
x[t_] = a*Cos[t];
y[t_] = b*Sin[t];
In[3]:=
a= 2; b = 1;
In[4]:=
ParametricPlot[{x[t],y[t]},{t,0,2Pi}, AspectRatio-> Automatic];
AspectRatio-> Automatic is needed to get the same scales in x and y
directions.
Instead of functions you can use formulas:
In[5]:=
Clear[x,y]
In[6]:=
{x,y} = {a Cos[t],b Sin[t]};
In[7]:=
ParametricPlot[{x,y},{t,0,2Pi},
AspectRatio-> Automatic];
--
Allan Hayes
Training and Consulting
Leicester, UK
hay@haystack.demon.co.uk
http://www.haystack.demon.co.uk
voice: +44 (0)116 271 4198
fax: +44 (0)116 271 8642