       RE: Drawing an ellipse

• To: mathgroup at smc.vnet.net
• Subject: [mg36724] RE: [mg36654] Drawing an ellipse
• From: "Wolf, Hartmut" <Hartmut.Wolf at t-systems.com>
• Date: Fri, 20 Sep 2002 04:16:47 -0400 (EDT)
• Sender: owner-wri-mathgroup at wolfram.com

```>-----Original Message-----
>From: pimak [mailto:piotrowski.maciek at interia.pl]
To: mathgroup at smc.vnet.net
>Sent: Wednesday, September 18, 2002 8:09 AM
>Subject: [mg36724] [mg36654] Drawing an ellipse
>
>
>Hello,
>I am new with Mathematica, I have one question,
>I know that the sollution might be very easy, but I wasn't able to
>find it by now.
>I would like to draw an ellipse, the formula let's say is as follows:
>
>
>
>0.09 x^2 +0.04 x y + 0.06 y^2 = 4
>
>Thanks
>
>Maciej
>
>
>

Two methods: (1) solve for explit functions y = f[x] and plot those:

In:= eqn = 0.09 x^2 + 0.04 x y + 0.06 y^2 == 4

... just for convenience;

In:= sols = Solve[eqn, y]
In:= y /. sols

...these are the two functions for y expressed by x. To find the minimum and
maximum values for x, we spot the discriminant, and solve for x:

In:=
{xmin, xmax} =
x /. Solve[
Cases[y /. sols[],
Sqrt[disc_] :> disc, Infinity] == 0, x]

...now we may use Plot:

In:=
Plot[Evaluate[y /. sols], {x, xmin, xmax}, AspectRatio -> Automatic]

(2) guess approximate values for xmin, xmax and let Mathematica do all that
work:

In:= << Graphics`ImplicitPlot`

In:= ImplicitPlot[eqn, {x, -7, 7}]

...done.

--
hw

```

• Prev by Date: Re: Inv.Interpol.Function
• Next by Date: Re: build-in commutativity
• Previous by thread: Drawing an ellipse
• Next by thread: Resetting after SetOptions