conversions between parametric and implicit forms using ... · although the parametric formulation...

25
Computer Vision and Image Understanding 81, 1–25 (2001) doi:10.1006/cviu.2000.0881, available online at http://www.idealibrary.com on Conversions between Parametric and Implicit Forms Using Polar/Spherical Coordinate Representations Cem ¨ Unsalan Department of Electrical and Electronics Engineering, Bo˘ gazic ¸i University, Bebek, Istanbul 80815, Turkey E-mail: [email protected] and Ayt ¨ ul Er¸ c ˙ il Department of Industrial Engineering, Bo ˘ gazic ¸i University, Bebek, Istanbul 80815, Turkey E-mail: [email protected] Received August 14, 1998; accepted September 12, 2000 Since parametric and implicit forms have complementary advantages with respect to certain geometric operations, it can be useful to convert from one form to the other. In this paper, a new method for converting between parametric and implicit forms based on polar/spherical coordinate representations is introduced. c 2001 Academic Press Key Words: implicitization; parameterization; polar coordinates; spherical co- ordinates. 1. INTRODUCTION The development of computer aided graphics design has seen two distinct approaches to representing surfaces in 3D space: 1. Parametric methods with a representation of the form (x (u ,v), y (u ,v), z (u ,v)), which maps a 2D domain containing (u ,v) to 3D space. 2. Implicit methods that define a surface as a set of points {(x , y , z ) such that F (x , y , z ) = 0}. The use of parametric surfaces for the general representation and design of free-form surfaces has been quite successful and remains dominant in computer graphics and geomet- ric modeling. The implicit approach is philosophically more closely related to the concepts of constructive solid geometry and solid modeling and is receiving increased attention. 1 1077-3142/01 $35.00 Copyright c 2001 by Academic Press All rights of reproduction in any form reserved.

Upload: others

Post on 19-Jun-2020

12 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Conversions between Parametric and Implicit Forms Using ... · Although the parametric formulation is useful for tracing, rendering, and surface fitting, many operations such as

Computer Vision and Image Understanding81,1–25 (2001)doi:10.1006/cviu.2000.0881, available online at http://www.idealibrary.com on

Conversions between Parametric and ImplicitForms Using Polar/SphericalCoordinate Representations

CemUnsalan

Department of Electrical and Electronics Engineering, Bogazici University, Bebek, Istanbul 80815, TurkeyE-mail: [email protected]

and

Aytul Ercil

Department of Industrial Engineering, Bogazici University, Bebek, Istanbul 80815, TurkeyE-mail: [email protected]

Received August 14, 1998; accepted September 12, 2000

Since parametric and implicit forms have complementary advantages with respectto certain geometric operations, it can be useful to convert from one form to the other.In this paper, a new method for converting between parametric and implicit formsbased on polar/spherical coordinate representations is introduced.c© 2001 Academic Press

Key Words: implicitization; parameterization; polar coordinates; spherical co-ordinates.

1. INTRODUCTION

The development of computer aided graphics design has seen two distinct approaches torepresenting surfaces in 3D space:

1. Parametric methods with a representation of the form (x(u, v), y(u, v), z(u, v)), whichmaps a 2D domain containing (u, v) to 3D space.

2. Implicit methods that define a surface as a set of points{(x, y, z) such thatF(x, y, z)= 0}.

The use of parametric surfaces for the general representation and design of free-formsurfaces has been quite successful and remains dominant in computer graphics and geomet-ric modeling. The implicit approach is philosophically more closely related to the conceptsof constructive solid geometry and solid modeling and is receiving increased attention.

1

1077-3142/01 $35.00Copyright c© 2001 by Academic Press

All rights of reproduction in any form reserved.

Page 2: Conversions between Parametric and Implicit Forms Using ... · Although the parametric formulation is useful for tracing, rendering, and surface fitting, many operations such as

2 UNSALAN AND ERCIL

Implicit surface functions naturally describe the interior of an object, whereas a parametricdescription of an object usually consists of piecewise surface patches. Both approaches havelong lists of pros and cons [2]. Although the parametric formulation is useful for tracing,rendering, and surface fitting, many operations such as surface intersection require one ofthe surfaces to be represented implicitly. Moreover, the implicit representation can be usedto test whether a point lies on the boundary and to represent an object as a semialgebraic set,and implicit forms are finding wider applications in computer vision, mainly in the area ofobject recognition and automated tolerance inspection [3, 4, 13–16]. Algebraic invariants ofimplicit polynomials have been shown to be very effective in Euclidean and affine invariantobject recognition [16].

Since parametric and implicit forms have complementary advantages with respect to cer-tain geometric operations, it can be useful to convert from one form to the other. Conversionbetween implicit and parametric forms opens new possibilities of combining the existingvast databases of CAD models using parametric representations with the advantages ofimplicit polynomials for invariant object recognition.

Conversion from parametric to implicit form is known asimplicitizationand every rationalsurface and curve can be represented implicitly as the zero set of an irreducible1 homo-geneous polynomialf (x, y, z, w) = 0 for surfaces, andf (x, y) = 0 for 2D curves [12].Sederberget al. [12] apply resultants to eliminate parameters from polynomials; Hoffman[5] details the use of the Gr¨obner bases for the same purpose; and Hoffman [6] describesthe Wu–Ritt method. The conversion from implicit to parametric form is known asparame-terization.Parameterization is not always possible, however; for example, implicit surfacesthat are defined by certain polynomials of fourth and higher degree cannot be parameterizedby rational functions [9]. Conversion is always possible for nondegenerate quadrics and forcubics that have a singular point.

In this paper, a new approach to conversion between parametric and implicit formsbased on polar coordinate representation of the coordinate system will be outlined. Themain contribution is the implicit/parametric conversion since no techniques are availablein the literature for this type of conversion. Section 2 outlines the technique for convertingfrom parametric form to implicit form and Section 3 outlines the technique for the reverseconversion. In Section 4, the conversion techniques developed are applied to automatedtolerance inspection of a 3D object.

2. CONVERSION FROM PARAMETRIC FORM TO IMPLICIT FORM

There are three known techniques for implicitization of parametric forms. All of thesetechniques reduce the problem of implicitizing rational surfaces to eliminating two vari-ables from three parametric equations. In general, it is believed that techniques based onelimination theory can result in extraneous factors along with the implicit representation,and their separation can be a difficult task. The technique developed in this section is validonly for star-shaped objects.

THEOREM1 (Conversion in 2D). Letα be a parameterized curve in<2 s.t.α : (a, b)→<2 withα(t) = (h(t), g(t)),where(a, b) is an open interval in<. The implicit representation

1 If a change of variables cannot reduce the degree of the polynomial expression, then it is assumed to beirreducible.

Page 3: Conversions between Parametric and Implicit Forms Using ... · Although the parametric formulation is useful for tracing, rendering, and surface fitting, many operations such as

PARAMETRIC AND IMPLICIT FORM CONVERSION 3

of this curve is given as

h2

(f −1

(y

x

))+ g2

