WDS'08 Proceedings of Contributed Papers, Part I, 19–22, 2008. ISBN 978-80-7378-065-4 © MATFYZPRESS

Parametrizing Implicit

K. Dobi´aˇsov´a Charles University, Faculty of Mathematics and Physics, Department of Mathematics Education, Prague, Czech Republic.

Abstract. We study parametrization of implicit curves in the plane to parametrize self-motion of Stewart-Gough type platforms, that are types of parallel manipulators. Special positions of legs of manipulator can cause the manipulator is not rigid although usually manipulator to be non-rigid if the lenghts of legs are fixed. There are ways to describe self-motion by in projective plane given in implicit form (see [1]). To visualize trajectories of self-motion we need a parametrization of this curve. Exact parametrization is in general not possible. We are trying to find approximative parametrization, which will not cause too big differences between lenghts of each leg, which should be fixed.

Introduction Aproximative parametrizing of curves has nowadays fairly important place in research of computational geometry. There are many implicit curves that are not possible to be parametrized, but advantages of parametric expression are indisputable: it is easy to choose only part of curve; shape of curve can be well influenced by parameters. We need such parametriza- tion that is as near as possible to the original curve. Therefore we split the implicit curve into several parts, which are parametrized separately. We ensure identical lines at end points between neighbouring parts of curve.

Parametrization of implicit We will describe an algorithm for parametrizing plane curve f, which is expressed by an im- plicit equation. The curve is subdivided and after that each segment is parametrized. Adjacent parametrized segments have at their end points a common tangent , so that continuity of parametrization is ensured. General algorithm is given and it is followed by detailed description of each step.

General algorithm

1. Find points Si around curve

2. Make Bezi´er curve between each two points Si,Si+1 3. Put the Bezi´er curve as near as possible to the original curve

Step 1.

Let us have implicit curve f in plane. One point S1 on the curve can be always found. An algorithm for finding points around the given curve will be described. We will start at point Si. At this point tangent line ti to the curve f is constructed.

Point Si+1, which lies on the tangent line and has a given distance k from the point Si, is found. There are two points satisfying this condition. One direction is choosen and is kept for e whole algorithm.

SiSi+1 = k Si+1 ti | | ∧ ∈ e e

19 DOBIA´SOVˇ A:´ PARAMETRIZING IMPLICIT CURVES

At this point can line ni+1 = (Si+1, f(Si+1)) be constructed. Next point Si+1 on the curve is founded as an intersection of f and∇ line n . e e i+1

Si+1 = ni+1 f ∩ In this way we go around the whole curve, and get a list of points on curve as a result of the first step. The whole construction can be seen at the Figure 1.

k Si+1 Si e t i f

ni+1

Figure 1. Point Si+1 is founded as an intersection of line ni+1 and curve f.

Several problems can arise. At singular points it is not possible to construct the tangent line. These points must be omited. Line n can intersect the curve at more then one point. It must be solved by choosing appropriate half line of line n and then finding the nearest point to

Si+1. Next step will be described for one part of curve between points S ,S . In the real e i i+1 computation we go through the next step for each of those pair of points.

Step 2.

Now the Bezi´er curve, in concrete a Bezi´er cubic, between points Si,Si+1 will be defined. We need four points P1, ..., P4 for defining the Bezi´er cubic B(α). Let P1 = Si, P4 = Si+1 be the end points of Bezi´er cubic. Points P2,P3 lies on tangent lines ti, ti+1 from end points. Their coordinates are expressed by parameters p2, p3. However start position of these point is needed for optimization. See at the Figure 2 how the start position is choosen.

P3 P2 Si+1 = P4 S = P 2 i 1 1 3 3 3

f

Figure 2. The abscissa is divided into three abscisae with indentical lenghts and points P2 and P3 are found.

Step 3. The last step of algorithm puts the Bezi´er curve as near as possible to the corresponding segment of the original curve by minimazation of an objective function, which expresses the distance between these two curves. We minimize the function 1 f(B(α))2 dα, 2 Z0 f(B(α)) ||∇ ||

