Equation for a Curved LineDate: 01/19/97 at 23:46:08 From: Aaron Hardinger Subject: Formula for a curved line Hello, I would like to ask about a problem concerning curved lines. I would like some sort of a formula or process that would allow me to enter a starting point and a starting slope and then an ending point and an ending slope. I would like to make it so that the starting slope changes in a gradual manner to the ending slope and in the process make sure that the ending point of the curve is in a specific position, the position supplied as the ending point. This curve would in essence start at the begining point with the beginning slope. Then the slope would curve and also the points would translate to produce a curved 'line'. Then when it was done the curve end would be at an appointed ending point with the slope of an appointed ending slope. Thank you, Aaron Hardinger Date: 01/21/97 at 11:08:00 From: Doctor Wilkinson Subject: Re: Formula for a curved line Good question! In general there will be a lot of curves that will satisfy these conditions, but probably the simplest will be a cubic polynomial: ax^3 + bx^2 + cx + d This has four coefficients, and you have four conditions that you can use to make equations for a, b, c, and d. For example, suppose you want the curve to go through the points (0,0) and (1,1), and you want the slope at the first point to be 1 and the slope at the second point to be 0. Then you would get the equations: d = 0 a + b + c + d = 1 c = 1 3a + 2b + c = 0 You can solve this to get: a = -1 b = 1 c = 1 d = 0 Your curve would be: y = -x^3 + x^2 + x -Doctor Wilkinson, The Math Forum Check out our web site! http://mathforum.org/dr.math/ Date: 01/23/97 at 21:16:43 From: Aaron Hardinger Subject: Re: Formula for a curved line Hello, Thank you for your help, but one more question. I do not know calculus yet and need help with how you derived those formulas such as: d = 0, a + b + c + d = 1, c = 1, and 3a + 2b + c = 0. How did you derive the formulas for a, b, c, and d based on the points that were given and those slopes? Thank you very much, Aaron Hardinger Date: 01/24/97 at 11:54:18 From: Doctor Wilkinson Subject: Re: Formula for a curved line The first two equations I got by substituting into the assumed equation: y = ax^3 + bx^2 + cx + d The first point was (0,0) which gives: 0 = a * 0^3 + b * 0^2 + c * 0 + d or d = 0 The second point was (1,1) which gives: 1 = a * 1^3 + b * 1^2 + c * 1 + d or a + b + c + d = 1 The other two equations come from substituting for the slopes. For a curved line, slope is a concept from calculus, so it's a little hard to explain without any calculus. It turns out the the formula for the slope of: y = ax^3 + bx^2 + cx + d is 3ax^2 + 2bx + c I substitued 0 and 1 into this and set the results equal to the given slopes. -Doctor Wilkinson, The Math Forum Check out our web site! http://mathforum.org/dr.math/ |
Search the Dr. Math Library: |
[Privacy Policy] [Terms of Use]
Ask Dr. Math^{TM}
© 1994-2013 The Math Forum
http://mathforum.org/dr.math/