Intersection between a line and an interpolated surface
显示 更早的评论
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 :)
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Interpolation 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!