Solved
Connect points to create a smooth curve
Posted on 2003-03-26
I have a list of X and Y coordinates where the peak of each "hill" should be. The end result will be a graph of sorts that will have a line tracing through and hitting each point exactly. Each pair of values will also have one number specifying the steepness of its respective hill. Where there are no points, the graph will stay at zero.
I have been experimenting with many ideas, and the most developed one that I have come up with is this: Say there is only one point specified. The graph will stay at zero until the bottom of the curve, where there will be a cosine wave that travels upward, passes through the specified point, and then continues steadily down to zero again. Where there are two hills that are close to each other, there should be a smooth transition from the hill of one point to the hill of another (this is where I have the issues). If I pick out the point where the two waves clash, then pick an interval immediately surrounding that point and mark it off, I can find the slopes of the two waves at those specific points, and then find a quadratic equation that meets at those points and splice it in between.
If you are having trouble understanding what I am trying to do, please post a comment about what is unclear in my post.
The end result should be somewhat like the equalizer in WinAmp. As you drag the sliders up and down, a curve is generated right above that passes through each slider's respective point and then moves on toward the next point, never breaking the smooth curve from before.
Any help would be greatly appreciated. I am only taking a pre-calculus course, so any advanced mathematics will have to be explained. This question is not urgent, but the sooner you can get back with a response, the better.
Thank you in advance!
~Tom
(Sorry for any misspellings or other errors.. I have no time to check over my post. ;)