From: Pascal Bourguignon <pjb@in...>  20070127 12:48:25

Hans3 writes: > Thanks for the advice Klaus & Pascal! > Although Pascal's advice is clear, I'm aware of the steps I need to fol= low > to make these functions, I know this. > What I don't know is the code... (because I don't have much experience = yet) Well, the question is what does it mean to interpolate? Assume we're considering only one couple of points=20 (interpolate '(4) '(8) 3) we have the points of coordinates (0,4) and (1,8) and we want to find one (=3D32, since we count these two points) point on the line that pass thru these two points. To do that, you need to compute the equation of the line from the two points, and then you need to divide the horizontal distance between the two points by the number of interpolated points plus one, and then, you can compute the y coordinate. In this example, the equation of the line passing thru (0,4) and (1,8) is: y=3D4+4x (since 4=3D4+4*0 and 8=3D4=3D4*1) and since we need only one point in the middle, with x =3D (10)/2 =3D 0.= 5 we find y =3D 4+4*0.5 =3D 6 therefore the result is: '((4) (6) (8)) So, what you need to do, is to write a function that finds the parameters a and b of the line y=3Dax+b, that passes between two points of coordinates (0,y0) and (1,y1). Then you must compute the list of intermediate y's for the serie of n x's going from 0 to 1.=20 Once you can do it for one couple of points, ou can do it for any number of couples of points given in two lists. =20 __Pascal Bourguignon__ http://www.informatimago.com/ READ THIS BEFORE OPENING PACKAGE: According to certain suggested versions of the Grand Unified Theory, the primary particles constituting this product may decay to nothingness within the next four hundred million years. 