Restauration fonctionnelle de la posture et de la marche : vers la coordination des membres valides et déficients. (Functional rehabilitation of posture and walking: Coordination of healthy and deficient limbs)

As there is a constant need in the scientific community, we present in this paper a non-particular figure generator, based on a SF-AMPG method. The shapes which are built with this algorithm are convinient for most applications. I. I NTRODUCTION People writing articles, often explaining general (nonparticular) situations, always face a lack of figures with no nparticular shapes, i.e. which are not either a perfect square, triangle, circle or ellipse. We focus here on the issue of drawing a perfect non-particular smooth figure (not a polygo n), trying to provide with results that would not look like an ellipse. We propose a method to solve this problem : after reviewing some theoretical points (section II), we propose an impleme ntation (section III), and finally present some results (sect ion IV). This will be followed by a discussion (section V). II. T HEORY We decided to use a spline-based approach ; for a complete review of splines theory, one can read [1]. The algorithm, called SF-AMPG (which stands for Shape Free Anchoring Model Patatoid Generator), works as follows : 1) We first define a rectangular bounding box for the figure, and chose one random point on each side, called anchoring point, 2) then, we compute the four lengths between these four anchoring points and place a fifth anchoring point on the longest segement, 3) Finally, we build a spline curve crossing these five anchoring points. Fig. 1. Example of shape given by the SF-AMPG III. I MPLEMENTATION We implemented this algorithm with Scilab 1, a free scientific software package. We report script code for open distribution. // user defines bounding box largeur=input(’Patatoid width ? ’); hauteur=input(’Patatoid height ? ’); // random choice of 4 anchoring points Rand = rand(1,5); Rand(5) = 0.5+0.2 * (Rand(5)-0.5); x = [Rand(1) * largeur, largeur, Rand(2) * largeur, 0]; y = [0, Rand(3) * hauteur, hauteur, Rand(4) * hauteur]; // computation of the fifth anchoring point for i=1:4 dist(i)=sqrt( (x(modulo(i,4)+1)-x(i))ˆ2 + (y(modulo(i,4)+1)-y(i))ˆ2 ); end [m,index]=max(dist); // creation of base vectors xmore = x(index) * Rand(5)+x(modulo(index,4)+1) * (1-Rand(5)); ymore = y(index) * Rand(5)+y(modulo(index,4)+1) * (1-Rand(5)); xnew = [x(1:index), xmore, x(index+1:length(x)), x(1)]; ynew = [y(1:index), ymore, y(index+1:length(y)), y(1)]; t = 1:length(xnew); der(1)=0; der(2)=der(1); // periodic cubic spline interpolation xx=linspace(1,length(xnew),10000); xi = interp(xx, t, xnew, splin(t, xnew ,"periodic")); yi = interp(xx, t, ynew, splin(t, ynew ,"periodic")); IV. RESULTS All figures computed by our Patatoid Generator are very convinient for all purposes. We show in fig. 1 an exemple. V. D ISCUSSION We presented here a Patatoid Generator based on a SF-AMPG algorithm, able to provide with smart non-regular shapes, usefull when dealing with a general case (instead of a particular figure). This idea could be extended to many other similar generators : there is also an important need fo r unspecified triangles. The author would like to thank all people that motivated these works, and especially S. Chareyron for her initial impulse. REFERENCES [1] Bartels, Beatty, and Barsky ”An Introduction to Splines for Use in Computer Graphics and Geometric Modelling” published by Morg an Kaufman, Los Altos, CA, 1987. 1The Scilab Consortium; www.scilab. org