Apollonius meets Pythagoras1

Ching-Shoei Chiang* and Christoph M. Hoffmann† * Soochow University, Taipei, Taipei, R.O.C. E-mail: [email protected] Tel/Fax: +886-2-2311-1531 ext. 3801 † Purdue University, West Lafayette, IN 47906, USA E-mail: [email protected] Tel: 1-765-494-6185

Abstract—Cyclographic maps are an important tool in rational Bézier . Section 4 illustrates the Apollonius Laguerre that can be used to solve the problem of problem of 3 primitives, including ray, cycle, and oriented PH Apollonius. The cyclographic map of a planar boundary curve is curve. We conclude with results in the final section. a ruled that we call -map. A PH curve is a free form curve whose tangent and normal are polynomial. This implies that its cyclographic map has a parametric form. This paper considers the medial axis transform (MAT) of a PH curve with a II. DEFINITIONS AND THEOREMS ray and the MAT of a PH curve with a cycle. We transform the Pythagorean Hodograph(PH) has a property that is closely MAT finding problem into a surface intersection problem. Here, linked to the its cyclographic map. If a 2D curve has the PH the intersection curve is representable in rational Bezier form. property, that is, if its tangent is a polynomial, then the Furthermore, the generalized Apollonius problem concerning rays, cycles, and oriented PH is introduced. cyclographic map for the curve has a polynomial form. We define some key terms now, including the Pythagorean Hodograph curve and the cyclographic map. I. INTRODUCTION A. Planar PH boundary Cyclographic maps are widely used in CAGD and other areas The hodograph of a parametric curve is the locus described [3,12]. They were developed in classical Descriptive by the first derivatives of the curve. If the hodograph Geometry[10] and used to solve the problem of Apollonius, x'(t) x(t) and, more generally, as a device for studying distance maps, r'(t)    of a curve r(t)    satisfies  y'(t) y(t) surface curvature, and other basic geometric properties. 2 2 2 Cyclographic maps for a planar PH curve have a parametric  (t)  x (t)  y (t) where  (t) is a polynomial, then r(t) is representation. However, the shape of a PH curve is not so a Pythagorean Hodograph curve (PH curve) [5]. The PH easy to imagine given its parameter values. In past work, curve has many properties such as: polynomial arc length, cyclographic maps have been approximated using Hermite rational offset and rational curvature. interpolation to the resulting PH curve [22,23,24]. Here, we consider instead one curve -- with a relatively high degree. To Definition 1:[7] (Complex representation) construct the degree 2n-1 PH curve, we can choose n control A PH curve in the complex plane is a complex valued points freely, but must derive the remaining n-1 control polynomial curve of the form r(t)  x(t)  iy(t) There must points[1], the up to n+1 additional control points can also be exist a complex polynomial (t)  u(t)  iv(t) , with obtained by some natural restrictions on data set[16]. After gcdu(t),v(t)  1 , such that the hodograph is finding the parametric form of a PH curve, we can derive the 2 2 2 Cyclographic map for it, considering the curve to bound a r(t)   (t)  u (t)  v (t)  i2u(t)v(t) . planar region. In this article, we employ the cyclographic  maps for PH boundaries and transform finding the MAT of Although the hodograph is defined in the complex plane, we the region into a surface/surface intersection problem. We can map the real and imaginary parts into the Cartesian x and also solve how to find the MAT of a PH curve with a ray and y coordinates, respectively. the MAT of a PH curve with a cycle. x(t) Thus, for a PH curve r(t)    , the hodograph can be y(t) The material is presented in 5 sections. Section 1 describes u 2 (t)  v2 (t) the purpose of this paper. Section 2 states some definitions represented as r'(t)    , such that the polynomial and theorems that have been derived by others, and that are  2u(t)v(t)  useful for this paper. Section 3 derives the theorems needed 2 for solving the MAT for a PH curve with a ray or cycle,  (t)  u2 (t)  v2 (t)  2u(t)v(t) 2  u2 (t)  v2 (t) . showing that the intersection curve representing the MAT is a

1 Work supported in part by NSC Grant NSC 97-2212-E-031-002, NSF CPATH CCF-0722210, and DOE DE-FG52-06NA26290. The following is straightforward. Definition 2: (The -maps for a Ray) [13] An oriented is called a ray. For a ray L: Ax+By+D=0 in

