Welcome to ZOJ
106 - ZOJ Monthly, May 2011 - D
Quadratic Surface

Time Limit: 2 Seconds      Memory Limit: 65536 KB

Quadratic surface is a second-order algebraic surface given by the general equation

Quadratic surfaces are also called quadrics, and there are 17 standard-form types. A quadratic surface intersects every plane in a (proper or degenerate) conic section. In addition, the cone consisting of all tangents from a fixed point to a quadratic surface cuts every plane in a conic section, and the points of contact of this cone with the surface form a conic section.

Examples of quadratic surfaces include the cone, cylinder, ellipsoid, elliptic cone, elliptic cylinder, elliptic hyperboloid, elliptic paraboloid, hyperbolic cylinder, hyperbolic paraboloid, paraboloid, sphere, and spheroid.

e=[a h g; h b f; g f c]
E=[a h g p; h b f q; g f c r; p q r d]
ρ3=rank e
ρ4=rank E
Δ4=det E,
and k1, k2, as k3 are the roots of
|a-x h g; h b-x f; g f c-x|=0.
Also define
k={1 if the signs of nonzero ks are the same; 0 otherwise.
Then the following table enumerates the 15 quadrics and their properties.

coincident planesx2=011
ellipsoid (imaginary)x2/a2+y2/b2+z2/c2=-134+1
ellipsoid (real)x2/a2+y2/b2+z2/c2=134-1
elliptic cone (imaginary)x2/a2+y2/b2+z2/c2=0331
elliptic cone (real)x2/a2+y2/b2-z2/c2=0330
elliptic cylinder (imaginary or real)x2/a2+y2/b2=∓1231
elliptic paraboloidz=x2/a2+y2/b224-1
hyperbolic cylinderx2/a2-y2/b2=-1230
hyperbolic paraboloidz=y2/b2-x2/a224+0
hyperboloid of one sheetx2/a2+y2/b2-z2/c2=134+0
hyperboloid of two sheetsx2/a2+y2/b2-z2/c2=-134-0
intersecting planes (imaginary)x2/a2+y2/b2=0221
intersecting planes (real)x2/a2-y2/b2=0220
parabolic cylinderx2+2rz=013
parallel planes (imaginary or real)x2=∓a212


There are multiple test cases. The first line of input is an integer T ≈ 10000 indicating the number of test cases.

Each test case consists of a line containing 10 real numbers a, b, c, f, g, h, p, q, r, d. The absolute value of all numbers never exceed 1000. It's guaranteed that a2+b2+c2>0.


For each test case, output the type of quadratic surface ax2+by2+cz2+2fyz+2gzx+2hxy+2px+2qy+2rz+d=0. See sample for more details.

Sample Input

1 1 1 0 0 0 0 0 0 1
1 1 -1 0 0 0 0 0 0 1
1 1 -1 0 0 0 0 0 0 -1

Sample Output

ellipsoid (imaginary)
hyperboloid of two sheets
hyperboloid of one sheet


Author: WU, Zejun
Submit    Status