(f −1

(y

x

))= x2+ y2, (1)

where f(t) is an invertible function of the form f(t) = g(t)h(t) .

Proof. Let (r, θ ) be a polar representation of a pointp = (x, y) ∈ <2 on the curveα forsomet . The value,yx , at any point (x, y) on the curve and parametric representation of thevalue, g(t)

h(t) , at this point is the same. Equating these two values and defining a new functionof the form givesf (t) = g(t)

h(t) = yx . As the curve is star-shaped,f (t) is an invertible function.

We obtaint = f −1( y

x

). Using the standard change of variables formulas from rectangular

to polar coordinates,

x2+ y2 = r 2 (2)

x = r cosθ (3)

y = r sinθ, (4)

we can rewrite Eq. (2) as

h2

(f −1

(y

x

))+ g2

(f −1

(y

x

))= r 2 = x + y2.

EXAMPLE 1. Leth(t) = sint andg(t) = sint cost ; then f (t) = cost andt = cos−1( yx ) .

The corresponding implicit form isx2+ y2 = sin2(cos−1 yx )+ sin2(cos−1 y

x ) cos2(cos−1 yx ).

Simplifying this equation will yieldx4− x2+ y2 = 0. Both parametric and implicit repre-sentations are plotted in Fig. 1.

The advantage of this technique over existing techniques in the literature is that it is notiterative and hence is in general faster, although no systematic time comparisons have beencarried out. Another advantage is that there are no spurious parts in the implicit functionobtained.

Theorem 1 gives the conversion of parametric functions to corresponding implicit poly-nomial form whenf (t) = g(t)

h(t) is invertible. If the parametric representation of the objectboundary is carried out using Fourier expansion fitting, which is detailed below, the implicit

FIG. 1. Plot of parametric and implicit representations.

Page 4: Conversions between Parametric and Implicit Forms Using ... · Although the parametric formulation is useful for tracing, rendering, and surface fitting, many operations such as

4 UNSALAN AND ERCIL

function/polynomial representation of the object can be obtained more easily. This case isgiven in Theorem 2.

DEFINITION 1. LetCn be an (n+ 1)-dimensional vector such that

Cn(2i + 1)= (−1)i an, Cn(2i + 2)= (−1)i bn i = 0, 1, 2, 3 . . . ,

where

a0 = 1

2Ns

Ns∑k=1

r (k) an = 1

Ns

Ns∑k=1

r (k) cos

(2knπ

Ns

)bn = 1

Ns

Ns∑k=1

r (k) sin

(2knπ

Ns

).

an, bn correspond to Fourier series coefficients of the parametric representation of a 2DshapeF(r (t), t) = 0 t ∈ [0, Ns]. Ns is the total number of samples of the functionr (t) ofthe contour of the 2D shape.

Define⊗ to be an operator such that(n+1∑i=1

ai

)⊗ Sn =

n+1∑i=1

ai Sn(i ).

Both the implicit polynomial representation and the parametric representation of the objectare based on representing the boundary of the object in polar coordinates and expandingthe radius functionr (t) in terms of the angleθ by Fourier series.Ns is the total number ofsamples of the radius functionr (t), from 0 to 2π radians. Note here that radius function isequally sampled, sof (t) = t andt = θ .

LEMMA 1. Nth degree Fourier series approximations for x(θ ) and y(θ ) can be repre-sented as

x(θ ) = r cos(θ ), y(θ ) = r sin(θ ),

where

r = a0+∞∑

n=1

an cosnθ + bn sinnθ.

Proof. Since the radius functionr = r (θ ) for a star-shaped object boundary is periodicand it satisfies the requirements for being a function,r can be expanded into a Fourier serieswith respect to indexθ as

r = a0+∞∑

n=1

an cosnθ + bn sinnθ.

Using the polar/Cartesian conversion formulas, the representations forx(t) and y(t) areobtained.

THEOREM2 (Conversion from Parametric Representations Using Fourier Series Fitting).An implicit function representation of any star-shaped object represented by Nth degreeFourier series can be obtained as

(x2+ y2)1/2 =N∑

n=0

Kn

(x2+ y2)n/2, (5)

Page 5: Conversions between Parametric and Implicit Forms Using ... · Although the parametric formulation is useful for tracing, rendering, and surface fitting, many operations such as

PARAMETRIC AND IMPLICIT FORM CONVERSION 5

where

Kn = (x + y)n ⊗ Cn and K0 = a0. (6)

The corresponding implicit polynomial representation is given as follows:For N even:

(x2+ y2)

((x2+ y2)N/2−

N∑modd

Km(x2+ y2)(N−m−1)/2

)2

=(

N∑seven

Ks(x2+ y2)(N−s)/2

)2

.

(7)

For N odd:((x2+ y2)(N+1)/2−

N∑modd

Km(x2+ y2)(N−m)/2

)2

= (x2+ y2)

(N∑

seven

Ks(x2+ y2)(N−s−1)/2

)2

.

(8)

Proof. Since radius functionr = r (θ ) for a star-shaped object boundary is periodic andit satisfies the requirements for being a function,r can be expanded into Fourier series withrespect to indexθ as

r = a0+∞∑

n=1

an cosnθ + bn sinnθ. (9)

Using the expansion formulas for cosnθ and sinnθ given in Appendix A, and substi-tuting Eqs. (2)–(4) into the expanded formula, we obtain the above implicit polynomialform.

EXAMPLE 2. Two star-shaped objects represented by a parametric representation usingFourier series expansion are converted to implicit polynomial form using Theorem 2. The80th degree implicit polynomial representations for Mig and Butterfly shapes obtained fromthis conversion are given in Figs. 2 and 3.

THEOREM 3 (Conversion for Space Curves).Let α be a parameterized space curvein <3 s.t. α : (a, b)→ <3 with α(t) = (h(t), g(t), k(t)), where(a, b) is an open intervalin <.

FIG. 2. Implicit polynomial plot of Mig.

Page 6: Conversions between Parametric and Implicit Forms Using ... · Although the parametric formulation is useful for tracing, rendering, and surface fitting, many operations such as

6 UNSALAN AND ERCIL

FIG. 3. Implicit polynomial plot of Butterfly.

The two implicit surfaces, whose intersection represents this space curve, are given as

h2

(f −11

(y

x

))+ g2

(f −11

(y

x

))+ k2

(f −12

(z√

x2+ y2

))= x2+ y2+ z2 (10)

h2

(f −11

(y

x

))+ g2

(f −11

(y

x

))+ k2

(f −13

(z

y

))= x2+ y2+ z2, (11)

where

f1(t) is an invertible function of the form f1(t) = g(t)/h(t)

f2(t) is an invertible function of the form f2(t) = k(t)/√

g2(t)+ h2(t)

f3(t) is an invertible function of the form f3(t) = k(t)/g(t).

