Finding Shortest Distance between two 3d Parametrized Curves

In summary: If you have a different minimization algorithm, you can still use it by creating a cost function that is the square of the distance from your point to the nearest point on the curve, and minimize that instead.In summary, to determine if two 3d curves come within a certain distance of each other, you can create a distance function with the two curve parameters as independent variables and use standard non-linear minimization algorithms to find the minimum. This may require minimizing multiple times from different starting values to ensure a global minimum. Additionally, to find the shortest distance, you can determine the form of a plane that is perpendicular to both curves and use a minimization algorithm such as Davidon-Fletcher-Powell or create a cost function to minimize the
  • #1
admbmb
3
0
So I have two parametrized equations for two different 3d curves:

Rm(t) = (1.2*sin(2πt) + 0:3)i + t4j + 1.1cos2(2π(t + 0:2))k

and

R(t) = Sin(2πt)i + t3j + Cos2(2πt)k

I need to figure out if these two curves come within a certain distance of each other (0.5).

I cannot understand how to find the shortest distance between these two curves if I'm not given the specific points where these two curves are closest.

Any help is very appreciated!
 
Physics news on Phys.org
  • #2
admbmb said:
So I have two parametrized equations for two different 3d curves:

Rm(t) = (1.2*sin(2πt) + 0:3)i + t4j + 1.1cos2(2π(t + 0:2))k

and

R(t) = Sin(2πt)i + t3j + Cos2(2πt)k

I need to figure out if these two curves come within a certain distance of each other (0.5).

I cannot understand how to find the shortest distance between these two curves if I'm not given the specific points where these two curves are closest.

Any help is very appreciated!

You could calculate the distance between any two points on the two curves and use calculus to minimise this.
 
  • #3
I don't know if there is a trick for your specific problem but here is a general approach:

You need to create a distance function with the two curve parameters, t1, t2, as the independent variables. Then you can apply standard non-linear minimization algorithms to that function. There are likely to be local minimums that are not global minimums, so you may have to minimize many times starting at different initial values of t1 and t2. Let's say that the values of the parameters t1 and t2 are in [0,1]. I think that if you start at each of the corner values (t1,t1) = (0,0), (0,1), (1,0), (1,1), and you get the same minimum solutions for (t1_min, t2_min), then the minimum at that point is global. If you get different minimum solutions at the corners, then I would repeat the minimization from several starting values of (t1_initial, t1_initial)
 
  • #4
The "shortest distance" between two curves is always on a plane that is perpendicular to both curves. So the first thing I would do is determine the form a plane must have to be perpendicular to each curve.
 
  • #5
HallsofIvy said:
The "shortest distance" between two curves is always on a plane that is perpendicular to both curves. So the first thing I would do is determine the form a plane must have to be perpendicular to each curve.
I'm having trouble visualizing that. Unless both curves are on a single plane, I don't see that a perpendicular plane exists.
 
  • #6
FactChecker said:
I don't know if there is a trick for your specific problem but here is a general approach:

You need to create a distance function with the two curve parameters, t1, t2, as the independent variables. Then you can apply standard non-linear minimization algorithms to that function. There are likely to be local minimums that are not global minimums, so you may have to minimize many times starting at different initial values of t1 and t2. Let's say that the values of the parameters t1 and t2 are in [0,1]. I think that if you start at each of the corner values (t1,t1) = (0,0), (0,1), (1,0), (1,1), and you get the same minimum solutions for (t1_min, t2_min), then the minimum at that point is global. If you get different minimum solutions at the corners, then I would repeat the minimization from several starting values of (t1_initial, t1_initial)

Excellent, thank you! So I created a general function for distance, and then plotted that, and it looks correct. However, now I'm trying to solve for the roots of the derivative of that distance function to find where exactly the tangents are 0 (so I can find the minimum), but it's stuck calculating, and not returning results. The cell turns black (I'm using Mathematica) and stays that way. I'm trying to search to see if I can put bounds on the FindRoots, NSolve or Solve so that it doesn't evaluate forever, but no luck. Is there such a command? I only need to find the first value for which the derivative of distance is 0.
 
  • #7
Do you have assess to a math package that includes minimization algorithms? Davidon-Fletcher-Powell is a minimization algorithm one should be able to solve directly for the minimum.
 

Related to Finding Shortest Distance between two 3d Parametrized Curves

1. How do you determine the shortest distance between two 3d parametrized curves?

The shortest distance between two 3d parametrized curves can be determined by finding the closest points between the two curves. This can be done by finding the partial derivatives of the distance function and setting them equal to zero to find the critical points. The minimum distance is then calculated by plugging in the values of the critical points into the distance function.

2. What is the distance function for finding the shortest distance between two 3d parametrized curves?

The distance function is a mathematical formula that calculates the distance between two points in 3d space. In the context of finding the shortest distance between two 3d parametrized curves, the distance function is a function of two parameters, t and s, which represent the parameters of the two curves.

3. What is the significance of finding the shortest distance between two 3d parametrized curves?

Finding the shortest distance between two 3d parametrized curves is important in many applications, such as computer graphics, robotics, and physics. It can help determine the closest distance between two objects in 3d space, which can be useful in collision detection and path planning.

4. Can the shortest distance between two 3d parametrized curves be negative?

No, the shortest distance between two 3d parametrized curves cannot be negative. The distance between two objects is always a positive value, and the shortest distance is the minimum distance between the two curves.

5. Are there any limitations to using the method of finding the shortest distance between two 3d parametrized curves?

One limitation to this method is that it assumes the two curves are smooth and continuous. If the curves have discontinuities or sharp turns, the method may not accurately calculate the shortest distance. Additionally, the method may become more complex and time-consuming when dealing with more complex curves, such as spirals or curves with varying radii.

Similar threads

Replies
4
Views
2K
  • Mechanics
Replies
11
Views
301
Replies
2
Views
2K
Replies
2
Views
1K
  • Calculus
Replies
11
Views
3K
  • Precalculus Mathematics Homework Help
Replies
1
Views
975
Replies
14
Views
2K
  • Introductory Physics Homework Help
Replies
13
Views
938
  • Calculus and Beyond Homework Help
Replies
2
Views
4K
Back
Top