the xy-plane, the vector (A,B) is the normal vector on the left Theorem 1: (σ(t), x (t) and y (t) in Bézier form) [1] hand side of the ray, so the orientation of the ray is thereby Given two polynomial u(t) and v(t) of degree μ in Bernstein- assigned. The -map of the ray L is the plane (L):   Ax  By  A2  B2 z  D  0 and is a plane in 3-space. Bézier form as u(t)  B (t)u and v(t)  B (t)v , we can  i i  i i  i0 i0 construct the hodograph for a PH curve Definition 3: (The -maps for a Cycle) [13] An oriented is called a cycle. For a cycle 2 2 x(t) u (t)  v (t) 2 2 2 2 2      ,  (t)  u (t)  v (t) . Then we can find c: (x  a)  ( y  b)  r in the xy-plane, r is called the y(t) 2u(t)v(t)     oriented radius. If r>0, the cycle is counterclockwise, and 2 2 2 clockwise for r < 0. The -map of the cycle c is the cone (c):  (t)  B2 (t)H , x(t)  B2 (t)I , y(t)  B2 (t)J .  k k  k k  k k (x  a)2  (y  b)2  (z  r)2  0 in 3-space. k0 k0 k0  Let the control points for σ(t), x(t) and y(t) be Hk, Ik and Jk respectively: For a ray L in the xy-plane, (L) is a plane which inclined 45 k degrees to the xy-plane, through L. For a cycle c in the xy- , plane, (c) is a right circular cone whose generators are Hk  i,ki (uiuki  vivki ) , k=0…2μ i0 inclined 45 degrees to the xy-plane. (see figure 1a) k I   , (u u  v v ) , k=0…2μ k  i,k i i k i i k i i0 k J   , (u v  v u ) , k=0…2μ k  i,k i i k i i k i i0 (a) (c) (b) (B(t)) C mC n Figure 1 : The -maps for the 2D boundary where  m,n  i j , if i<0 or j<0,  n,m  0 i, j mn i, j Ci j Definition 4: (Rotated normal vector fields of PH  boundary) [3] Theorem 2: (PH curve in Bézier form) [1] X (t) 2   2 I k  For a 2D PH boundary B(t)  Y (t)  in the xy-plane, the For the hodograph r(t)  B (t)  in Theorem 1, the  k J  0  k0  k    corresponding PH curve is a polynomial curve of degree orientation is induced by the parameterization. The normal  2 1 . Given the point p0, we can construct the PH curve in Y (t)   2 1 vector field on the left hand side is  X (t)  . Because of Bernstein Bézier form: B(t)  B2 1(t) p , the control    i i  0  i0 Y (t) points pk are: 2 2    (t)  X  (t) Y  (t) , the vector field V (t)   X (t)  is 1 Ik  pk1  pk    , for k = 0... 2   (t)  2 1 J k  inclined 45 degrees to the xy-plane. We call V(t) the rotated  normal vector field of B(t). B. Cyclographic maps  Cyclographic maps have been used since 1929 till now Theorem 3: (Rotated normal vector fields in Bézier form) [10,11,12,13]. The Apollonius problem for three is to According to Theorem 1, given two polynomial u(t) and v(t) find the 8 tangent circles to these three circles. When the three of degree μ, we can derive the rotated normal vector field of a 2 circles are oriented, we can divide the Apollonius problem PH curve in Bernstein Bézier form as: V (t)  B2 (t)q . into 4 sub-problems, and each determining two tangent  k k circles[25,26]. Using a similar approach, we want to solve the k0 Apollonius problem for three geometric entities chosen from The control points qk are: lines, circles, and PH curves. In this paper, we treat lines, J k    circles, and PH curves as rays (oriented lines), cycles qk   I k  , for k = 0... 2 (oriented circles) and oriented PH curves. We also call the  H k  cyclographic map of an entity the r-map of the entity. 

