Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Finding Shortest Distance between two 3d Parametrized Curves

  1. Sep 28, 2014 #1
    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!
     
  2. jcsd
  3. Sep 28, 2014 #2

    PeroK

    User Avatar
    Science Advisor
    Homework Helper
    Gold Member

    You could calculate the distance between any two points on the two curves and use calculus to minimise this.
     
  4. Sep 28, 2014 #3

    FactChecker

    User Avatar
    Science Advisor
    Gold Member

    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)
     
  5. Sep 28, 2014 #4

    HallsofIvy

    User Avatar
    Staff Emeritus
    Science Advisor

    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.
     
  6. Sep 28, 2014 #5

    FactChecker

    User Avatar
    Science Advisor
    Gold Member

    I'm having trouble visualizing that. Unless both curves are on a single plane, I don't see that a perpendicular plane exists.
     
  7. Sep 28, 2014 #6
    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.
     
  8. Sep 28, 2014 #7

    FactChecker

    User Avatar
    Science Advisor
    Gold Member

    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.
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook




Similar Discussions: Finding Shortest Distance between two 3d Parametrized Curves
Loading...