1
$\begingroup$

enter image description here

A can be written as... $y = a$

B can be written as... $y = bx + a$

C can be written as... $y = cx^2 + bx + a$

1) How can I write D? I was looking at implementing bezier curves into some code but is there something similar which could be computed much quicker?

2) C is a quadratic... what is the name for D?

Edit: enter image description here

Perhaps if I explain what I'm doing.... I am trying to build a decent servo controller. I have a servo which will move from servo position 30 to 0. I want it to move in a more elegant way than B (above)... ideally like in the picture. I will come up with a way of defining the movement between 2 positions when I send a command to the controller. Perhaps this is a quadratic equation which could be calculated easily for each x (time) between y (servo angles)... this would mean I would only need to pass a, b and c to the controller along with the time (length) and both positions.

I figured it would be better to have it able to be more irregular... but still super quick to compute. I considered bezier curves as a definition for the line, but they seem overcomplicated and slow to compute... if there anything else I could use?

  • 0
    It's hard to tell. There are a lot of curves that locally look like that. If you want it to look like a rotated parabola, for example, that's pretty easy to do.2012-08-21
  • 0
    If you fix the two endpoints of curve $D$, and you know the slope of the curve at those endpoints, you can build the Hermite interpolating polynomial that more or less looks like curve $D$.2012-08-21
  • 0
    I googled hermite interpolation. looks promising. seems fairly heavy on computation, though.2012-08-21
  • 0
    @J.M. i think u answered my question.... please add it as answer and i will mark it as such2012-08-21
  • 0
    For a rotated parabola, $y$ would not be a function of $x$ (globally).2012-08-21
  • 0
    "seems fairly heavy on computation" - not if you restrict yourself to **cubic** polynomials, as Gerry says. You have four conditions in the previous comment I gave; that is sufficient to compute the values of $a,b,c,d$ in Gerry's answer.2012-08-21

2 Answers 2