<<

Transactions on Engineering Sciences vol 15, © 1997 WIT Press, www.witpress.com, ISSN 1743-3533

Stereographic projection of algebraic onto the

S. Welke, 7n der Spwelke@aol com

1 Introduction

Stereographic projection is a conformal from the x — y— plane to the unit sphere S* C R^. The geometric definition is:

Definition 1 Let P = (x, y, 0) be a in the x — y— plane, let N = (0, 0, 1) be the North Pole of the unit sphere in R^, and let lp be the unique straight lp through P and N . The with the unit sphere is a point P' ^ N . The correspondence p : P \ — > P* establishes a one-to-one map p : R^ — > S*\{N} called Stereographic projection.

We frequently identify (x,y) £ R% with (x,y, 0) G R^. Note that there is no point P in the entire plane with p(P) = N.

Given a point P, the line lp is the {(0,0,1) +t(x,y,-l) \t £ R} = {(tx,ty,t — 1) \t G R}. Because P' belongs to the unit sphere, its coor- dinates satisfy the following quadratic : (tx)* -f (ty)* + (1 — t)* = 1 with solutions ^o = 0 and ti = 1+3.2+3,2 • As ^ = 0 corresponds to TV, only ti leads to a finite point P in the plane. Thus an analytical formula for the Stereographic projection is:

If P' = (a/, ?/, z'} G S*\{N} , a similar consideration leads to a formula for the inverse mapping p~^ :

Transactions on Engineering Sciences vol 15, © 1997 WIT Press, www.witpress.com, ISSN 1743-3533

492 Innovation In Mathematics

x' (2) -y' i- It is obvious that the North Pole cannot be mapped by p~* onto a finite point P £ R^. But if P approaches N on the unit sphere, in the plane

P escapes to infinity. This motivates the completion of R^ by a point PQO? the . So p : R^ U {Poo} — > S* , p(P^) = N, becomes a .

Definition 2 A real plane algebraic 7 is the set of all points (x, y) £ R^, whose coordinates satisfy an equation f(x,y) — 0 with a real polynomial f . f is called the polynomial of the curve.

Now consider the problem of representing the image ^(7) of an under stereographic projection as a 3D- plot. We use the x* — y — 0 as an example. Figure 2 shows how to proceed:

Figure 2 We first embed the 7 in R^ (left part of fig. 2) and then connect all points P of this curve by straight lines IP with N. The union R := UP

Transactions on Engineering Sciences vol 15, © 1997 WIT Press, www.witpress.com, ISSN 1743-3533

Innovation In Mathematics 493

This straightforward approach is easy to realize with Mathematica:

ImplicitPlot is the appropriate function to plot an algebraic curve. We extract from the resulting Graphics object the Line-part, which represents the curve. Next we compute the coordinates of P' for each single point P of Line. The result is Line[{P{,f%,...,f%}], which can be plotted as a GraphicsSD object. Although this is fairly simple there is a major draw- back: Thefina l 3D-plot depends on the 2D-plot produced by ImplicitPlot, which covers only a finite rectangle of the plane. But a parabola does not fit into a rectangle, so the 3D-image created in this way can never be a complete 3D-plot of the parabola . Thus we shall develop a more sophisti- cated approach, which captures the whole plane into the unit . As an additional feature this method applies to a more general situation, namely the intersection of two polynomially defined surfaces.

2 Orthogonal Projection and Groebner Bases

Let 7 be a plane algebraic curve and R := \Jp^ IP the corresponding as above. First notice that p~* can be extended by eqn (2) to all of

