1
$\begingroup$

I need a (simplest) function that interpolates values in range from predefined point $A$ to $B$ with rules:

  • it must be smooth curve
  • direction near $B$ must be the same as predefined $D$ vector

enter image description here

I have a variant to build circle arc but is too complex. Maybe some sort of splines, but I don't know how to represent it with my $A$, $B$ points and $D$ vector.

  • 0
    Basically the midpoint $M$ should be $B-D$.2012-08-21

1 Answers 1

1

Given a starting point $A$, ending point $B$ and final direction $D$, you can define a quadratic Bezier curve. Let $M=B-D$, $M$ being the middle point used to define the curve. The curve $f$ is given by

$f(t)=(1-t)[(1-t)A+tM]+t[(1-t)M+tB],\ 0\leq t\leq 1$

You can adjust the smoothness of the curve by changing the placement of $M$. You can do this by choosing a scaling factor $x>0$ and setting $M=B-xD$.

  • 0
    Yes, looks like what I need. Thanks. `x` should be 1, otherwise the curve 'magnets' to one of points.2012-08-21