Question

I have two lines that start and end at random locations on a screen and create an angle. I then have an object follow these two lines. However at the intersection between the first and second line, the object rapidly rotates to go down the second line. And I don't want this.

So what I want to do is be able to create a curved version of this line that would have a more of a U at the intersection rather then a hard turn. I looked into curve fitting papers and can't seem to find that that would allow me to create a U out of a V.

enter image description here

Sorry for the terrible images... I want to take the one of the left, and generate the one on the right (same start, end, and intersection points). Another example, http://en.wikipedia.org/wiki/Curve_fitting

Any ideas?

Was it helpful?

Solution

You should take a look at http://en.wikipedia.org/wiki/Bezier_curve

Or just http://upload.wikimedia.org/wikipedia/commons/thumb/2/2d/Bezier_2_big.gif/240px-Bezier_2_big.gif

If the coordinates of the start/end points of the two lines are known, you can simply calculate an bezier curve follows the methods in the link above.

If not (for example with an bitmap like what you post), you can do Hough Transform first to extract the coordinates

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top