Hello Andrew, Your numbers fit a third order polynomial quite well and if your problem was to add a value to each point, you would be in business (just modify the "a" term). Frankly, the only way I know that will work in all cases is to: a) represent your curve by an equation (in this case a polymonial) b) get back to your original numbers by reversing the equation. c) modify the y intercepts in the desired manner. d) re calculate the polynomial coefficients. We are doing this in a Pic 17C756A. You can use 24 bit float for the polynomial, but will need 32 bits for the solver. I guess I got to ask the most important questions of how big a Pic? and how much time do you have? (Both real time and coding time) On the other hand, you could use whatever technique you choose for you original curve and then scale the y values after they are computed. Tom Mariner > -----Original Message----- > From: pic microcontroller discussion list > [mailto:PICLIST@MITVMA.MIT.EDU]On Behalf Of Drew Vassallo > Sent: Sunday, July 01, 2001 09:54 AM > To: PICLIST@MITVMA.MIT.EDU > Subject: [PIC]: Scaling of a curve > > > Math geniuses of PICLIST: > > I have a series of 40 points that represent a curve. It's > not a linear > curve. In fact, it doesn't necessarily even have a positive slope > throughout. What I want to do is to create a scaling that is variable > depending on the position on the curve. It's probably best to give an > example: > > point 40 = 100 (dec.) > point 30 = 80 > point 20 = 75 > point 10 = 70 > point 1 = 35 > > Let's say at point 30, we want to add an additional 10% to > the value. So, I > want to add an additional 10% also at all the other points (3 > or 4 at point > 1 and 10 at point 40). This will, of course, change the > characteristics of > the curve as a whole, but it is necessary in this application. > > Any quick ways? My initial idea was to take the percentage and try to > multiply it out, but I'm not sure how this would work over the entire > percentage range (i.e., I could be adding as little as 1% or > as much as > 200%) and I would probably need some sort of floating point > math for any > sort of precision at the lower values. > > My other idea was just to take the endpoints, find the ratio > between them, > and linearly scale the intermediate points, even though > that's not entirely > accurate, but it's better than nothing. > > Thanks, > --Andrew > _________________________________________________________________ > Get your FREE download of MSN Explorer at http://explorer.msn.com > > -- > http://www.piclist.com hint: PICList Posts must start with ONE topic: > [PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads > > -- http://www.piclist.com hint: PICList Posts must start with ONE topic: [PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads