Path: news.mathworks.com!newsfeed-00.mathworks.com!kanaga.switch.ch!switch.ch!news-fra1.dfn.de!news-ham1.dfn.de!news.zfn.uni-bremen.de!informatik.uni-bremen.de!not-for-mail
From: Bastian Stahmer <bastian@beckspc.de>
Newsgroups: comp.soft-sys.matlab
Subject: 3D-plotting of quadric surfaces?
Date: Mon, 28 Jan 2008 13:00:52 +0100
Organization: Universitaet Bremen, Germany
Lines: 35
Message-ID: <2008012813005216807-bastian@beckspcde>
NNTP-Posting-Host: wlan-client-148.informatik.uni-bremen.de
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 8bit
User-Agent: Unison/1.8
Xref: news.mathworks.com comp.soft-sys.matlab:447902


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

Depending on the values of the 10 coefficients this equation describes 
an ellipoid, a hyperboloid, a paraboloid and so on. I tried to solve 
the equation to z and create a surface, which works for non-complex 
solutions but if you choose for example every coefficient to 0 and A, 
B, C and J to 1, you get a Sphere with radius 1:

0 = x^2+y^2+z^2-1
and solved to z
  (-x^2-y^2+1)^(1/2)
 -(-x^2-y^2+1)^(1/2)

It's obvious that there are only real results for -x^2-y^2+1 > 0   -->  
 x < 1 and y < 1. In addition to that, to fully display the sphere i'd 
need to combine the two halves of the sphere given in the two solutions 
of z. While this may be possible for such an easy surface as a sphere, 
it seems impossible to me to do this for the generic equation.

So my question is how to display such quadric surfaces in general form.

Thank you,

Bastian.

[1] http://www.cs.mtu.edu/~shene/COURSES/cs3621/NOTES/geometry/simple.html