Proof. Let (r, θ, ϕ) be a polar representation of a pointp = (x, y, z) ∈ <3 on the curveα.x = h(t), y = g(t), z= k(t) for somet . f1(t), f2(t), and f3(t) are obtained using equal-ities similar to those given in Theorem 1. These three functions are invertible since thespace curve is star-shaped. We can find three different versions oft as t = f −1

1 (y/x),t = f −1

2 (z/√

x2+ y2), andt = f −13 (z/y). Using the standard formulas for change of vari-

ables from rectangular to spherical coordinates,

x2+ y2+ z2 = R2 (12)

x = Rcosθ sinϕ (13)

y = Rsinθ sinϕ (14)

z= Rcosϕ, (15)

we can rewrite Eq. (10) as

h2

(f −11

(y

x

))+ g2

(f −11

(y

x

))+ k2

(f −12

(z√

x2+ y2

))= R2 = x2+ y2+ z2.

We can rewrite Eq. (11) as

h2

(f −11

(y

x

))+ g2

(f −11

(y

x

))+ k2

(f −13

(z

y

))= R2 = x2+ y2+ z2.

Page 7: Conversions between Parametric and Implicit Forms Using ... · Although the parametric formulation is useful for tracing, rendering, and surface fitting, many operations such as

PARAMETRIC AND IMPLICIT FORM CONVERSION 7

EXAMPLE 3. α(t) = (h(t), g(t), k(t)) is a parametric space curve.h(t) = sint , g(t) =cost , k(t) = cos2 t . Then

f1(t) = cost

sintt = arccot

y

x

f2(t) = cos2 t t = arccosz√

x2+ y2

f3(t) = cost t = arccosz

y.

Implicit surface 1 is obtained asx2+ y2+ z2 = 1+ z2/(x2+ y2). In simplified formx2+ y2 = 1.

Implicit surface 2 is obtained asx2+ y2+ z2 = 1+ z4/y4. In simplified formz= ±y2

or z= ±(1− x2).Two implicit surfaces, which represent this space curve, are obtained as

x2+ y2 = 1

z= 1− x2.

A parametric representation of the space curve is plotted in Fig. 4. Two intersectingimplicit surfaces, where their intersection represents the space curve, are plotted in Fig. 5.It can be seen that the two representations correspond to the same space curve.

THEOREM 4 (Patch Conversion for 3D).Let α be a parameterized patch in<3 s.t.α : [(0, 2π ), (0, 2π )] → <3, with α(θ, ϕ) = (x(θ, ϕ), y(θ, ϕ), z(θ, ϕ)). An implicit repre-sentation of this patch in terms of x, y, z can be found, if θ andϕ can be obtained explicitly,from

y(θ, ϕ)

x(θ, ϕ)= y

x,

√x(θ, ϕ)2+ y(θ, ϕ)2

z(θ, ϕ)=√

x2+ y2

z,

y(θ, ϕ)

z(θ, ϕ)= y

z.

An implicit representation for the corresponding patch is given as

x(θ, ϕ)2+ y(θ, ϕ)2+ z(θ, ϕ)2 = x2+ y2+ z2. (15)

Proof. The proof is the same as that given for previous two theorems. The only differencein this theorem is that an explicit slope function cannot be defined here.

EXAMPLE 4. Letα(θ, ϕ) = (x(θ, ϕ), y(θ, ϕ), z(θ, ϕ)) be a patch representation of theshape given in Fig. 6.x(θ, ϕ) = cosθ sinϕ, y(θ, ϕ) = cosθ, z(θ, ϕ) = cosϕ. ϕ is obtainedfrom the equalityy

x = 1sinϕ asϕ = arcsinx

y . θ is obtained from the equality√cos2 θ (1+ sin2 ϕ)

cosϕ=√

x2+ y2

z

as

θ = arccos

√y2− x2

z.

Page 8: Conversions between Parametric and Implicit Forms Using ... · Although the parametric formulation is useful for tracing, rendering, and surface fitting, many operations such as

8 UNSALAN AND ERCIL

FIG. 4. Parametric representation.

FIG. 5. Implicit representation (intersection of two implicit surfaces).

FIG. 6. Plot of 3D patch given in Example 4.

FIG. 13. Implicit surfaces and parametric form of space curve in Example 11.

Page 9: Conversions between Parametric and Implicit Forms Using ... · Although the parametric formulation is useful for tracing, rendering, and surface fitting, many operations such as

PARAMETRIC AND IMPLICIT FORM CONVERSION 9

FIG. 14. Water pipe and point to be inspected.

Replacing these values in the equality gives

cos2 θ (1+ sin2 ϕ)+ cos2 ϕ = x2+ y2+ z2.

The corresponding implicit form is obtained as

y2− x2− y2z2 = 0.

3. CONVERSION FROM IMPLICIT FORM TO PARAMETRIC FORM

Conversion of an implicit polynomial to a corresponding parametric form is not alwayspossible. In this section, we will give some cases for which the implicit-to-parametricconversion can be carried out. The conversion can be carried out exactly for the cases givenin Lemmas 2–5 and approximately for more general cases.

3.1. Conversion in 2D

LEMMA 2. A polynomial of the form

n∑m=0

amxmy(n−m) +k∑

m=0

bmxmy(k−m) = 0 (16)

(sum of two homogeneous polynomials) can be converted to parametric formα(θ ) =(h(θ ), g(θ )) as

h(θ ) = n−k

√−∑k

m=0 bm cosm θ sin(k−m) θ∑nm=0 am cosm θ sin(n−m) θ

cosθ (17)

g(θ ) = n−k

√−∑k

m=0 bm cosm θ sin(k−m) θ∑nm=0 am cosm θ sin(n−m) θ

sinθ. (18)

Parameter values to obtain the real-valued parametric form specify the parameter range.

Proof. Equation (16) can be represented in polar coordinates as

r nn∑

m=0

am cosm θ sin(n−m) θ + r kk∑

m=0

bm cosm θ sin(k−m) θ = 0.

Page 10: Conversions between Parametric and Implicit Forms Using ... · Although the parametric formulation is useful for tracing, rendering, and surface fitting, many operations such as

10 UNSALAN AND ERCIL

If we solve the above equation forr , we obtain

r n−k = −∑k

m=0 bm cosm θ sin(k−m) θ∑nm=0 bm cosm θ sin(n−m) θ

. (19)

By using the polar-to-rectangular coordinate change-of-variable formulasα(θ )= (r cosθ ,r sinθ ) is obtained.

EXAMPLE 5. Consider the implicit curvex4− x2+ y2 = 0:

(r cosθ )4− (r cosθ )2+ (r sinθ )2 = 0

r 2 = cos2 θ − sin2 θ

cos4 θ

h(θ ) =√

cos2 θ − sin2 θ

cosθg(θ ) =

√cos2 θ − sin2 θ

sinθ

cos2 θθ ∈ [0, 2π ].

EXAMPLE 6. Superquadratics in 2D can be converted to parametric form by Lemma 2.A general form of a superquadratic can be given as[(

x

a1

)2/ε2

+(

y

a2

)2/ε2

− a

]ε2/ε1

= 1, (20)