The B(t) and V(t) of Definition 4 define a ruled surface C. The intersection of a ruled surface and a plane S(s,t)=B(t)+sV(t) which has inclination of 45 degrees The problem (a) “The one sided offset curve of a PH curve” with xy-plane. The ruled surface is the r-map for B(t) with and the problem (b) “The MAT of a PH curve and a ray” are formula(see figure 1b)[3]: about the intersection of the PH curve’s -map intersect with a plane. The intersection curve of a ruled surface with a plane x(t)  sy(t)  can be represented precisely by a set of Bezier control points.     B(t)  B(t)  sV (t)   y(t)  sx (t)   s (t)  Theorem 4: (Ruled surface and plane intersection) [2] Assume that the ruled surface S(s,t)  B(t)  sV (t) has the . n base curve B(t)  Bn (t) p and ruling vectors   i i i0 For a planar PH curve B(t) on the Z=0 plane, every point m (x,y,z) on the rotated normal vector of B(t) is associated with m that are Bézier curves of degree n and m and V t   Bi (t)qi a cycle tangent to B(t) on the Z=0 plane that is compatibly i0 oriented with the curve orientation. In particular, the oriented which have the control points pi, i=0…n, and qi, i=0…m. The tangent and B(t) must have the same orientation at the point of intersection curve of the ruled surface and the plane tangency. If two oriented planar curves are tangent, consistent Ax  By  Cz  D  0 is a rational Bézier curve with the orientation, they must share the same rotated normal mn vector at the tangent point. Bmn (t)r w  k k k C(t)  k 0 of degree m+n. Furthermore, the The cyclographic map for a set of 2D boundaries is a set of mn mn ruled surfaces. We can find the Medial Axis Transform (MAT)  Bk (t)wk of those boundaries by restricting the ruled -map surfaces the k 0 segments of the generators between the z=0 plane and the first weights wk and the control points rk for the intersection curve self-intersection of the surface. Then the end points of the are: k rotated normal vectors are points on the MAT of    m,n boundaries[3,13]. If we discard the self-intersection condition, wk  i,k i (n  qi )   i0 then the MAT for a PH curve B(t) with a ray can be found by  k  intersecting a ruled surface and a plane; the MAT for a PH      n   p    m,n   k i   curve B(t) with a cycle similarly can be transformed to the i,k i (n  qi ) pk i       qi     D 1   i0        problem of intersecting a ruled surface and a cone. rk   wk  III. THE APPLICATION OF THE PH CURVE’S -MAP where n is the normal for the intersecting plane, the ’  ’ is the inner product of vectors. In this section the theorems are derived that are used for the three types of applications of the PH curve’s -map, namely: Proof: Substitute the parametric form of the PH curves’ r-map into (a) The one sided offset curve of a PH curve the implicit form of the ray’s r-map. This yields (b) The MAT of a PH curve and a ray   n  B(t)  sV (t)  (c) The MAT of a PH curve and a cycle       0 where n is the normal of the plane. We D  1   Problem (a) will be reduced to intersecting the PH curve’s -  n  B(t)      map with a plane z = r, where r is the offset distance. Problem D  1  can factor out s    . So, the intersection curve is: (b) will be reduced to the intersection of the PH curve’s -map n V (t)  the ray’s -map. Problem (c) will be reduced to the   n  B(t) intersection of the PH curve’s -map with the cycle’s -map. n V (t) B(t)      V (t) D  1  C(t)  B(t)  sV (t)   We develop the intersection of a ruled surface and a plane in n V (t) Theorem 4, and this is the key to solving problems (a) and (b). Notice that the denominator and numerator have degrees m Theorem 5 is about the intersection of a PH curve’s -map and m+n, respectively. The numerator has the product of two and an implicit cone x2+y2–(z–r)2=0. This cone is the -map Bezier curves of degree m and n. By algebra, the numerator becomes: of a cycle whose center is the origin (0,0). For problems mn k  where the cycle is not centered at the origin, we translate the      n   p   Bmn (t)  m,n (n  q ) p    ki q  cycle and PH curve first, find the intersection curve’s control k  i,k i  i ki      i     D  1   points, and finally apply the inverse translation to the control k00 i  points, moving them back to the position solving the original We would like to have the same degree for numerator and problem. denominator, so that the weight of the rational Bezier curve can be derived. For this, we need to do degree elevation of the same B(t) = (0,0,0), but the different ruled vector field denominator. Assume V(t) and V(t)(n) are the same Bezier 2 (n)  2   curve with degree m and m+n respectively. That is, V(t) is V (t)  Bi (t)qi whose control points are q0  (0,1,1) , the n-th degree elevation of V(t). Let the control points for V(t) i0 (n) (n) and V(t) be qi, i=0,..,m, and qk , k=0,..,m+n, then we have:  1 1 1  q1  ( , , ) , q2  (1,0,1) . k 2 2 2 q (n)   m,n q , k=0,..,m+n k  i,ki i i0 So the denominator becomes: mn k    Bmn (t)  m,n (n q ) k  i,k i i  k 00 i 

From the numerator and denominator, the weights and control   points of the Bezier curve are then: (a) cone for V (t) (b) cone for V (t) k Figure 2 : The right circular cone K   w   m,n (n  q ) k  i,k i i  C  (t) C  (t) +  i0 Let and be the intersection curve of K and the  -  k    plane, K and the plane respectively. By theorem 4, we have: m,n    n   pk i    (n  q ) p    q  2 2  i,k i  i k i      i     D  1   B2 (t)r w B2 (t)r w r  i0  k k k  k k k k  k 0  k 0  wk C (t)  , C (t)  …(1)  2 2 2  2    Bk (t)wk  Bk (t)wk k 0 k 0 Example: The conic sections can be derived from the The intersection of the plane I and the cone K produces a intersection of a cone with a plane. A cone is a ruled surface, circle, ellipse, parabola, hyperbola, depending on the angle so we can find the control points of conic section by using between the z-axis and the normal of the plane. Table 1 lists 4 theorem 4. different normal direction of plane I that produce different

