Path: news.mathworks.com!not-for-mail
From: "John D'Errico" <woodchips@rochester.rr.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: 3D-plotting of quadric surfaces?
Date: Mon, 28 Jan 2008 13:33:02 +0000 (UTC)
Organization: John D'Errico (1-3LEW5R)
Lines: 46
Message-ID: <fnklie$cbp$1@fred.mathworks.com>
References: <2008012813005216807-bastian@beckspcde>
Reply-To: "John D'Errico" <woodchips@rochester.rr.com>
NNTP-Posting-Host: webapp-03-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1201527182 12665 172.30.248.38 (28 Jan 2008 13:33:02 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Mon, 28 Jan 2008 13:33:02 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 869215
Xref: news.mathworks.com comp.soft-sys.matlab:447919


Bastian Stahmer <bastian@beckspc.de> wrote in message 
<2008012813005216807-bastian@beckspcde>...
> Hello!
> 
> I'm trying to plot a quadric surface, which is given in cartesian 
> coordinates. To be precise, I'm searching for a way to plot a quadric 
> surface given in the general form [1]
> 
> 0 = A*X^2 + B*Y^2 + C*Z^2 + 2*D*X*Y + 2*E*X*Z + 2*F*Y*Z + 2*G*X + 
2*H*Y 
> + 2*I*Z + J

I avoid doing homework problems in general, but
I will offer a suggestion. When you are trying to
eat an elephant, do it one bite at a time.

Break your problem into manageable chunks. I.e.,
can you determine when a surface is parabolic?
Elliptic? Hyperbolic? Write a small piece of code
that returns this information for any set of
coefficients.

Can you plot a unit sphere, centered at the origin?
How about one with different center and radius?
Are these just transformations of the unit sphere?

Next, write another small function that plots only
ellipsoids. Is this a simple transformation of the
sphere problem? Can you do this for the simple
case where the axes of the ellipse are the same
as the cartesian axes?

Next, figure out how to rotate the more general
problem to reduce it to one you already know
how to solve.

Repeat all of the same steps for parabolic and
hyperbolic surfaces.

When you are done with this, you might feel
comfortably stuffed, but the elephant will have
been consumed, and with less effort than you
thought.

HTH,
John