obtainingr (θ ) as

r (θ ) = aε2/2

/[(cosθ

a1

)2/ε2

+(

sinθ

a2

)2/ε2]ε2/2

.

The parametric form for the general superquadratic is then given as

h(θ ) = r (θ ) cosθ, g(θ ) = r (θ ) sinθ.

LEMMA 3. A polynomial of the form

2∑l=0

n−l∑m=0

amlxmy(n−l−m) = 0 (21)

(three homogeneous polynomials of consecutive degrees) can be converted to two parametricforms as

α1(t) = (h1(t), g1(t)) (22)

α2(t) = (h2(t), g2(t)) (23)

h1(θ ) = −p−√

p2− 4sq

2scosθ (24)

g1(θ ) = −p−√

p2− 4sq

2ssinθ (25)

h2(θ ) = −p+√

p2− 4sq

2scosθ (26)

g2(θ ) = −p+√

p2− 4sq

2ssinθ, (27)

Page 11: Conversions between Parametric and Implicit Forms Using ... · Although the parametric formulation is useful for tracing, rendering, and surface fitting, many operations such as

PARAMETRIC AND IMPLICIT FORM CONVERSION 11

where

s =n∑

m=0

am0 cosm θ sin(n−m) θ (28)

p =n−1∑m=0

am1 cosm θ sin(n−1−m) θ (29)

q =n−2∑m=0

am2 cosm θ sin(n−2−m) θ. (30)

Parameter values to obtain a real-valued parametric form specify the parameter range.

Proof. Equation (21) can be represented in polar coordinates as

2∑l=0

n−l∑m=0

r n−l aml cosm θ sin(n−l−m) θ = 0

r n−22∑

l=0

r 2−ln−l∑m=0

aml cosm θ sin(n−l−m) θ = 0 (31)

sr2+ pr + q = 0. (32)

Solving this quadratic equation in terms ofr and using polar-to-rectangular coordi-nate conversion formulas will give parametric representations of the polynomial given inEqs. (22) and (23). A closed-form solution of this quadratic equation can be found in [1].

EXAMPLE 7. Let x2+ y2− 2x − 2y+ 1= 0, r 2− 2r (cosθ + sinθ )+ 1= 0. To findreal-valued roots of this equation, the following constraint has to be satisfied: 4(cosθ +sinθ )2− 4≥ 0. It is satisfied forθ ∈ [0, π2 ].

The solutions of the above equation are

r1 = cosθ + sinθ −√

sin 2θ r2 = cosθ + sinθ +√

sin 2θ

and the corresponding two parametric curves are obtained as

h1(θ ) = r1 cosθ g1(θ ) = r1 sinθ

h2(θ ) = r2 cosθ g2(θ ) = r2 sinθ θ ∈[0,π

2

].

The implicit polynomial form of the curve given in this example is plotted in Fig. 7. Thecorresponding two parametric forms obtained from Lemma 3 are plotted in Figs. 8 and 9.

LEMMA 4. A polynomial of the form

3∑l=0

n−l∑m=0

amlxmy(n−l−m) = 0 (33)

Page 12: Conversions between Parametric and Implicit Forms Using ... · Although the parametric formulation is useful for tracing, rendering, and surface fitting, many operations such as

12 UNSALAN AND ERCIL

FIG. 7. Plot of the implicit form of curve given in Example 6.

( four homogeneous polynomials of consecutive degrees) can be converted to three para-metric forms as

α1(t) = (h1(t), g1(t)) (34)

α2(t) = (h2(t), g2(t)) (35)

α3(t) = (h3(t), g3(t)) (36)

h1(θ ) = (A+ B) cosθ (37)

g1(θ ) = (A+ B) sinθ (38)

h2(θ ) =(− A+ B

2+ A− B

2

√−3

)cosθ (39)

g2(θ ) =(− A+ B

2+ A− B

2

√−3

)sinθ (40)

h3(θ ) =(− A+ B

2− A− B

2

√−3

)cosθ (41)

g3(θ ) =(− A+ B

2− A− B

2

√−3

)sinθ, (42)

where

A = 3

√−b

2+√

b2

4+ a3

27(43)

FIG. 8. Plot of the first part of parametric curve in Example 6.

Page 13: Conversions between Parametric and Implicit Forms Using ... · Although the parametric formulation is useful for tracing, rendering, and surface fitting, many operations such as

PARAMETRIC AND IMPLICIT FORM CONVERSION 13

FIG. 9. Plot of the second part of parametric curve in Example 6.

B = 3

√−b

2−√

b2

4+ a3

27(44)

a = 1

3

(3

q

s− p2

s2

)(45)

b = 1

27

(2

p3

s3− 9

pq

s2+ 27

u

s

), (46)

s, p, q are defined in Eqs.(28)–(30),and

u =n−3∑m=0

am3 cosm θ sin(n−3−m) θ. (47)

Parameter values to obtain a real-valued parametric form specify the parameter range.

Proof. Equation (33) can be represented in polar coordinates as

3∑l=0

n−l∑m=0

r n−l aml cosm θ sin(n−l−m) θ = 0

r n−33∑

l=0

r 3−ln−l∑m=0

aml cosm θ sin(n−l−m) θ = 0 (48)

sr3+ pr2+ qr + u = 0. (49)

Solving this cubic equation in terms ofr and using polar-to-rectangular coordinate conver-sion formulas will give parametric representations of the polynomial given in Eqs. (34)–(36).A closed-form solution of this cubic equation can be found in [1].

LEMMA 5. A polynomial of the form

4∑l=0

n−l∑m=0

amlxmy(n−l−m) = 0 (50)

Page 14: Conversions between Parametric and Implicit Forms Using ... · Although the parametric formulation is useful for tracing, rendering, and surface fitting, many operations such as

14 UNSALAN AND ERCIL

( five homogeneous polynomials of consecutive degrees) can be converted to four parametricform as

α1(t) = (h1(t), g1(t)) (51)

α2(t) = (h2(t), g2(t)) (52)

α3(t) = (h3(t), g3(t)) (53)

α4(t) = (h4(t), g4(t)) (54)

h1(θ ) =(− p

4s+ R

2+ D

2

)cosθ (55)

g1(θ ) =(− p

4s+ R

2+ D

2

)sinθ (56)

h2(θ ) =(− p

4s+ R

2− D

2

)cosθ (57)

g2(θ ) =(− p

4s+ R

2− D

2

)sinθ (58)

h3(θ ) =(− p

4s+ R

2+ E

2

)cosθ (59)

g3(θ ) =(− p

4s+ R

2+ E

2

)sinθ (60)

h4(θ ) =(− p

4s+ R

2− E

2

)cosθ (61)

g4(θ ) =(− p

4s+ R

2− E

2

)sinθ. (62)

Let l be any root of the equation

l 3− q

sl 2+

(pu

s2− 4v

)l − p2v

s3+ 4

qv

s2− u2

s2= 0. (63)

Then

R =√

p

4s− q

s+ l (64)

D =√

3p2