results. For example, consider the second column of Table 1; Let I be a plane passing through the point (1,1,1) with the plane I is the plane passing through (1,1,1) with normal normal (a,b,c), and let  be the angle between (a,b,c) and z- (0,0,1), so the implicit form for plane I is z–1=0. The  axis, which is the axis of the cone, where 0    . Consider intersection of the quarter cone C  (t) with the plane I 2  the intersection of the right circular cone K, with apex angle produces a rational Bezier curve whose weights are w0 =1, /2, and the plane I; then the intersection curve is one of the  1  w1 = , w2 =1, and whose control points are following [14]: 2 (a) A circle if   0 . r  = (1,0,1), r  = (1,1,1). r  = (0,1,1). The associated picture  0 1 2 (b) An ellipse if 0    . 4 is shown in Figure 3 a. The weights and control points of the  intersection C  (t) are also listed with the associated picture (c) A parabola if   . 4 in Figure 3b.   (d) A hyperbola if    the normal incline with the 4 2 The circle and the ellipse arise when the intersection of cone Z=0 plane K and plane I is a closed curve. But the parabola and the   hyperbola are not closed and have point(s) at infinity for some  c  Notice that the angle   arccos .   2 2 2  particular t value(s). Consider the equation C (t) in (1). What  a  b  c  happens when the parameter t approaches the root of the

 In the following instances, we want to intersect the plane I with denominator=0? On this case, the value for the curve C (t) the cone K, where the cone K is constructed by two ruled approaches infinity. The denominator is always greater than 0 surfaces, call them K+ and K-. The quarter of the right circular for the circle and the ellipse as seen in Table 1. However, + cone K is constructed from the vertex B(t) = (0,0,0), and the when t=0.5, the curve C  (t) goes to infinity for the parabolic 2 case. It is similar to the hyperbolic case when t approaches ruled vector field V  (t)  B2 (t)q , whose control points are  i i 1 1 i0 t  and t 1 . 2 2   1 1 1  q0  (1,0,1) , q1  ( , , ) , q2  (0,1,1) ; The other three The direction of the parameter is indicated by the arrows in 2 2 2  quarters of the right circular cone K- are constructed from the Figures 3 (a-h). For the hyperbola C (t) , the intersection   starts from r0 =(0,2,2), t=0. C (t) goes to the upper right 1 corner until the first C  (t)   , t 1 . Then the 2 C  (t) appears at the lower left corner and go to the lower 1 right corner until the second C  (t)   , t  . Then 2

    C (t) appears at the upper left corner and ends at r2 . (c) ellipse C (t) (d) ellipse C (t)

Table 1: The conic section generated by the intersection of the cone K and plane I Circle Ellipse Parabola Hyperbola Fig.3 a,b c,d e,f g,h normal (0,0,1) (1,1,3) (1,1, 2 ) (1,1,0) plane I x  y  3z x  y  2z passing z 1  0 x  y  2  0 (1,1,1)  4  0  2  2  0 (e) parabola C  (t) (f) parabola C  (t)  w0 1 4 1 2 1 1 5 w 1 2 2 1 2 2  w2 1 4 1 2 1 5 5 r  (1,0,1) ( ,0, ) ( 2,0, 2) (2,0,2) 0 4 4  r1 (1,1,1) (1,1,1) (1,1,1) (1,1,1)

 5 5 r2 (0,1,1) (0, , ) (0, 2, 2) (0,2,2) 4 4 (g) hyperbola C  (t) (h) hyperbola C  (t)  w0 1 4 1 2 1 Figure 3: Conic sections generated by the intersection 1 5 of the cone K and the plane I w 1 2  2 1 2 2  When the PH curve’s -map is intersected with a plane z=r, w2 1 4 1 2 1 the intersection curve is the r-offset of the PH curve. When 5 5 r  (0,1,1) (0, , ) (0, 2, 2) (0,2,2) the PH curve’s -map is intersected with a plane which 0 4 4 inclines 45 degrees with xy-plane, the intersection curve is the  r1 (1,1,1) (1,1,1) (1,1,1) (1,1,1) MAT of the PH curve with a ray whose -map is the inclined 5 5 plane. r  (1,0,1) ( ,0, ) ( 2,0, 2) (2,0,2) 2 4 4 D. The intersection of the PH curve’s -map with a cone 1 2 2 2 t  x +y –(z+r) =0  C (t) 1 2 The MAT of a cycle x2+y2 –r2=0 and a PH curve is the none none t  1 =  2 t 1 intersection curve of an implicit cone x2+y2–(z+r)2=0 and the 2 -map of a PH curve. We have the following theorem for the intersection.

Theorem 5: (the intersection of an implicit cone x2+y2– (z+r)2=0 and the -maps of a PH curve) Consider a ruled surface S(s,t)=B(t)+sV(t) whose base curve n n is a planar PH curve in the xy-plane, in B(t)   Bi (t) pi i0

