# Computing the intersection of two quadrics through projection and lifting

This paper is devoted to presenting a method to determine the intersection of two quadrics based on the detailed analysis of its projection in the plane (the so called cutcurve) allowing to perform the corresponding lifting correctly. This approach is based on a new computational characterisation of the singular points of the curve and on how this curve is located with respect to the projection of the considered quadrics (whose boundaries are the so called silhouette curves).

## Authors

• 1 publication
• 4 publications
01/21/2000

### Bezier Curves Intersection Using Relief Perspective

Presented paper describes the method for finding the intersection of cla...
08/18/2018

### A 2-Norm Condition Number for Bézier Curve Intersection

We present a short note describing a condition number of the intersectio...
12/16/2019

### Visualizing Planar and Space Implicit Real Algebraic Curves with Singularities

We present a new method for visualizing implicit real algebraic curves i...
10/15/2019

### Curved foldings with common creases and crease patterns

Consider a curve Γ in a domain D in the plane R^2. Thinking of D as a pi...
04/02/2010

### Object-image correspondence for curves under finite and affine cameras

We provide criteria for deciding whether a given planar curve is an imag...
11/04/2017

### Computational Method for Phase Space Transport with Applications to Lobe Dynamics and Rate of Escape

Lobe dynamics and escape from a potential well are general frameworks in...
10/12/2018

### Reconstruction of surfaces with ordinary singularities from their silhouettes

We present algorithms for reconstructing, up to unavoidable projective a...
##### This week in AI

Get the week's most popular data science and artificial intelligence research sent straight to your inbox every Saturday.

## 1 Introduction

Quadrics are the simplest curved surfaces used in many areas and computing their intersection is a relevant problem. Algorithms dealing with this problem based on floating point arithmetic techniques are sensitive to rounding errors achieving a low running time to the detriment of their correctness. On the other hand, using symbolic methods guarantees the correctness of the results because they are based on exact arithmetic (if the considered quadrics are defined in exact terms) but their performance is typically and significantly lower than using methods based on numerically techniques (

Berberich:2005:ECE:1064092.1064110 ).

Levin (Levin:1976:PAD:360349.360355 ,LEVIN197973 ) developed a method to parameterize the intersection curve of two quadrics based on the analysis of the pencil generated by them. However, Levin’s method often fails to find the intersection curve when it is singular and generates a parameterization that involves the square root of some polynomial (dupont:inria-00186089 ). Also, when working with floating point numbers, sometimes Levin’s method outputs results that are topologically wrong and even fail to produce any parameterization (dupont:inria-00186089 ). Farouki et al. (Farouki1989 ) made a complete study of the degenerated cases of quadric intersection by using factorization of multivariate polynomials and Segre characteristic. This method showed the exact parameterization of the intersection curve in many cases.

Later Wang et al. (WANG2003401 ) improved Levin’s method making it capable of computing geometric and structural information - irreducibility, singularity and the number of connected components. Dupont et al. (Dupont:2003:NPI:777792.777830 ) presented an optimal algorithm for computing the explicit representation of the intersection of two arbitrary quadrics whose coefficients are rational numbers in the projective space by using the reduction of quadratic forms and producing new results characterizing the intersection curve of two quadrics. The performance of this algorithm was analyzed in LAZARD200674 .

Others have restricted the kind of quadrics to be considered and defined specific routines to each case (Miller1987 , Goldman:1991:CAR:112515.112545 , MILLER199555 , JOHNSTONE1992179 , Shene:1994:LDI:195826.197316 ) taking advantage of the fact that a geometric approach is typically more stable than the algebraic ones (DUPONT2008168 ). However these approaches are limited to planar intersections and natural quadrics. Mourrain et al. (Mourrain2005 ) proposed an algorithm that reduces the intersection of two quadrics to a dynamic two–dimensional problem.

An alternative way to compute the intersection of two quadric surfaces in the three-dimensional space is based on analysing its projection onto one plane (Geismann:2001:CCA:378583.378689 ). The idea of this method is to reduce the three-dimensional problem to computing the arrangement of three plane algebraic curves defined implicitely. After determining and analysing the projection of the intersection curve onto a plane, the intersection curve can be recovered by determining the lifting of the projection curve. Implementation and theoretical aspects of this approach are also described in Berberich:2005:ECE:1064092.1064110 and Wolpert , respectively.