4s2− R2− 2

q

s+ 4pqs− 8us2− p3

4s3R(65)

E =√

3p2

4s2− R2− 2

q

s− 4pqs− 8us2− p3

4s3R. (66)

s, p, q are defined in Eqs.(28)–(30);u is defined in Eq.(47);

v =n−4∑m=0

am4 cosm θ sin(n−4−m) θ. (67)

Parameter values to obtain a real-valued parametric form specify the parameter range.

Page 15: Conversions between Parametric and Implicit Forms Using ... · Although the parametric formulation is useful for tracing, rendering, and surface fitting, many operations such as

PARAMETRIC AND IMPLICIT FORM CONVERSION 15

Proof. Equation (50) can be represented in polar coordinates as

4∑l=0

n−l∑m=0

r n−l aml cosm θ sin(n−l−m) θ = 0

r n−44∑

l=0

r 4−ln−l∑m=0

aml cosm θ sin(n−l−m) θ = 0 (68)

sr4+ pr3+ qr2+ ur + v = 0. (69)

Solving this quartic equation in terms ofr and using polar to rectangular coordinate con-version formulas will give parametric representations of the polynomial given in Eqs. (51)–(54). A solution of this quartic equation can be found in [1].

THEOREM 5 (Conversion in 2D). Exact parametric representation for implicit polyno-mials up to degree4 or polynomials that are sums of up to five homogeneous polynomialscan be obtained by representing them in polar coordinates and solving the correspondingequation to obtain r(θ ).

Proof. The proof follows from Lemmas 2–5.

Note that the implicit polynomials can be converted to corresponding parametric formsif the obtained equation ofr (θ ) has real roots. In case the equation does not have any realroots, the implicit polynomial does not have a corresponding parametric form.

As a special case, higher order polynomials that can be factored into terms of at mostfourth-order polynomials can also be converted to parametric form term by term. An exampleis given for such a situation.

EXAMPLE 8. Consider the implicit polynomial of the form

x22y10+ x14y18− 10−5x14y10− 1.9x20y12− 1.9x12y20+ 19× 10−6x12y12+ x18y14

+ x10y22− 10−5x10y14− 0.5x18y10− 0.5x10y18+ 5× 10−6x10y10 = 0.

The plot of this implicit polynomial is given in Fig. 10.This implicit polynomial can be factored as

(x4− 1.9x2y2+ y4− 0.5)(x8+ y8− 10−5)x10y10 = 0.

FIG. 10. Shape of implicit polynomial in Example 8.

Page 16: Conversions between Parametric and Implicit Forms Using ... · Although the parametric formulation is useful for tracing, rendering, and surface fitting, many operations such as

16 UNSALAN AND ERCIL

Converting this implicit polynomial term by term proceeds as follows:

First term:

r 4(cos4 θ − 1.9 sin2 θ cos2 θ + sin4 sin2 θ ) = 0.5

h1(θ ) =(

0.5

(cos4 θ − 1.9 sin2 θ cos2 θ + sin4 sin2 θ )

)1/4

cosθ

g1(θ ) =(

0.5

(cos4 θ − 1.9 sin2 θ cos2 θ + sin4 sin2 θ )

)1/4

sinθ θ ∈ [0, 2π ].

Second term:

r 8(cos8 θ + sin8 θ ) = 10−5

h2(θ ) =(

10−5

(cos8 θ + sin8 θ )

)1/8

cosθ

g2(θ ) =(

10−5

(cos8 θ + sin8 θ )

)1/8

sinθ θ ∈ [0, 2π ].

Third term:

r 10(cos10 θ + sin10 θ ) = 0

h3(θ ) = 0, g3(θ ) = 0.

LEMMA 6 (Conversion for Higher Order Implicit Polynomials). Implicit polynomialsthat are of order higher than4 and cannot be written as sums of five homogeneous polyno-mials can be converted to an approximate parametric form.

Proof. The conversion procedure is the same as in Lemmas 2–5. However, since there isno analytical solution to an equation of degree higher than 4, the solution is approximated bynumerical techniques. A Fourier fitting technique is then applied to obtain the approximateparametric shape.j

EXAMPLE 9. An implicit polynomial of the form f (x, y) = 0 is given to representan object plotted in Fig. 11. This implicit polynomial is converted to an approximatedparametric form and both of the representations are plotted in Fig. 12:

f (x, y) = 4663633x2y2− 51081695y3+ 5603905960xy− 276518665x3+ 408x5y

+ 1421498y4+ 30547238788903+ 622833383233x + 72289297932y

− 9748431770y2+ 4495262x4− 638483xy3− 18536463436x2

FIG. 11. Implicit plot of an object.

Page 17: Conversions between Parametric and Implicit Forms Using ... · Although the parametric formulation is useful for tracing, rendering, and surface fitting, many operations such as

PARAMETRIC AND IMPLICIT FORM CONVERSION 17

FIG. 12. Parametric approximation to the shape and the original object.

− 3285437x3y+ 45302709x2y+ 31700x5− 693x4y2− 500x6

− 159136086xy2− 2xy5− 119y6− 364x2y4+ 349x3y3+ 7017y5

− 16672x4y+ 37939x3y2− 5499x2y3+ 8673xy4 = 0.

In polar coordinate representation

f (r, θ ) = (408 cosθ sinθ + 57 sinθ cos5 θ + 807 cos2 θ − 478 cos4 θ + 52 cos6 θ − 500

− 467 cos3 θ sinθ )r 6+ (31700 sinθ − 25461 sinθ cos2 θ + 2434 cos4 θ sinθ

− 4156 cos5 θ − 16672 cosθ + 27845 cos3 θ )r 5+ (1253127 cos4 θ

+ 2646954 cos3 θ sinθ − 4326891 cos2 θ − 3285437 cosθ sinθ + 4495262)r 4

+ (−96384404 cos3 θ − 276518665 sinθ + 45302709 cosθ

+ 117382579 sinθ cos2 θ )r 3+ (−18536463436+ 5603905960 cosθ sinθ

+ 8788031666 cos2 θ )r 2+ (72289297932 cosθ + 622833383233 sinθ )r

+ 30547238788903= 0.

For each angle valueθ, r (θ ), which is sixth-order one-valued polynomial, is solved to obtainthe corresponding positive, real radius value, and Fourier fitting is applied to these points toobtain the approximate parametric shape of the object. A fitted parametric curve is plottedon top of the orignal object in Fig. 12.

3.2. Conversion in 3D

In this section, we will give results on converting an implicit polynomial in three variablesto a corresponding parametric form. The techniques used are similar to those in 2D exceptthat spherical coordinate representations will be used instead of polar representations. Proofsof the following lemmas are similar to the proofs of lemmas given for 2D; hence they areomitted.

LEMMA 7. A polynomial of the form

n∑m=0

[amxmy(n−m)+bmxmz(n−m)+cmymz(n−m)

]+ n∑m=1

n∑t=1

[dmtx

myt z(n−m−t)]

+k∑

m=0