Bézier form of degree n, with control points pi, i=0,…,n. (a) circle C (t) (b) circle C  (t) n1 So the intersection curve is: n1 Assume that the ruled vector field V t  Bi (t)qi is the E(t) D(t)B(t)  E(t)V (t) N(t)  C(t)  B(t)  V (t)   i0 D(t) D(t) D(t) rotated normal vector field of B(t). Let the control points for D(t) is a 1D polynomial of degree 2n–1, the control points of V(t) be qi, i=0,…,n–1. By theorems 1 to 3, qi can be derived D(t) are bk, k=0,…,2n–1: from B(t). Then the xyz components of the ruled vector field  x   x  n pi n1 qi 2n1 x 2 y 2 z 2     form the Pythagorean triple V (t)  V (t)  V (t) (the D(t)   2 Bn (t) p y Bm (t) q y  B2n1(t)b  i  i  i  i   k k superscript xyz designates the xyz components). Moreover, i0  r  i0 q z  k 0 the ruled surface intersects the implicit cone    i  x2  y2  (z  r)2  0 in the rational Bézier curve  p x  q x  2n1 k  i   k i  3n1 2n1 n,n1 y y  Bi (t)   2  pi   q  3n1 i,k i k i Bk (t)rk wk k 00i  r  q z      k i  C(t)  k0 of degree 3n–1, with the weights w 3n1 k  x   x  3n1 k pi qk i Bk (t)wk n,n1  y   y   bk  i,k i  2  pi   qk i  , k=0,…, 2n–1, k0    i0    z  r qk i and the control points rk described by:      (n) N(t) is a 3D polynomial curve of degree 3n–1. We would like wk  b  k to have the same degree for N(t) and D(t), so the weights of  k  2n1,n 2n,n1 – the rational Bezier curve can be derived. We need to do  i,k i bi pk i i,k i ci qk i , k=0,…,3n 1, (n)   degree elevation for the D(t). Assume D(t) and D(t) are the r  i0  k (n) same Bezier curve with degree 2n–1 and 3n–1 respectively.  b  k That is, D(t)(n) is the n-th degree elevation of D(t). Let the x x (n) (n)  p  q  control points for D(t) and D(t) be bj, j=0,.., 2n–1, and bk , k  i   k i  n,n1 y y k=0,.., 3n–1, then we have: bk  i,k i  2  pi   qk i  , k=0,…, 2n–1,  2n1 i0  r  q z     k i  b (n)   2n1,nb , k=0,.., 3n–1 k  j,k j j  x   x  j0 k pi pk i     (n) n,n y y Hence we can derive the weights wk=bk for the rational ck    pi    p  , k=0,…,2n,  i,k i k i Bezier curve: i0  r    r       x   x  2n1 j pi q ji  x   x      2n1 j pi q ji (n) 2n1,n n,n1 y y     wk  bk   j,k j i, ji  2  pi   q ji  ,k=0,..,3n–1 b (n)   2n1,n n,n1  2 p y  q y  , k=0,…, 3n–1,    k j,k j i, ji  i  ji j00i  r  z      q ji  j00i  r  z       q ji    E(t) is a 1D polynomial of degree 2n, the control points of E(t) are c , k=0,…,2n: Proof: k  p x   p x  Let the implicit cone be Kx, y, z : x2  y2  (z  r)2  0 . For n  i  n  i  E(t)  Bn (t) p y  Bn (t) p y the intersection curve C(t), we substitute the ruled surface i  i  i  i  i00 r  i  r with parametric form S(s,t) = B(t)  sV (t) into the implicit     equation of the cone Kx, y, z , so the intersection curve can  x   x  2n k pi pk i be represented by: 2n n,n  y   y   Bk (t) i,k i  pi    pk i  2 2 2  B x (t)  sV x (t)  B y (t)  sV y (t)  sV z (t)  r  0 k 00i  r    r       x 2 y 2 z 2 Because of V (t)  V (t)  V (t) , the coefficient of the  p x   p x  2 k i k i term s can be eliminated. So we can express s and the n,n  y   y  ck  i,k i  pi    pk i  , k=0,…,2n intersection curve C(t) as follows:      i0  r    r  B x (t) B x (t)      y   y  N(t) is composed by two Bézier curves D(t)B(t) and E(t)V(t) B (t)  B (t)     of degree 3n–1:  r    r  E(t) s       2n1 n 2n n1 x x 2n1 n 2n n1 B (t) V (t) D(t) N(t)   Bk (t)bk Bi (t) pi   Bk (t)ck Bi (t)qi  y   y  k 0 i0 k 0 i0  2 B (t)  V (t)  r  V z (t)     3n1 k curves will remain the same for different r-offsets. The   2n1,nb p  2n,n1c q i,k i i k i i,k i i k i associated control points for r value are listed in Table 2. k 00i Hence we can derive the intersection curve C(t) as: The minimum osculating circle radius for B(t) (Figure 4a) is 3n1 k 12.6. When r<12.6, the offset curve has no self-intersection B3n1(t)  2n1,nb p  2n,n1c q k i,ki i ki i,ki i ki (Figure 4b); when r=12.6 (Figure 4c), the offset curve has one C(t)  k00i cusp; when r>12.6(Figure 4d), the offset curve has self- 3n1 intersection and it has two cusps. B3n1(t)b(n)  k k k0

The control points rk and weights wk of C(t) are:

w  b(n)  k k  k  2n1,n 2n,n1 , k=0,…, 3n–1,  i,k i bi pk i i,k i ci qk i   r  i0  k (n)  bk 

The untrimmed offset curves of a 2D PH curve have been (a) the PH curve B(t) (b) r=3 offset investigated by others. They use the envelope of a one parameter family of circles [20] or lines [17] to generate the equation for the offset curves. We use the cyclographic map of the PH curve, intersected with the z=r plane, and generate the equivalent results.