20 DOBIA´SOVˇ A:´ PARAMETRIZING IMPLICIT CURVES which is a function of two parameters p2, p3. The end points of Bezi´er cubic do not change. The Bezi´er cubic is put more closely to f by moving points P2,P3 on tangent lines ti, ti+1.

4 4 One example of usage of this algorithm is given. Choose f = 6 x1 + 2 x2 + 3 x1 and first point S1 = [ .4, .8504855394]. − − 1. Points around curve are found, the list of points is given here and points are displayed at the Figure 3. List of points: [[ .6202552476, .8351028904], [ .7670834913, .5783998011], [ −.7936585230, −.1172496852], [ −.7902358140,.3525905179],− [−.6872489950,.−7754773121], [ .−4337846415,.8589943772], [−.969618147,.6172695695], [ −.14415764e 2,.2156414417], [−.275668904e 2, .2535827779],− [ .1094526033− , .6361275943], [−.4111038509,− .8536242448],− [ .6242720841− , .8326933274]]− − − − −

Figure 3. The grey curve is curve f and diamonds are points Si.

2. The Bezi´er curve will be contstructed. The picture and the computation are illustrated only for two segments of the curve because other segments are computed similar way.

Bezi´er curve for general points P2,P3: First segment: 2 3 [ 0.1512291126 0.9754676262 α + 0.6503117510 α + 7.847752593 p1 α − − 2 3 2 − 3 15.69550519 p1 α + 7.847752593 p1 α 15.53789365 α p2 + 15.53789365 α p2, − 2 − 3 0.6889346378 0.5284601656 α + 0.3523067768 α + 8.750977431 p1 α − − 2 3 2 − 3 17.50195486 p1 α + 8.750977431 p1 α 1.215930615 α p2 + 1.215930615 α p2] Start− point: [ .3341015557, .2596757558]− − − Second segment: 3 2 3 [0.3680717833 α 0.5521076751 α 0.4763849880 + 15.53789365 p1 α −2 − 2 − 3 31.07578729 p1 α + 15.53789365 p1 α 12.51983037 α p2 + 12.51983037 α p2, − 3 2 − 3 0.1201765934 α + 0.1802648911 α 0.8650880262 + 1.215930615 p1 α − 2 − 2 −3 2.431861230 p1 α + 1.215930615 p1 α + 11.73933766 α p2 11.73933766 α p2] Start− point: [ .1345065777, .1245385469] − − − 3. The objective function 1 f(b(α))2 dα, 2 Z0 f(b(α)) ||∇ ||

21 DOBIA´SOVˇ A:´ PARAMETRIZING IMPLICIT CURVES

Figure 4. Bezi´er curve is displayed for start position of points P2,P3 shown as diamonds. Points P1,P4 are symbolized by crosses and the dashed lines are tangent lines t.

Figure 5. The grey original curve f is plotted by Maple using implicitplot, and there are also plotted all segments (black) parametrized by Bezi´er curve. This curve is not too difficult and over that implicitplot can not display sufficient result, only few points of displayed curve are at the ”right place”.

is minimized for each segment of curve, so that final optimal points P2,P3 of each segment are found and final Bezi´er cubic can be computed (See Figure 5.). The parametrization of two segments is given here. Figure 5 shows all parametrized segments. First segment: [0.04521152440 α3 0.1218367834 α2 0.2485306164 α 0.1512291126, 0.04726826980 α3 +− 0.05371320200 α2 − 0.2771348596 α− 0.6889346378] Second segment: − − [0.008598568300 α3 + 0.01369247600 α2 0.2063269360 α 0.4763849880, 0.007276183700 α3 + 0.06895839600 α2 −0.01614628340 α− 0.8650880262] − − Conclusion In this paper, we introduced an algorithm for parametrizing plane curve which is further developed and which is tested on curves describing self-motion of parallel manipulator. The introduced algorithm is able to parametrize some of those curves of self-motion.

References [1] A. Karger, M. Kargerov´a, Z´aklady robotiky a prostorov´ekinematiky, CVˇ UT,´ 2000. [2] G. Farin, J. Hoschek, M. – S. Kim, Handbook of computer aided geometric design, Elsevier Science Publishers B. V., Netherlands, 2002.

22