In this paper, a new method is presented to determine the intersection curve of two quadrics through projection onto a plane and lifting. In some cases, it will be possible to determine the exact parameterization of the intersection curve (involving radicals if needed) and, in others, the output (topologically correct) will be the lifting of the discretization of the branches of the projection curve once its singular points have been analysed. The way the lifting will be achieved is the main criteria followed to analyse the cutcurve.

This paper is organized as follows. In Section 2, we briefly review some preliminaries on conics and quadrics. In Section 3 some mathematical tools as resultants and subresultants are briefly presented for sake of completeness. Resultants are used in Section 4 to characterise the projection of the intersection curve (called, in what follows, the cutcurve) by using a bivariate polynomial of degree four, at most. Our approach is based on the analysis of the arrangement of the cutcurve and the silhouette of both quadrics, as in Figure 1, following Berberich:2005:ECE:1064092.1064110 and Wolpert . Section 5 is devoted to introduce simpler methods to characterise the singular points of the cutcurve as well as its lifting by using the subresultants. Some examples are given in Section 6 and the conclusions are presented in Section 7.

## 2 Representing quadrics (and conics)

This section is devoted to introduce how quadrics will be represented when computing their intersection curve. Since we will project the considered quadrics onto the plane and the boundary of this region will be a finite number of conic arcs we introduce here how these regions will be represented and manipulated.

Quadrics are the one of the simplest surfaces defined by degree two polynomials in , and . The equation of any quadric in can be written as

 a11x2+a22y2+a33z2+2a12xy+2a13xz+2a23yz+2a14x+2a24y+2a34z+a44=0

or in matricial form where is the symmetric matrix:

 A=⎛⎜ ⎜ ⎜⎝a11a12a13a14a12a22a23a24a13a23a33a34a14a24a34a44⎞⎟ ⎟ ⎟⎠.

### 2.2 Conics

The equation of any conic in can be written as

 a11x2+a22y2+2a12xy+2a13x+2a23y+a33=0

or in matricial form where is the symmetric matrix:

 A=⎛⎜⎝a11a12a13a12a22a23a13a23a33⎞⎟⎠.

Conics will be used later to define the boundary of regions in the plane, typically the intersection of the silhouette of the two quadrics whose intersection curve is to be computed.

###### Example 2.1.

Let and be two bivariate polynomials defining two conics, circle and ellipse, respectively. We can define several regions in the plane bounded by the conics and by using the inequalities involving both polynomials (as in Figure 3).

In what follows we assume that it is easy to determine the intersection points of two conics and to manipulate the region of the plane defined by two inequalities involving degree two or one polynomials.

## 3 Mathematical tools

In this section we will make a brief introduction to resultants and subresultants and how they will applied later to compute the intersection curve between two quadrics.

### 3.1 Resultants

Resultants and subresultants will be the algebraic tool to use to determine, both, the projection of the intersection curve between the two considered quadrics and its lifting from the plane to the space since they allow a very easy and compact way to characterise the greatest common divisor of two polynomials ( and in our case) when they involve parameters ( and in our case, since we are going to eliminate ).

###### Definition 3.2.

Let

 P(T)=m∑i=0am−iTiandQ(T)=n∑i=0bn−iTi

be two polynomials in with coefficients in a field ( or in our case). We define the –th subresultant polynomial of and with respect to the variable in the following way (as in Li2006 ):

 \bf Sresj(P,Q;T)=∣∣ ∣ ∣ ∣ ∣ ∣ ∣ ∣ ∣ ∣ ∣ ∣ ∣ ∣∣a0a1a2……am⋱⋱⋱⋱a0a1a2……am1−T⋱⋱1−Tb0b1b2………bn⋱⋱⋱⋱b0b1b2………bn∣∣ ∣ ∣ ∣ ∣ ∣ ∣ ∣ ∣ ∣ ∣ ∣ ∣ ∣∣ ⎫⎪ ⎪ ⎪⎬⎪ ⎪ ⎪⎭n−j⎫⎪⎬⎪⎭j⎫⎪ ⎪ ⎪⎬⎪ ⎪ ⎪⎭m−j

and we define the –th subresultant coefficient of and with respect to , , as the coefficient of in . The resultant of and with respect to is:

 Resultant(P,Q;T)=Sres0(P,Q;T)=sres0(P,Q;T).

There are many different ways of defining and computing subresultants: see Gonzalez-Vega2009 for a short introduction and for a pointer to several references.

Subresultants allow to characterise easily the degree of the greatest common divisor of two univariate polynomials whose coefficients depend on one or several parameters. Since the resultant of and is equal to the polynomial , if and only if there exists such that and .