We give examples below. Example 1 is about the offset curve of a PH curve. Example 2 is about the MAT of a PH curve and a ray. Example 3 is about the MAT of a PH curve and a cycle. (c) r=12.6 offset (d) r=15 offset

Example 1: Figure 4 : The offset curves Given u0=10, u1= 1 , v0=1, v1=10, p0=(0,0,0) to construct a 3

PH curve B(t)  B3(t) p in the z=0 pane. From Theorem 2,  i i Table 2 : The control points of r=3 and r=15 i0 20 r=3 r=12.6 r=15 we can find the remaining control points: p1= (33, ,0) , 3 r 0 (0.594,2.94,3) (2.5,12.4,12.6) (2.96,14.7,15) 79 119 20 p2= ( , ,0) , p3= ( ,33,0) . From Theorem 3, we can find 3 3 3 r 1 (30.4,9.21,3) (22.3,17.4,12.6) (20.2,19.4,15) the control points qi for the rotated normal vector 2 r2 2 (15.1,30.4,3) (0.024,32.3,12.6) (3.76,32.6,15) field V (t)  Bi (t)qi , q0= (20,99,101) , q1= (99,20,0) ,  r i0 3 (19,10.9,3) (5.87,3.33,12.6) (2.53,1.5,15) q2= (99,20,101) . We can intersect the ruled surface r4 (B(t))=B(t)+sV(t) with the plane I: z  (r)  0 . The (24.9,39.4,3) (20.6,25.6,12.6) (19.5,23,15) intersection curve is a rational Bézier curve of degree 5 which r 5 (6.08,30,1.3) (4.17,20.6,12.6) (3.71,18.3,15) is the r-offset[8]. We can project the r-offset to the z=0 plane; the projection is the one-sided offset curve, and the offset distance is the given constant r. Figure 4a is the PH curve B(t), the remaining figures 4b-d are the corresponding offset curves Examples 2 and 3 illustrate the MAT finding problems for the (the dark curves) with distance r=3, r=12.6 and r=15 PH curve B(t) with a ray/cycle. If the -maps for the planar respectively. The number affixed to the control points are the domains do not self-intersect over the bounded area, we can rational weights. Because the weights are relative to the use the theorems 4 and 5to obtain the precise MAT. normal of the intersecting plane, the weights for the offset

Example 2 : (MAT for a PH curve and a ray) 1840 4295 75 9400 r6 = ( , , ) 47 141 47 w6= Given u0=10, u1=0, u2=10, v0=0, v1=10, v2=0, p0= (30,60,0) 21 5 140 1835 365 5 r = ( , , ) 4600 construct a PH curve B(t)  B (t) p in the z=0 plane with 7 w7=  i i 3 69 69 9 i0 920 865 25 the control points p1= (50,60,0) , p2= (50,40,0) , r = ( , , ) 5600 8 w8= 130 130 190 21 42 42 9 p3= ( ,40,0) , p4= ( ,20,0) and p5= ( ,20,0) . The 3 3 3 190 65 55 r9 = ( , , ) 4 3 6 6 w9= 800 rotated normal vector field 4 can be obtained, V (t)   Bi (t)qi i0 100 with q0=(0,100,100), q  (100,0,0) , q  (0, ,100) , 1 2 3 Example 3 : (MAT for a PH curve and a Cycle) 2 2 2 q3  (100,0,0) and q4=(0,100,100). For the ray Let C be the cycle x  y  (50)  0 in the z=0 plane. The L: 4x  (3)y  (240)  0 , (L): 4x  (3)y  (5)z  (240)  0 . oriented radius is -50, (c) is a cone x2  y 2  z  (50)2  0 . For the planar PH curve B(t) in example 2, the MAT for B(t) The MAT for the PH curve B(t) and the ray L is the and C is the intersection curve of (B(t)) and (C) (see fig. 6a). intersection curve of (B(t)) and (L)(see fig. 5). The By Theorem 5, the intersection curve C(t) is a rational Bézier intersection curve C(t) is a rational Bézier curve of degree 9, curve of degree 14, Table 4 lists the control points rk and the Table 3 lists the control points rk and the associated weights associated weights wk. Consider the second row of Table 5, w . Consider the second row of Table 4: the first the control 560 100 k the first control point is r = (30, , ) , the associated 105 15 0 11 11 point is r0 = (30, , ) , the associated weight is w0= 800 , 2 2 weight is w0= 22000 . The rest of the control points and the rest of the control points and weights are listed similarly. weights are listed similarly.