If PI and P% are points on the line lp then the vectors NPI = (a?i, 2 and NP

Xi X-2 Vl ?/9 and -^— = -^- for ^ ^ 1 and z% 1 I - Zi 1 — 22 I - Zi 1 -

Therefore p~* maps the whole punctured line lp\{N} onto P, i.e. R\{N} line by line onto the points of 7 . We have proved the first part of the following :

Theorem 3 ^ 6eZ /^ 6e #&e poh/nomW 0/7. 0 p-y(x,y,z} — 0 defines implicitly R.

A is obviously a polynomial, we find /%(0, 0, 1) = 0, so the second part is proved too.D

The geometric idea behind our second approach is to project each point of the image Y = ^(7) othogonally to the x - %/- plane. We obtain a curve Y := //(Y), where H is orthogonal projection. Next we construct a surface R' := Up^y ZP, where ZP is the line through P to the x — y— plane, as in the middle part of th next figure:

Transactions on Engineering Sciences vol 15, © 1997 WIT Press, www.witpress.com, ISSN 1743-3533

494 Innovation In Mathematics

Figure 4

This seems to be rather fussy, but a polynomial for 7" can be constructed directly from the polynomials of the surfaces R and S* by the use of Groeb- ner Bases. The advantage is that 7" lies completely inside the wether 7 itself is bounded or not. But everything has its price: Y is possibly only a part but not all of R" D S^, see the right part of figure 4. We perform a shift from geometry to algebra. All polynomials / vanishing on Y form an ideal / in the polynomial ring R[z,%/, z]. / has two generators, namely p^(x,y, z] \— x* + y^ -\- z* — 1 and /^ from theorem 3. In other words: For each / E / there exist two polynomials p\,p<2 E R[x, y,z] with f = Pi'pu + pi- f-y. { Pu, A is called a and every ideal has a multitude of different bases. But in contrast to vector , these bases can differ in the number of elements. Particular useful for computational purposes are Groebner Bases. We do not go into details but we have to mention that Groebner Bases depend on a termorder, that is an ordering on the set of monomials in the variables of the polynomial ring. Our plot mechanism for Y depends heavily on the next theorem, which is a simple consequence of The Elimination Theorem, page 114, Cox, Little, O'Shea [1].

Theorem 4 Let G be a Groebner Basis with respect to the lexicographic ordering on {z,x,y} for an ideal < p,q >C R[x, y, z] with two generators. Then there is a polynomial g%y G G Pi M.[x,2/], with only two variables.

The interested reader is referred to [1] for details. We consider an example.

unitSphere:=x~2+y~2+z~2-l ; parabola:=y-x~2 ; PolySD [exprj : =

expr/. Thread [{x,y}->{x,y>/(l-z)]//Together//Numerator parabola3D:=Poly3D [parabola] ; parabolaSD

2 - x y-yz

Transactions on Engineering Sciences vol 15, © 1997 WIT Press, www.witpress.com, ISSN 1743-3533

Innovation In Mathematics 495

This is the polynomial of the surface R corresponding to the parabola. Groebner Basis is a built-in function in Mathematica, the ordering of vari- ables can be specified as an optional argument:

GroebnerBasis [{parabolaSD , unitSphere} , {z , x , y}]

4 2232 22 32 {x -y(2x -x y - y ) , x - y + y z, x - x y - y + x z,

222 -1+ x +y +z}

We see that g^y is the first element in the output-list, and this is always the case, g^y is the polynomial of an algebraic curve 7^ which contains the projection Y' of the curve Y- In many cases the equality 7^ = 7 holds, but there exist simple examples for inequality.

3 Implementation

The results of the previous section can be applied to the general problem of computing the points of a space curve Y, which is the intersection of two poly normally defined surfaces:

Let pi and p% be the polynomials of two surfaces /?i, R% C R^, then:

• compute thefirs telemen t g^y of the Groebner Basis of < p\ , p% >

• plot the algebraic curve 7*%, defined by g^y

• solve for each point P = (a, b) G Trg/ the equation p(a, 6, z) = 0 for z

• if a solution Zi of the previous equation satisfies p

• patch all points obtained in this way together in an appropriate way to obtain Y

This raw outline will guide us through the following code. The last step is

a bit complicated to manage technically. «graphics//implicit .m ; «graphics//.m ;

(* Packages needed *) gbl [polyl_,poly2_] := Part [GroebnerBasis [{polyl ,poly2},{z,x,y}] ,1] //Expand ; (* 1. element of the Groebner Basis *)

eqList [poly_] := Module [{w=Factor [poly] , eq= (#==0)6} , If [Head [#] ===Times , eq/@ReplacePart [# , List , 0] , #==0] & @ w] ;

Transactions on Engineering Sciences vol 15, © 1997 WIT Press, www.witpress.com, ISSN 1743-3533

496 Innovation In Mathematics

A Groebner Basis element is possibly a product of irreducible polynomials, each defining a separate algebraic curve. The function eqList transforms a polynomial p — p\ - p% - ... • pn into a list of {pi — — 0,p% ==

0, ...,/?n == 0}.

ProjectXY[{exprI_,expr2_},r_] : = ImplicitPlot[gbl[exprl,expr2]//eqList,{x,-r,r}, DisplayFunction->Identity] ;

TakeLines[plot_]:=Flatten[Part[plot, 1] ] ; (* Extracting lines from a GraphicsSD output of ProjectXY *)

test[{a_,b_},{p_,q_}] : = Module [ {k=If[AbsOImOPart[#,3]<.0007,Re [#],Null]& , eqn=p /.Thread[{x,y}->{a,b}], poly=q /.Thread[{x,y,z}->#]& , 11, w },

l=If[Abs[poly[#]]<.0007,#,Null]& ; w=k /@ ({a,b,z}/.NSolve[eqn==0,z]) ; 1 /O w] ;

The function test is the heart of the algorithm: The points of the space curve 7 are constructed from the curve given by gbl. The next group of functions manages technically the patching together of points to obtain Line-objects, which form the plot of the space curve 7 . dlt=Delete[#,Position[#,Null]]& ; plist=Flatten@Position[#,Null] & ; poslist= Partition[Join[plist[#],plist[#],{1,Length[#]}]//Sort,2]& ; skipn[M_,{a_,b_}] :=If [a+Kb,Take[M,{a+l,b-l}] ,{{0,0,0}}] ; clr[M_] :=skipn[M,#]6 /O poslist [M] ; process [Ist_,exprl_,expr2_]: = Line /<8 Flatten[(clr/fl(test [#,{exprl,expr2}]& /@

Part[1st,1]//Transpose)),1] ; (* Each point from the plane curve gbl is equipped with *) (* the corresponding z-coordinate(s) if it/they exist *)

To3D[{exprl_,expr2_},r_]:^process[#,exprl,expr2]& /@ (ProjectXY[{exprl,expr2},r]//TakeLines) ; (* The main function: A 2D-line is transformed to a 3D-line*)

4 Examples

(a) Let us look at the curve corresponding to the parabola y — x* = 0:

Transactions on Engineering Sciences vol 15, © 1997 WIT Press, www.witpress.com, ISSN 1743-3533

Innovation In Mathematics 497

demo=Show [GraphicsSD [{{EdgeForm [] , Sphere [. 98,20,20]}, #}] , ViewPoint->{-3.020,1.289,0.816},

Boxed->False,Axes->False]& ; (* This function displays the final curve *) To3D [{unitSphere,Poly3D[y-x~2]},1.]//demo

- GraphicsSD - We observe that the two "arms" of the parabola meet in the North Pole.. (b) Next we consider the rational function given by y = -\. The equation

of the graph is x*y -1 = 0. That a pole of a rational function is a (north) pole becomes evident in the next plot:

To3D[{unitSphere,PolySD [x~2*y-l]},!.]//demo

Figure 7 - GraphicsSD -

and the lemniscate x* - y* - (x* + y*) = 0. We omit the simple code for the plot offigur e7 . Note that g^ is g^ = -x* -f x* + y* for the and # = (^^ + 2/^)^(-a?^ -k ^ + ?/^) for the lemniscate. As the first factor of gi is the equation of the point (0,0) , we conclude that the images of the hyperbola and the lemniscate are symmetric with respect to the x — y-plane. On S^ the hyperbola is connected and intersects in N.

Transactions on Engineering Sciences vol 15, © 1997 WIT Press, www.witpress.com, ISSN 1743-3533

498 Innovation In Mathematics

(d) Finally consider the intersection of a with equation x^-\-y^ — 2z^ = 0 and the Conoid of Pluecker with aaf -h by** — z(x* -f y^) — 0 . A plot is shown in figure 8 below, the conoid is the middle leaf: Inf]:= demo2:=Show[GraphicsSD[#],Boxed->False,Axes->False,

Viewpoint->{-0.202,1.852,2.825}]& ; To3D[{x~2+y~2-2*z~2,-x~2/2+4*y~2/5-x~2*z-y~2*z},2.2]//demo2

Figure 8 - GraphicsSD -

5 Remarks

(1) By the use of Groebner Bases this method is restricted to of polynomially defined surfaces. (2) The gaps in the 3D curves result in the fact that Implicit Plot produces disconnected lines, even if the curve is connected. (3) The quality of the final output depends on the quality of the output of ImplicitPlot. AA severe restriction of this function is that it cannot handle curves of order > 4 very well. (4) The code for this paper was generated with Mathematica version 2.2. Certainly the new Root objects of version 3.0 allow to write an improved version of ImplicitPlot and a function "Plot Inter sect ion" which does the job described above without gaps.

References

[1.] Cox, D., Little, J., O'Shea, D. Ideals, Varieteis, and Algorithms,

Springer-Verlag, Berlin and New-York, 1992