[emxmy(k−m)+ fmymz(k−m)+ gmymz(k−m)

]+ k∑m=1

k∑t=1

[hmtx

myt z(k−m−t)]=0 (70)

can be written as a patch of the form

Page 18: Conversions between Parametric and Implicit Forms Using ... · Although the parametric formulation is useful for tracing, rendering, and surface fitting, many operations such as

18 UNSALAN AND ERCIL

x(θ, ϕ)

= n−k

√√√√√√√−k∑

m=0

[emαmβ (k−m) + fmαmγ (k−m) + gmβmγ (k−m)

]+ k∑m=1

k∑t=1

[hmtαmβ tγ (k−m−t)

]n∑

m=0

[amαmy(n−m) + bmαmγ (n−m) + cmβmγ (n−m)

]+ n∑m=1

n∑t=1

[dmtαmβ tγ (n−m−t)

] sinϕ cosθ

(71)y(θ, ϕ)

= n−k

√√√√√√√−k∑

m=0

[emαmβ (k−m) + fmαmγ (k−m) + gmβmγ (k−m)

]+ k∑m=1

k∑t=1

[hmtαmβ tγ (k−m−t)

]n∑

m=0

[amαmy(n−m) + bmαmγ (n−m) + cmβmγ (n−m)

]+ n∑m=1

n∑t=1

[dmtαmβ tγ (n−m−t)

] sinϕ sinθ

(72)z(θ, ϕ)

= n−k

√√√√√√√−k∑

m=0

[emαmβ (k−m) + fmαmγ (k−m) + gmβmγ (k−m)

]+ k∑m=1

k∑t=1

[hmtαmβ tγ (k−m−t)

]n∑

m=0

[amαmy(n−m) + bmαmγ (n−m) + cmβmγ (n−m)

]+ n∑m=1

n∑t=1

[dmtαmβ tγ (n−m−t)

] cosϕ,

(73)

where

α = sinϕ cosθ (74)

β = sinϕ sinθ (75)

γ = cosϕ. (76)

Parameter values to obtain a real-valued patch specify parameter ranges.

EXAMPLE 10. Superquadratics in 3D can also be converted to parametric patch form byLemma 7. A general form of a superquadratic in 3D can be given as[(

x

a1

)2/ε2

+(

y

a2

)2/ε2]ε2/ε1

h

(z

a3

)2/ε1

= 1, (77)

obtainingR(θ, ϕ) as

R(θ, ϕ) = 1

/[[(cosθ sinϕ

a1

)2/ε2

+(

sinθ sinϕ

a2

)2/ε2]ε2/ε1

h

(cosϕ

a2

)2/ε1]ε1/2

.

The parametric patch form for the general superquadratic in 3D is given as

x(θ, ϕ) = R(θ, ϕ) cosθ sinϕ, y(θ, ϕ) = R(θ, ϕ) sinθ sinϕ, z(θ, ϕ) = R(θ, ϕ) cosϕ.

LEMMA 8. A polynomial of the form

2∑l=0

[n−l∑m=0

[amlx

my(n−l−m) + bmlxmz(n−l−m) + cml y

mz(n−l−m)]

+n−l∑m=1

n−l∑t=1

[dmtlx

myt z(n−l−m−t)]] = 0 (78)

Page 19: Conversions between Parametric and Implicit Forms Using ... · Although the parametric formulation is useful for tracing, rendering, and surface fitting, many operations such as

PARAMETRIC AND IMPLICIT FORM CONVERSION 19

can be written as two patches of the forms

x1(θ, ϕ) = −p+√

p2− 4sq

2ssinϕ cosθ (79)

y1(θ, ϕ) = −p+√

p2− 4sq

2ssinϕ sinθ (80)

z1(θ, ϕ) = −p+√

p2− 4sq

2scosϕ (81)

x2(θ, ϕ) = −p−√

p2− 4sq

2ssinϕ cosθ (82)

y2(θ, ϕ) = −p−√

p2− 4sq

2ssinϕ sinθ (83)

z2(θ, ϕ) = −p−√

p2− 4sq

2scosϕ (84)

s =n∑

m=0

[am0α

my(n−m) + bm0αmγ (n−m) + cm0β

mγ (n−m)]

+n∑

m=1

n∑t=1

[dmt0α

mβ tγ (n−m−t)]

(85)

p =n−1∑m=0

[am1α

my(n−1−m) + bm1αmγ (n−1−m) + cm1β

mγ (n−1−m)]

+n−1∑m=1

n−1∑t=1

[dmt1α

mβ tγ (n−1−m−t)]

(86)

q =n−2∑m=0

[am2α

my(n−2−m) + bm2αmγ (n−2−m) + cm2β

mγ (n−2−m)]

+n−2∑m=1

n−2∑t=1

[dmt2α

mβ tγ (n−2−m−t)]. (87)

α, β, γ are defined in Eqs.(74)–(76).Parameter values to obtain real-valued patches specify parameter ranges.

LEMMA 9. A polynomial of the form

3∑l=0

[n−1∑m=0

[amlx

my(n−l−m) + bmlxmz(n−l−m) + cml y

mz(n−l−m)]

+n−l∑m=1

n−l∑t=1

[dmtlx

myt z(n−l−m−t)]] = 0 (88)

can be written as three patches of the forms

x1(θ, ϕ) = (A+ B) sinϕ cosθ (89)

y1(θ, ϕ) = (A+ B) sinϕ sinθ (90)

z1(θ, ϕ) = (A+ B) cosϕ (91)

Page 20: Conversions between Parametric and Implicit Forms Using ... · Although the parametric formulation is useful for tracing, rendering, and surface fitting, many operations such as

20 UNSALAN AND ERCIL

x2(θ, ϕ) =(− A+ B

2+ A− B

2

√−3

)sinϕ cosθ (92)

y2(θ, ϕ) =(− A+ B

2+ A− B

2

√−3

)sinϕ sinθ (93)

z2(θ, ϕ) =(− A+ B

2+ A− B

2

√−3

)cosϕ (94)

x3(θ, ϕ) =(− A+ B

2− A− B

2

√−3

)sinϕ cosθ (95)

y3(θ, ϕ) =(− A+ B

2− A− B

2

√−3

)sinϕ sinθ (96)

z3(θ, ϕ) =(− A+ B

2− A− B

2

√−3

)cosϕ, (97)

where

A = 3

√−b

2+√

b2

4+ a3

27(98)

B = 3

√−b

2−√

b2

4+ a3

27(99)

a = 1

3

(3

q

s− p2

s2

)(100)

b = 1

27

(2

p3

s3− 9

pq

s2+ 27

u

s

). (101)

s, p, q are defined in Eqs.(85)–(87).

u =n−3∑m=0

[am3α

my(n−3−m) + bm3αmγ (n−3−m) + cm3β

mγ (n−3−m)]

+n−3∑m=1

n−3∑t=1

[dmt3α

mβ tγ (n−3−m−t)], (102)