(a) 2D (b) 3D Figure 5 : The MAT of B(t) and L (a) 2D (b) 3D Figure 6 : The MAT of PH curve B(t) and circle C Table 3 : The control points and weights control points weights Table 4 : The control points and weights 105 15 control points weights r0 = (30, , ) w = 800 2 2 0 560 100 r0 = (30, , ) w0=22 000 11 11 95 25 5600 r1 = (40, , ) w = 2 2 1 2180 31280 650 122000 9 r1 = ( , , ) w1= 61 61 61 7 740 1095 145 4600 23290 31280 6500 1306000 r2 = ( , , ) w = 23 23 23 2 r2 = ( , , ) w2= 9 653 653 653 91 5440 6985 1775 8360 26630 750 158000 r = ( , , ) 9400 r3 = ( , , ) w3= 3 w3= 13 141 141 141 21 237 553 79 574790 763280 161500 31826000 r = ( , , ) w = 3745 4435 905 8800 4 4 r4 = ( , , ) 15913 15913 15913 3003 99 99 99 w4= 21 534460 679570 143090 2218000 r5 = ( , , ) w5= 3995 3835 745 8800 14417 14417 14417 231 r5 = ( , , ) 99 99 99 w5= 1593590 5517040 1116500 82094000 21 r = ( , , ) w6= 6 41047 123141 123141 9009 698560 718370 4070 3886000 variable equation. So, there are at most 6n-2 solutions whose r7 = ( , , ) w7= 17487 17487 603 429 values are associated with the variable of the PH curve. 5228270 4665040 15700 647800 r8 = ( , , ) w8= 126321 126321 3239 693 There are two ways to produce the solution for LCP. The first finds the parametric form for the intersection of the r-map(C) 1888780 1458910 132070 2971400 r9 = ( , , ) w9= with the r-map(P), and then substitutes the solution into the 44571 44571 44571 3003 implicit form of L, yielding at most 3n-1 solutions. The 2121790 1384400 115660 1522000 second method finds the parametric form for the intersection r10 = ( , , ) w10= 47943 47943 47943 143 of the r-map(L) with the r-map(P), and substitutes the solution 217400 121190 9650 3158000 into the implicit form of C, yielding at most 4n-2 solutions. r = ( , , ) w11= 11 4723 4723 4723 273 Obviously, the first approach is better. 248870 110800 4020 344600 r = ( , , ) w12= 12 5169 5169 1723 273 Example: The LCP Problem 22300 7130 1450 28600 Let L b the ray x+y=0 or –x-y=0, which represents the same r13 = ( , , ) w13= 429 429 429 21 line with different direction. The cycle and oriented PH curve 190 400 860 is the same as in Example 3. We can first find the weight and r14 = ( , , ) w14=14000 3 63 63 control points for r-map(C)∩r-map(P), to derive the parametric form for their MAT, and substitute it into the implicit form of the r-map(L), which is plane x+y- z=0 or - x-y- z=0, we have a degree 14 equation with one variable t. IV. THE APOLLONIUS PROBLEM OF PH CURVES For the case that x+y=0, we find 4 real solutions for t=-0.9655, We consider the Apollonius problem for 3 primitives, namely -0.5643, 0.5897, 1.3043. There are only one t value between 0 rays, cycles, and oriented PH curves. The problem can be and 1, with this t value, we find the associated circle centered classified into 10 different cases. Consider the Apollonius at [41.98, -35.21] with radius 4.79, as shown in Figure 7a. For problem for 3 rays, the LLL case: trivially we can find one the case that –x-y=0, we find two real solutions for t = - cycle tangent to these three rays. So, there are the LLL, LLC, 0.4356, 0.1442. For the t=0.1442, we find the tangent circle LLP, LCC, LCP, LPP, CCC, CCP, CPP and PPP cases. The centered at [34.77, -48.55] with radius 9.96, as shown in cases without PH curves are simple and well-known. There Figure 7b. are 2 solutions for the LLC, LCC, CCC cases[25,26]. The other 6 cases, with PH curves in it, are discussed below.

V. THE APOLLONIUS PROBLEM WITH ONE PH CURVE There are 3 cases for the Apollonius problem with one PH curve. They are LLP, LCP, and CCP.

To simplify our description, we index these three primitive entities. For LLP problem, we write L L P to identify the first 1 2 and the second ray in this case. (a) Tangent to x+y=0 (b) Tangent to –x-y=0

Figure 7 The tangent circle tangents to a ray, cycle, and For LLP problem, we can find the intersection of r-map of L 2 oriented PH curve. and r-map of P, yielding a rational Bezier curve of degree 2n-

1. We substitute this parametric form into the implicit form of

L , and obtain a degree 2n-1 equation in a single variable. So, 1 Notice that there are other circles tangent to these 3 geometric there are at most 2n-1 solutions whose values are associated entities if we change the orientation for the circle C or PH with the parameter of the PH curve. After we find these 2n-1 curve P. solutions, we can eliminate all solutions outside the interval

