Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!watmath!clyde!rutgers!ucla-cs!sdcrdcf!hplabs!decwrl!jumbo!stolfi From: stolfi@jumbo.UUCP Newsgroups: comp.graphics Subject: Re: Can You Transform Quadric Surfaces With 4x4 Matrices? Message-ID: <686@jumbo.dec.com> Date: Thu, 29-Jan-87 15:30:37 EST Article-I.D.: jumbo.686 Posted: Thu Jan 29 15:30:37 1987 Date-Received: Sat, 31-Jan-87 04:42:26 EST References: <255@onion.cs.reading.ac.uk> Reply-To: stolfi@jumbo.UUCP (Jorge Stolfi) Followup-To: comp.graphics Organization: DEC Systems Research Center Lines: 69 Keywords: quadratic surface transformation matrix homogeneous projective map Summary: Sure: Q --> M~ Q M~' X-Edited: last by stolfi on Thu Jan 29 12:30:12 1987 PST oxoxoxoxoxoxoxoxoxoxoxoxoxoxoxoxoxoxoxoxoxoxoxoxoxoxoxoxoxoxoxoxoxoxoxo Stephen Marsh asked: > If I have a surface defined by > > Q(x,y,z) = ax^2 + by^2 + cz^2 + dxy + eyz + fxz + gx + hy + iz + k > > (ie sphere, cone etc) does anyone know if there is a > straightforward way of transforming this surface using the > usual 4x4 scale, rotate and translate matrices? Let the coordinates of a point p be written as a 4-element row vector [x y z 1] (or [X Y Z W] in homogeneous coordinates, where x=X/W, y=Y/W, z=Z/W). A projective transformation (one that preserves straight lines) of R^3 is determined by a 4x4 matrix M, such that the image of a point p is simply the product p M of the 4-vector p by the matrix M. Linear, Euclidean, and affine transformations or R^3 (rotations, translations, scalings, reflections, etc.) are all special cases of projective maps. For example, a translation by (dx, dy, dz) is given by the matrix 1 0 0 0 0 1 0 0 0 0 1 0 dx dy dz 1 A quadratic surface can be represented by a symmetric 4x4 matrix Q, such that a point p lies on the surface if and only if the matrix product p Q p' = 0, where p' is the transpose of p, i.e. the 4-element COLUMN vector . Specifically, the quadratic surface with equation ax^2 + by^2 + cz^2 + dxy + eyz + fxz + gx + hy + iz + k = 0 is given by the matrix a d/2 f/2 g/2 d/2 b e/2 h/2 f/2 e/2 c i/2 g/2 h/2 i/2 k So, how do we map a quadratic surface Q by a map M? We want a surface K such that p is on Q if and only if (p M) is on K; that is, we want a matrix K such that p Q p' = 0 iff (p M) K (p M)' = 0 Since (p M)' = M' p', we conclude that K = M~ Q M~' will do the trick, where M~ is the inverse of M, and M~' its transpose. j. oxoxoxoxoxoxoxoxoxoxoxoxoxoxoxoxoxoxoxoxoxoxoxoxoxoxoxoxoxoxoxoxoxoxo