andα, β, γ are defined in Eqs.(74)–(76).Parameter values to obtain real-valued patches specify parameter ranges.

LEMMA 10. A polynomial of the form

4∑l=0

[n−l∑m=0

[amlx

my(n−l−m) + bmlxmz(n−l−m) + cml y

mz(n−l−m)]

+n−l∑m=1

n−l∑t=1

[dmtlx

myt z(n−l−m−t)]] = 0 (103)

can be written as four patches of the forms

x1(θ, ϕ) =(− p

4s+ R

2+ D

2

)sinϕ cosθ (104)

Page 21: Conversions between Parametric and Implicit Forms Using ... · Although the parametric formulation is useful for tracing, rendering, and surface fitting, many operations such as

PARAMETRIC AND IMPLICIT FORM CONVERSION 21

y1(θ, ϕ) =(− p

4s+ R

2+ D

2

)sinϕ sinθ (105)

z1(θ, ϕ) =(− p

4s+ R

2+ D

2

)cosϕ (106)

x2(θ, ϕ) =(− p

4s+ R

2− D

2

)sinϕ cosθ (107)

y2(θ, ϕ) =(− p

4s+ R

2− D

2

)sinϕ sinθ (108)

z2(θ, ϕ) =(− p

4s+ R

2− D

2

)cosϕ (109)

x3(θ, ϕ) =(− p

4s+ R

2+ E

2

)sinϕ cosθ (110)

y3(θ, ϕ) =(− p

4s+ R

2+ E

2

)sinϕ sinθ (111)

z3(θ, ϕ) =(− p

4s+ R

2+ E

2

)cosϕ (112)

x4(θ, ϕ) =(− p

4s+ R

2− E

2

)sinϕ cosθ (113)

y4(θ, ϕ) =(− p

4s+ R

2− E

2

)sinϕ sinθ (114)

z4(θ, ϕ) =(− p

4s+ R

2− E

2

)cosϕ. (115)

Let o be any root of the equation

o3− q

so2+

(pu

s2− 4v

)o− p2v

s3+ 4

qv

s2− u2

s2= 0; (116)

then

R =√

p

4s− q

s+ o (117)

D =√

3p2

4s2− R2− 2

q

s+ 4pqs− 8us2− p3

4s3R(118)

E =√

3p2

4s2− R2− 2

q

s− 4pqs− 8us2− p3

4s3R. (119)

s, p, q are defined in Eqs.(85)–(87);u is defined in Eq.(97);and

v =n−4∑m=0

[am4α

my(n−4−m) + bm4αmγ (n−4−m) + cm4β

mγ (n−4−m)]

+n−4∑m=1

n−4∑t=1

[dmt4α

mβ tγ (n−4−m−t)]. (120)

α, β, γ are defined in Eqs.(74)–(76).Parameter values to obtain real-valued patches specify parameter ranges.

Page 22: Conversions between Parametric and Implicit Forms Using ... · Although the parametric formulation is useful for tracing, rendering, and surface fitting, many operations such as

22 UNSALAN AND ERCIL

THEOREM 6 (Conversion in 3D). Exact parametric patch representations for implicitpolynomials up to degree 4 can be obtained by representing them in spherical coordinatesand solving the corresponding equation to obtain R(θ, ϕ).

Proof. See Lemmas 7–10.j

THEOREM7 (Conversion from Intersecting Implicit Surface Representation to ParametricSpace Curve Representation).Letα be a space curve in<3 defined by the intersection oftwo implicit surfaces as f(x, y, z) = 0, g(x, y, z) = 0. α can be converted to a parametricspace curve, α: (a, b)→ <3, withα(t) = (h(t), g(t), k(t)), where(a, b) is an open intervalin <, if an explicit relationship can be established betweenθ andϕ.

Proof. The implicit polynomials f (x, y, z) = 0, g(x, y, z) = 0 can be represented inspherical coordinates asf (R, θ, ϕ) = 0, g(R, θ, ϕ) = 0. For each of these equalitiesR canbe obtained by solving theR polynomial as in the previous lemmas.

Let R= F(θ, ϕ) and R= G(θ, ϕ) be obtained from these two implicit polynomials.Since the space curve lies on both of the implicit surfaces,Rvalues that are the same for thesetwo implicit surfaces represent this space curve. So we can writeR= F(θ, ϕ) = G(θ, ϕ).If an explicit relationship can be established betweenθ andϕ, asθ = m(ϕ) or ϕ = n(θ ),then a parametric space curve is obtained from the standard change of variable formulasgiven in Eqs. (12)–(15) as follows:

Assume that there is a relationship s.t.ϕ = n(θ ). Then

h(θ ) = Rcosθ sin(n(θ )) g(θ ) = Rsinθ sin(n(θ )) k(θ ) = Rcos(n(θ )),

where

R= F(θ, n(θ )) or R= G(θ, n(θ )).

The same derivation can be done forθ = m(ϕ). j

Implicit polynomials which define the space curve may yield simpler solutions as in thefollowing example. In this example, an explicit relationship is not searched for sinceR canbe found such that a space curve is obtained easily.

EXAMPLE 11. Let the two implicit polynomials plotted in Fig. 8,x2+ y2 = 1 andz=y5, represent a space curve. Convertingx2+ y2 = 1 into spherical form givesR2(cos2 θ +sin2 θ ) sin2 ϕ = 1. Solving the above equation forR,

R= 1

sinϕ,

we obtain the parametric space curveα: (0, 2π )→ <3 α(t) = (h(t), g(t), k(t)), h(t) = cost,g(t) = sint, k(t) = sin5 t , which is plotted in red on the original implicit surfaces given inFig. 13. It is seen thatα(t) actually lies in the intersection region.

4. INSPECTION BY IMPLICIT POLYNOMIALS IN 3D

In this section, the theorems introduced in the previous section are applied to a real-worldapplication, automated tolerance inspection by implicit polynomials in 3D. It is assumedthat the object to be inspected is represented as an implicit polynomial form. The followingtheorem is given to inspect whether a given point is inside the tolerance values or not. Moreinformation about this method can be found in [15].

Page 23: Conversions between Parametric and Implicit Forms Using ... · Although the parametric formulation is useful for tracing, rendering, and surface fitting, many operations such as

PARAMETRIC AND IMPLICIT FORM CONVERSION 23

THEOREM 8 (Inspection by Implicit Polynomial Representations).Given a toleranceband±d and an object having an implicit polynomial model f(x, y, z) = 0, to observewhether a point (x1, y1, z1) is inside tolerances, it is sufficient to check the existence ofa real-valued space curve defined by two implicit polynomials, f (x, y, z) = 0 and (x −x1)2+ (y− y1)2+ (z− z1)2 = d2.

EXAMPLE 12. In this example, a simple model for water pipe in implicit polynomialform, x2+ y2 = 1, is given. We will illustrate the technique for inspecting a single point(0.8, 0.6, 0). The tolerance value is taken as±0.1. The water pipe model and the point areplotted in Fig. 14.

The space curve in implicit polynomial form for inspection is given as

