tags:

views:

887

answers:

2

We have two points (x1,y1,z1) and (x2,y2,z2) in 3d space. We have a curve of fixed length which is to be connected (not with a straight line) between these points. How to proceed with the code in Matlab?

+1  A: 

Without knowing how far you've gotten trying to use snakes (i.e. active contours), the best I can do is suggest these links:

Most applications of active contours I've come across appear to be more for 2-D image segmentation, but hopefully these links will give you some jumping off points.

gnovice
A: 

If you are trying to minimize the bend angles at your robot's joints, then the best curve would be a circular arc.

Let L be the length of the arc, d be the distance between the endpoints, theta be half the angle of the arc, and r be the radius of the arc. Then:

d/L = sin(theta)/theta ==> solve this numerically for theta using one of Matlab's solvers

Once you have theta, the radius of the arc is: r = L / (2 * theta)

There are still an infinite number of arcs between the two endpoints with this r and theta. You'll have to use some other criteria to select what roll angle about the points to use.

Theran
Would this curve still work if L is greater than pi*d/2 (i.e. if L is greater than half of the circumference of a circle of diameter d)?
gnovice
Yes, it should work for all distance / arc length ratios between (but not including) 1 and 0.
Theran

related questions