Intersection between a line and an interpolated surface
Mostrar comentarios más antiguos
Hello all,
How can I solve for points of intersection between a line and an interpolated curve (an interpolant)? I tried fsolve to solve F = 0 where F is defined by
F = [r(3) - surfacefun(r(1),r(2));
r(1) - r0(1) - r(4)*k(1);
r(2) - r0(2) - r(4)*k(2);
r(3) - r0(3) - r(4)*k(3)];
surfacefun is the interpolant obtained from TriScatteredInterp applied to the scattered data. r(1), r(2) and r(3) are the x, y and z coordinates, while r(4) is actually lambda in the vector equation of a line (r = a + lambda*k), and k(1), k(2) and k(3) are the components of the direction vector of the line.
One of the errors returned was that "Undefined function 'surfacefun' for input arguments of type 'double'."
So, how should I approach the problem of finding intersections between a line and a numerically interpolated surface?
Thank you very much in advance for your help :)
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Interpolation en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!