PDA

View Full Version : Need help: Equation for an S-curve


Physiks111
Dec10-10, 12:51 PM
Need something for my work:

Given a point (x1,y1) and (x2,y2) what would the equation be for an S-curve?

Say the two points are (0,10) and (1,20). Also, if the equation was more generalized such that you could play with variables to change the way the slope occurs that would be good. I found some stuff on wikipedia, but it wasn't working for me. The equations I found seem to be good if you have a large negative x going to a large positive x value. But on the x-axis I just want to go from 0 to 1. All help is appreciated, thanks.

hotvette
Dec10-10, 02:54 PM
Try parametric polynomials, specifically cubic bezier. If you make the two points the endpoints of the curve you've defined the first and last control points. Playing around with the other control points will yield a variety of shapes connecting the two points. Plotting the curve in Excel makes is very easy to see the result real time as you change the values of the control points.

http://en.wikipedia.org/wiki/B%C3%A9zier_curve

chiro
Dec10-10, 10:32 PM
Just to add to what hotvette has said, you can have curves that are approximating or interpolating. In the case of bezier curves that are cubics, they only go through the end points and in general not through the middle ones. Interpolating curves go through every point that is defined.

If you want to understand these kind of curves in any dimension, do a bit of research on spline generation.