### 15.6.9 Quadric reduction

The reduced_quadric command finds the reduced equation of a quadric.

- reduced_quadric takes two arguments:
  - eq, the equation of a quadric.
  - vars, a vector of variable names.
- reduced_quadric(eq,vars) returns a list whose elements are:
  - the origin,
  - the matrix of a basis where the quadric is reduced,
  - 0 or 1 (0 if the quadric is degenerate),
  - the reduced equation of the quadric
  - a vector with its parametric equations.
- Note that u,v will be used as parameters of the parametric equations; these variables should not be assigned (purge them before calling reduced_quadric).

#### Example

reduced_quadric(7*x^2+4*y^2+4*z^2+ 4*x*y-4*x*z-2*y*z-4*x+5*y+4*z-18)

| ⎡ ⎢ ⎢ ⎢ ⎣

⎡
⎢
⎢
⎣

11
27

,−

26
27

,−

29
54

⎤
⎥
⎥
⎦

,

⎡
⎢
⎢
⎢
⎢
⎢
⎢
⎢
⎢
⎢
⎢
⎢
⎣

√

6

3

√

5

5

−

√

30

15

√

6

6

0

√

30

6

−

√

6

6

2
5

√

5

√

30

30

⎤
⎥
⎥
⎥
⎥
⎥
⎥
⎥
⎥
⎥
⎥
⎥
⎦

,

⎡
⎣

9,3,3

⎤
⎦

,1,9x2+3y2+3z2−

602
27

,

⎡
⎢
⎢
⎢
⎣

⎡
⎢
⎢
⎣

9

√

6

√

1806

sinucosv

3· 243

+

9

√

5

√

602

sinusinv

5· 81

−

9

√

30

√

602

cosu

15· 81

+

11
27

,

9

√

6

√

1806

sinucosv

6· 243

+

9

√

30

√

602

cosu

6· 81

−

26
27

,

−

9

√

6

√

1806

sinucosv

6· 243

+

9· 2

√

5

√

602

sinusinv

5· 81

+

9

√

30

√

602

cosu

30· 81

−

29
54

⎤
⎥
⎥
⎦

,

u=0… π ,v=0… 2 π ,ustep=

π
20

,vstep=

2
20

π

⎤
⎥
⎥
⎥
⎦

⎤
⎥
⎥
⎥
⎦

The output is a list containing:

- The origin (center of symmetry) of the quadric

  ⎡
  ⎢
  ⎢
  ⎣

  11
  27

  ,−

  26
  27

  ,−

  29
  54

  ⎤
  ⎥
  ⎥
  ⎦

  .

- The matrix of the basis change:

  ⎡
  ⎢
  ⎢
  ⎢
  ⎢
  ⎢
  ⎢
  ⎢
  ⎢
  ⎢
  ⎢
  ⎢
  ⎣

  √

  6

  3

  √

  5

  5

  −

  √

  30

  15

  √

  6

  6

  0

  √

  30

  6

  −

  √

  6

  6

  2
  5

  √

  5

  √

  30

  30

  ⎤
  ⎥
  ⎥
  ⎥
  ⎥
  ⎥
  ⎥
  ⎥
  ⎥
  ⎥
  ⎥
  ⎥
  ⎦

  .

- 1, hence the quadric is not degenerated.
- the reduced equation of the quadric:

  9x2+3y2+3z2−

  602
  27

  .

- The parametric equations (in the original frame):

  | ⎡ ⎢ ⎢ ⎢ ⎣

  ⎡
  ⎢
  ⎢
  ⎣

  9

  √

  6

  √

  1806

  sinucosv

  3· 243

  +

  9

  √

  5

  √

  602

  sinusinv

  5· 81

  −

  9

  √

  30

  √

  602

  cosu

  15· 81

  +

  11
  27

  ,

  9

  √

  6

  √

  1806

  sinucosv

  6· 243

  +

  9

  √

  30

  √

  602

  cosu

  6· 81

  −

  26
  27

  ,

  −

  9

  √

  6

  √

  1806

  sinucosv

  6· 243

  +

  9· 2

  √

  5

  √

  602

  sinusinv

  5· 81

  +

  9

  √

  30

  √

  602

  cosu

  30· 81

  −

  29
  54

  ⎤
  ⎥
  ⎥
  ⎦

  ,

  u=0… π ,v=0… 2 π ,ustep=

  π
  20

  ,vstep=

  2
  20

  π

  ⎤
  ⎥
  ⎥
  ⎥
  ⎦

  .

Hence the quadric is an ellipsoid 9x2+3y2+3z2+(−602)/27=0. After the change of origin to [11/27,(−26)/27,(−29)/54], the matrix of basis change is:

⎡
⎢
⎢
⎢
⎢
⎢
⎢
⎢
⎢
⎢
⎢
⎢
⎢
⎣

√

6

3

√

5

5

−

√

30

15

√

6

6

0

√

30

6

−

√

6

6

2

√

5

5

√

30

30

⎤
⎥
⎥
⎥
⎥
⎥
⎥
⎥
⎥
⎥
⎥
⎥
⎥
⎦

.

Its parametric equation is:

⎧
⎪
⎪
⎪
⎪
⎪
⎪
⎪
⎪
⎨
⎪
⎪
⎪
⎪
⎪
⎪
⎪
⎪
⎩

x=

√

6

√

602
243

sin(u)cos(v)

3

+

√

5

√

602
81

sin(u)sin(v)

5

−

√

30

√

602
81

cos(u)

15

+

11
27

,

y=

√

6

√

602
243

sin(u)cos(v)

6

+

√

30

√

602
81

cos(u))

6

−

26
27

,

z=

−

√

6

√

602
243

sin(u)cos(v)

6

+

2

√

5

√

602
81

sin(u)sin(v)

5

+

√

30

√

602
81

cos(u)

30

−

29
54

.

##### Remark.

Note that if the quadric is degenerate and made of one or two plane(s), each plane is not given by its parametric equation but by the list of a point in the plane and a normal vector.

#### Example

reduced_quadric(x^2-y^2+3*x+y+2)

| ⎡ ⎢ ⎢ ⎢ ⎣

⎡
⎢
⎢
⎣

−

3
2

,

1
2

,0

⎤
⎥
⎥
⎦

,

⎡
⎢
⎢
⎣

1 | 0 | 0
0 | 1 | 0
0 | 0 | −1

⎤
⎥
⎥
⎦

,

⎡ ⎣ | 0,1,−1 | ⎤ ⎦ | ,x2−y2,

⎡
⎢
⎢
⎣

hyperplan

⎛
⎜
⎜
⎝

⎡
⎣

1,1,0

⎤
⎦

,

⎡
⎢
⎢
⎣

−

3
2

,

1
2

,0

⎤
⎥
⎥
⎦

⎞
⎟
⎟
⎠

,hyperplan

⎛
⎜
⎜
⎝

⎡
⎣

1,−1,0

⎤
⎦

,

⎡
⎢
⎢
⎣

−

3
2

,

1
2

,0

⎤
⎥
⎥
⎦

⎞
⎟
⎟
⎠

⎤
⎥
⎥
⎦

⎤
⎥
⎥
⎥
⎦