[0,1], and find the points on the PH curve where the cycles are tangent. After those tangencies have been determined, the tangent cycles are easy to find. VI. CONCLUSIONS The Offsets of a degree n PH curves has offsets curves with The similar approach can be used in CCP problem. We can degree 2n-1. The MAT of a degree n PH curve with a plane, find the intersection of r-map of C2 and r-map of P, a degree or with a cycle is a rational Bezier curve with degree 2n-1, or 3n-1 rational Bezier curve. We substitute this parametric form 3n-1, respectively. As long as the -maps doesn’t self-intersec into the implicit form of C1, and produce a degree 6n-2 single among the given boundary, the MAT for a PH curve with a ray or a cycle has precise representation. ACKNOWLEDGMENT [18] Rida T. Farouki, C.A. Neff, “Analytic properties of plane offset curves”, CAGD 7, 83-99, 1990. Thank to Mr. Jason Wu and Sheng-Hsin Tsai for their mathematic program to generate the figures of this paper. [19] Rida T. Farouki, C.A. Neff, “Algebraic properties of plane offset curves”, CAGD 7, 101-127, 1990.

[20] Rida T. Farouki, “Pythagorean-hodograph curves”, Springer, VII. REFERENCES 2007. [21] Joon-Kyung Seong, Ku-Jin Kim, Myung-Soo Kim, and Gershon [1] Ching-Shoei Chiang, Sheng-Hsin Tsai, James Chen, “The Elber, “Intersecting a Freeform Surface with a Ruled or a Control Vector Scheme for Design of Planar Primitive PH Ringed Surface, Geometric Modeling and Processing 2004, curves” International Journal of Mathematics Sciences Volume 2004. 1, Number 4, 2007 [22] Francesca Pelosi, Rida T. Farouki, Carla Manni and Alessandra Sestini, “Geometric Hermite Interpolation by spatial [2] Ching-Shoei Chiang, “Exact representation for the intersection Pythagorean hodograph cubics”, Advances in Computational of ruling surface with a plane” The 3rd International Mathematics. V22i4. 324-352, May 2005. Conference on Computer Science & Education KaiFeng, China, [23] R.T. Farouki, C.A. Neff, “Hermite interpolation by Pythagorean 2008. hodograph quintics, Mathematics of Computation, v.64, n.212, [3] Ching-Shoei Chiang, S.-Y. Lin, “The Cyclographic Maps for p. 1589-1609, Oct., 1995. Bezier Curve” The 35th International Conference on Computers [24] B. Juttler, “Hermite interpolation by pythagorean hodograph and Industrial Engineering curves of degree 7, Mathematics of Computation, v. 70, n.235, [4] N. M. Patrikalakis, T.Maekawa, K.H.Ko and H.Mukundan p. 1089-1111, July, 2001. “Surface to Surface Intersections” CAD’04 [25] Christoph M. Hoffmann and Ching-Shoei Chiang, „Variable- http://www.cadconferences.com/ Radius Circles in Cluster Merging Part I: Translational Cluster“, Computer-Aided Design, Sep., 2002. [5] Rida T. Farouki, T. Sakkalis, “Pythagorean Hodographs” IBM J. [26] Christoph M. Hoffmann and Ching-Shoei Chiang, „Variable- RES. DEVELOP. VOL 34, No. 5, September 1990. Radius Circles in Cluster Merging Part I: Rotational Cluster“, [6] Rida T. Farouki, V.T. Rajan, “Bernstein algorithms for Computer-Aided Design, Sep., 2002. polynomials in Bernstein form” Computer Aided Geometric Design 5 (1988) 1-26 [7] Rida T. Farouki, “Pythagorean-Hodograph Curves: Algebra and Geometry Inseparable” ISBN: 978-3-540-73397-3, Springer- Verlag Berlin Heidelberg New York, 2008. [8] Helmut Pottmann, Johannes Wallner, “Computational Line Geometry” ISBN:3-540-42058-4, Springer-Verlag Berlin Heidelberg New York, 2001. [9] Farin, Gerald E, “Curves and surfaces for computer aided geometric design : a practical guide” ISBN: 0122490525, Boston : Academic Press, c1993. [10] E. Muller and J. Krames. Die Zyklographie. Franz Deuticke, Leipzig und Wien, 1929. [11] Christoph M. Hoffmann and George Vanecek, Jr. “Fundamental techniques for geometric and solid modeling.” In C.T. Leondes, editor, Advances in Control and Dynamics. Academic Press, 1991. [12] Christoph M. Hoffmann “Computer Vision, Descriptive Geometry and Classical Mechanics” in Computer Graphics and Mathematics, B. Falcidieno, I. Hermann and C. Pienovi, eds, Springer Verlag, Eurographics Series, 1992, 229-244. [13] Ching-Shoei Chiang “The Euclidean Distance Transform” Thesis of Purdue University, 1992. [14] George B. Thomas, Jr. “Calculus”, Pearson Addison Wesley, ISBN 0-321-24335-8. [15] Christoph M. Hoffmann, “Geometric & Solid Modeling”, Morgan Kaufmann, 1989. [16] Gasper Jaklic, Jernej Kozak, Marjeta Krajnc, Vito Vitrih, Emil Zagar, “Geometric Lagrange interpolation by planar cubic Pythagorean-hodograph curves. [17] Helmut Pottmann, “Rational curves and surfaces with rational offsets”, CAGD 12, 1995.