x2+ y2+ z2 = 0.12

(x − 0.8)2+ (y− 0.6)2 = 1.

Converting the space curve to parametric form gives

R = 1.6 cosθ + 1.2 sinθ

sinϕor R= 0.

h(θ ) = (1.6 cosθ + 1.2 sinθ ) cosθ

g(θ ) = (1.6 cosθ + 1.2 sinθ ) sinθ

k(θ ) =√

0.12− (1.6 cosθ + 1.2 sinθ )2

θ ∈ (0.6888, 0.7205555)∪ (0.6888+ π, 0.7205555+ π ).

There exists at least one realθ value such that the space curve exists. So the point is insidethe tolerances.

5. CONCLUSIONS

In this paper, a new method is introduced for conversions between parametric and im-plicit forms based on polar/spherical coordinate representations of an object boundary. Theparametric-to-implicit conversions are carried out for star-shaped objects in 2D and 3D.Theorems in the paper give methods to convert parametric representations to implicit rep-resentations in a direct way. The only requirement is to obtain an invertible slope function.The implicit-to-parametric conversions are carried out exactly for implicit polynomials upto degree 4 or for polynomials that are sums of up to five homogeneous polynomials in2D and 3D. The conversion is done approximately for higher degree polynomials in 2Dsince there exists no method for solving polynomials of order greater than 4. The methodsare applied to an automated tolerance inspection problem for demonstration of a real-lifeapplication of the techniques developed.

6. APPENDIX A

We can represent cosnθ and sinnθ for any integern, from recursive calculations startingfrom cos 2θ and sin 2θ as:

Page 24: Conversions between Parametric and Implicit Forms Using ... · Although the parametric formulation is useful for tracing, rendering, and surface fitting, many operations such as

24 UNSALAN AND ERCIL

For cosine terms:

cos 2θ = cos2 θ − sin2 θ (1)

cos 3θ = cos3 θ − 3 sin2 θ cosθ (2)

cos 4θ = cos4 θ − 6 sin2 θ cos2 θ + sin4 θ (3)

. . .

For sine terms:

sin 2θ = 2 sinθ cosθ (4)

sin 3θ = 3 sinθ cos2 θ − sin3 θ (5)

sin 4θ = 4 sinθ cos3 θ − 4 cosθ sin3 θ (6). . .

7. APPENDIX B

We construct an implicit polynomial form in 2D forn = 3:

r = a0+3∑

n=1

an cosnθ + bn sinnθ

r = a0+ a1 cosθ + b1 sinθ + a2 cos 2θ + b2 sin 2θ + a3 cos 3θ + b3 sin 3θ

r = a0+ a1 cosθ + b1 sinθ + a2(cos2 θ − sin2θ )+ b22 sinθ cosθ

+a3(cos3 θ − 3 cosθ sin2 θ + b3(3 sinθ cos2 θ − sin3 θ )

r = a0+ a1x + b1y

r+ a2x2+ b22xy− a2y2

r 2+ a3x3+ b33x2y− a33xy2− b3y3

r 3

r = a0+ (x + y)⊗ C1

r+ (x + y)2⊗ C2

r 2+ (x + y)3⊗ C3

r 3.

The final implicit function form is obtained as

(x2+ y2)1/2 =3∑

n=0

Kn

(x2+ y2)n/2,

whereKn = (x + y)n ⊗ Cn andK0 = a0. The above equation can be converted to implicitpolynomial form as

(x2+ y2)1/2 = K0+ K1

(x2+ y2)1/2+ K2

(x2+ y2)+ K3

(x2+ y2)3/2

((x2+ y2)2− K1(x2+ y2)− K3)2 = (x2+ y2)(K0(x2+ y2)+ K2)2.

ACKNOWLEDGMENTS

This study is partially supported by NSF Grant NSF—465, Tubitak Grant MISAG—116, Bogazi¸ci UniversityResearch Grant 99A0301, and EUREKA 1770 Project.

Page 25: Conversions between Parametric and Implicit Forms Using ... · Although the parametric formulation is useful for tracing, rendering, and surface fitting, many operations such as

PARAMETRIC AND IMPLICIT FORM CONVERSION 25

REFERENCES

1. W. H. Beyer,CRC Standard Mathematical Tables, CRC Press, Boca Raton, FL, 1979.

2. J. Bloomenthal, Ed.,Introduction to Implicit Surfaces, Morgan Kaufmann, San Francisco, 1995.

3. H. Civi, C. Christopher, and A. Er¸cil, The Classical Theory of Invariants and Object Recognition usingAlgebraic Curves and Surfaces, Technical Report FBE–IE–06/97–07, Bo˘gazici University, 1997.

4. M. Hebert, J. Ponce, T. Boult, and A. Gross, Eds.,Object Representation in Computer Vision, Lecture Notesin Computer Science. Springer-Verlag, Berlin/New York, 1995.

5. C. Hoffman,Geometric and Solid Modeling: An Introduction, Morgan Kauffman, San Francisco, 1989.

6. C. Hoffman, Implicit curves and surfaces in computer-aided geometric design,IEEE Comput. Graph. Appl.13(1), 1993, 79–88.

7. D. Manocha and J. F. Canny, Implicit representation of rational parametric surfaces,J. Symbol. Comput.13,1992, 485–510.

8. G. M. Nielson, GAGD’s top ten: What to watch,IEEE Comput. Graph. Appl.1993, 35–37.

9. G. A. Salmon,Treatise on the Algebraic Geometry of Three Dimensions(R. Rogers, Ed.), Vols. 1 and 2,Chelsea, New York, 1914. [Reprint]

10. T. W. Sederberg, Techniques for cubic algebraic surfaces, Part one,IEEE Comput. Graph. Appl.10(4), 1990,14–25.

11. T. W. Sederberg, Techniques for cubic algebraic surfaces, Part two,IEEE Comput. Graph. Appl.1990, 12–21.

12. T. W. Sederberg, D. C. Anderson, and R. N. Goldman, Implicit representation of parametric curves andsurfaces,Comput. Vision Graph. Image Process.1984, 72–84.

13. J. Subrahmonia, D. Cooper, and D. Keren,Practical Reliable Bayesian Recognition of 2D and 3D ObjectsUsing Implicit Polynomials and Algebraic Invariants, Technical Report LEMS–107, Division of Engineering,Brown University, June 1992.

14. G. Taubin and D. B. Cooper,Recognition and Positioning of 3D Piecewise Algebraic Objects Using EuclideanInvariants, IBM Research Division, T.J. Watson Research Center, 1990.

15. C. Unsalan and A. Ercil, Automated tolerance inspection by implicit polynomials, inProceedings of ICIAP99 10th International Conference on Image Analysis and Processing Image-Based Emerging Applications,Venice, 1999, pp. 1218–1225.

16. M. Yalniz, Algebraic Invariants for Implicit Polynomials. Case Study: Patterns in Turkish Hand-WovenCarpets, M.S. thesis, Bogazi¸ci University, Turkey.