More generally, the determinants , which are the formal leading coefficients of the subresultant sequence for and , can be used to compute the greatest common divisor of and thanks to the following equivalence:

 Sresi(P,Q;T)=gcd(P,Q)⟺{sres0(P,Q;T)=…=sresi−1(P,Q;T)=0sresi(P,Q;T)≠0 (1)

Let and be the two polynomials in

 f(x,y,z)=z2+p1(x,y)z+p0(x,y)g(x,y,z)=z2+q1(x,y)z+q0(x,y)

(, , and ) defining the quadrics whose intersection curve is to be computed. Then the resultant of and , with respect to , is equal to:

 S0(x,y)def=Resultant(f,g;z)=∣∣ ∣ ∣ ∣∣1p1(x,y)p0(x,y)001p1(x,y)p0(x,y)1q1(x,y)q0(x,y)001q1(x,y)q0(x,y)∣∣ ∣ ∣ ∣∣=
 =(p0(x,y)−q0(x,y))2−(p1(x,y)−q1(x,y))∣∣∣p0(x,y)p1(x,y)q0(x,y)q1(x,y)∣∣∣.

The degree of is at most four. The first subresultant of and , with respect to , is equal to:

 S1(x,y;z)def=\bf Sres1(f,g;z)=(q1(x,y)−p1(x,y))z+(q0(x,y)−p0(x,y))=g(x,y,z)−f(x,y,z).

Computing the intersection of the two quadrics defined by and is equivalent to solving in the polynomial system of equations

 f(x,y,z)=0,g(x,y,z)=0.

The solution set to be computed, when non empty, may include curves and isolated points. We will use that the above polynomial system of equations, under some conditions, is equivalent to

 S0(x,y)=0,(q1(x,y)−p1(x,y))z+(q0(x,y)−p0(x,y))=0.

Analyzing in will be called the projection step and moving the information obtained in to will be called the lifting step. We follow here the terminology used when computing the cylindrical algebraic decomposition of a finite set of multivariate polynomials (see Basu2006 , for example)

## 4 Projecting the intersection curve

In this section we will characterise the projection of the intersection curve of two quadrics

 Q1:f(x,y,z)=0Q2:g(x,y,z)=0

onto the -plane. The usual way of dealing with projections of algebraic sets involves tools coming from the so called Elimination Theory. We start by analysing the well–known complex case (i.e. when we look for the intersection curve in and its projection on ) to conclude with the characterisation of the projection over the reals (i.e. when we look for the intersection curve in and its projection on ).

Let and be the two polynomials in

 f(x,y,z)=z2+p1(x,y)z+p0(x,y)g(x,y,z)=z2+q1(x,y)z+q0(x,y) (2)

with , , and .

Let and be the two sets defined as:

 Q1:{(x,y,z)∈C3:f(x,y,z)=0}Q2:{(x,y,z)∈C3:g(x,y,z)=0},

and be the projection :

 π:C3→C2(x,y,z)↦(x,y)

Next (well known) theorem characterises the set .

###### Theorem 4.3.
 π(Q1∩Q2)={(x,y)∈C2:S0(x,y)=0=0}
###### Proof.

Let such that . Then

 Resultant(f(a,b,z),g(a,b,z);z)=0

and, according to (1), there exists such that and . Thus and .

On the other hand, if then there exists such that . This implies and and that the polynomials and have a common root (). Thus we can conclude, according to (1), that . ∎

Now let and be the two sets defined as:

 E1:{(x,y,z)∈R3:f(x,y,z)=0}E2:{(x,y,z)∈R3:g(x,y,z)=0}

and be the projection :

 Π:R3→R2(x,y,z)↦(x,y)

It is clear that

 E1=Q1∩R3E2=Q2∩R3

but, for the projection, in general we can only assure that

 Π(E1∩E2)⊆{(x,y)∈R2:S0(x,y)=0}.

Checking the previous proof we see that if verifies then we can not longer conclude that the complex root common to and is real.

###### Example 4.4.

If and then . In this case the point verifies but does not belongs to since and do not have (common) real roots.

###### Theorem 4.5.
 Π(E1∩E2)=⎧⎪⎨⎪⎩(x,y)∈R2:S0(x,y)=0p1(x,y)2−4p0(x,y)≥0q1(x,y)2−4q0(x,y)≥0⎫⎪⎬⎪⎭
###### Proof.

Let and be the discriminants of and (respectively) with respect to .

If then there exists such that . Thus and , and have a common root ( and we conclude that . As is a real root of and we also have and .

On the other hand, if verifies then and have a common root : and (according to (1)). However, if and then must be a real solution of and , concluding that . ∎

Previous theorem gives a precise description for the projection of the intersection curve of two quadrics when their defining equations have the structure introduced in (2). It corresponds to the part of the curve

 {(x,y)∈R2:S0(x,y)=0}

inside the region

 AE1,E2def={(x,y)∈R2:ΔE1(x,y)≥0,ΔE2(x,y)≥0}.

As expected we find a semialgebraic set in since, according to Tarski Principle (see Basu2006 ), the projection of any semialgebraic set is a semialgebraic set too. The region where lives the projection of the intersection curve of the two considered quadrics is bounded by a finite set of conic arcs since any is a polynomial in of total degree equal to .

In Berberich:2005:ECE:1064092.1064110 , the curve in defined by is called the cutcurve of and and the curve in defined by the silhouette of . We modify slightly this definition to make the definition of the cutcurve more suitable for our purposes.

###### Definition 4.6.

Let and be two quadrics in defined by and respectively. The cutcurve of and is the set

 ⎧⎪⎨⎪⎩(x,y)∈R2:S0(x,y)=0p1(x,y)2−4p0(x,y)≥0q1(x,y)2−4q0(x,y)≥0⎫⎪⎬⎪⎭

According to Theorem 4.5 the cutcurve of and is equal to the projection of onto the plane, . Next three examples show that the cutcurve of and can be a curve, part of a curve (i.e. a semialgebraic set) or even a single point, but always a semialgebraic set.

###### Example 4.7.

Let and be the polynomials

 f(x,y,z)=3z2+x2+y2−1g(x,y,z)=z2+3x2+y2−1

defining the two ellipsoids and whose intersection curve is to be computed. In this case we have:

 S0(x,y)=64x4+32x2y2−32x2+4y4−8y2+4=4(4x2+y2−1)2
 ΔE1(x,y)=−12(x2+y2−1)ΔE2(x,y)=−4(3x2+y2−1)

and

Since the curve defined by is contained completely in (see Figure 4) we conclude that

 Π(E1∩E2)={(x,y)∈R2:S0(x,y)=0}={(x,y)∈R2:4x2+y2−1=0}
###### Example 4.8.

Let and be the polynomials

 f(x,y,z)=z2+x2+y2−7g(x,y,z)=z2−x2+xy+2x−y2

defining the two quadrics and whose intersection curve is to be computed. In this case we have:

 S0(x,y)=(−2x2+xy−2y2+2x+7)2
 ΔG1(x,y)=−4x2−4y2+28ΔG2(x,y)=4x2−4xy+4y2−8x

and

 AG1,G2={(x,y)∈R2:ΔG1(x,y)≥0,ΔG2(x,y)≥0}=
 ={(x,y)∈R2:−x2−y2+7≥0,x2−xy+y2−2x≥0}.

In this case the curve in defined by is not contained completely in : the projection of is equal to the portion of the ellipse inside the circle (see Figure 5).

###### Example 4.9.

Let and be the polynomials

 f(x,y,z)=z2+x2g(x,y,z)=z2+y2

defining the two quadrics and whose intersection curve is to be computed. In this case we have:

 S0(x,y)=(−x2+y2)2ΔB1(x,y)=−4x2ΔB2(x,y)=−4y2

and

 AB1,B2={(x,y)∈R2:ΔB1(x,y)≥0,ΔB2(x,y)≥0}={(0,0)}.

In this case the only point of the curve in defined by contained in is the point (see Figure 6).

Next results analyze all possible cases concerning the projection of the intersection curve of two quadrics in terms of the structure of the polynomials (with at most degree two) defining the considered quadrics. Their proof is similar to the introduced for proving Theorem 4.5. As before and will denote the quadrics defined by the degree polynomials and in and the projection of onto with eliminates the last variable. The region of where the projection of the intersection curve is located will be denoted by .

###### Corollary 4.10.

Let and be the polynomials in defined by:

 f(x,y,z)=z2+p1(x,y)z+p0(x,y)g(x,y,z)=q1(x,y)z+q0(x,y)

with , , , and . Then

 Π(E1∩E2)={(x,y)∈R2:S0(x,y)=0,p1(x,y)2−4p0(x,y)≥0}

where

 S0(x,y)=q0(x,y)2+q1(x,y)2p0(x,y)−p1(x,y)q1(x,y)p0(x,y).
###### Example 4.11.

Let and be the polynomials

 f(x,y,z)=z2−x2+y2+3z−3g(x,y,z)=(x+y)z−2x

defining the two quadrics and whose intersection curve is to be computed. In this case we have:

 S0(x,y)=−x4−2x3y+7x2+2xy3+y4−3y2

and

 ΔH1(x,y)=4x2−4y2+21

In this case

 AH1,H2={(x,y)∈R2:ΔH1(x,y)≥0}={(x,y)∈R2:4x2−4y2+21≥0}.

In this case the curve in defined by is a quartic curve with three connected components contained completely in :

###### Corollary 4.12.

Let and be two polynomials in defined by:

 f(x,y,z)=z2+p1(x,y)z+p0(x,y)g(x,y,z)=q0(x,y)

with , , and . Then

 Π(E1∩E2)={(x,y)∈R2:q0(x,y)=0,p1(x,y)2−4p0(x,y)≥0}.

If two quadrics have no points in common, computing the projection curve based only in the resultant can lead to wrong conclusions.

###### Example 4.13.

Let and be the polynomials

 f(x,y,z)=z2+(x−3)2g(x,y,z)=(x−1)2+y2−1

defining the two quadrics and whose intersection curve is to be computed. In this case we have:

 S0(x,y)=(x−1)2+y2−1

and

 ΔI1(x,y)=−4x2+24x−36=−4(x−3)2.

In this case

 AI1,I2={(x,y)∈R2:ΔI1(x,y)≥0}={(x,y)∈R2:−(x−3)2≥0}={(x,y)∈R2:x=3}.

The curve in defined by has no points in common with the line defined by :

###### Corollary 4.14.

Let and be the polynomials defined by:

 f(x,y,z)=p1(x,y)z+p0(x,y)g(x,y,z)=q1(x,y)z+q0(x,y)

with , , , and , . Then

 Π(E1∩E2)={(x,y)∈R2:S0(x,y)=0}
###### Example 4.15.

Let and be the polynomials

 f(x,y,z)=xz−x−yg(x,y,z)=z−x2−y2

defining the two quadrics and whose intersection curve is to be computed. In this case we have:

 S0(x,y)=x(−x2−y2)+x+y.

The cutcurve is defined by :

###### Corollary 4.16.

Let and the polynomials in defined by:

 f(x,y,z)=p1(x,y)z+p0(x,y)g(x,y,z)=q0(x,y)

with , , and , . Then the cutcurve is defined by:

 Π(E1∩E2)={(x,y)∈R2:q0(x,y)=0}
###### Example 4.17.

Let and be the polynomials

 f(x,y,z)=(5x−10y−5)z+2x+3y−4g(x,y,z)=−3x2−xy+y2+3x−2y+2

defining two quadrics and . In this case we have:

 S0(x,y)=−3x2−xy+y2+3x−2y+2

and the cutcurve is defined only by :

###### Corollary 4.18.

Let and be two polynomials in defined by:

 f(x,y,z)=p0(x,y)g(x,y,z)=q0(x,y)

with , and , . Then and both quadrics define, in the -plane, two conics. The projection of the intersection curve is given by the common points to this two conics.

###### Example 4.19.

Let and be the polynomials

 f(x,y,z)=xyg(x,y,z)=x2+y2−1

defining two quadrics and . These two quadrics define in the -plane two lines and a circle, respectively. In this case, the projection of the intersection curve is given by four points:

## 5 Lifting to R3 the cutcurve in R2

In this section we study the lifting to of the cutcurve. We will pay special attention to the singular points of the cutcurve since they are the points where more complicated situations we must deal with when lifting the cutcurve of and to . This means that, first, we must be able of isolating them in order to achieve its lifting in the easiest and most efficient possible way.

### 5.1 Determining the singular points of the cutcurve of E1 and E2

Let and be the polynomials in defined by:

 f(x,y,z)=z2+p1(x,y)z+p0(x,y)g(x,y,z)=z2+q1(x,y)z+q0(x,y)

with , , , . We restrict our attention to this case because this is the most complicated situation we must deal with: for those quadrics whose equations have a different (and simpler) structure, the singular points of the cutcurve are easier to manipulate since their lifting will be given automatically by one of the equations (being of degree smaller than or equal to ).

Let and be the corresponding quadrics defined by and and