How do I find intersection of a straight line and a surface?
4 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
I have a surface generated via 'fit' function and a straight line which intersects the surface, how do i find this intersection?
Thanks
0 Commenti
Risposte (1)
Matt J
il 31 Dic 2017
Modificato: Matt J
il 1 Gen 2018
One way would be to use fzero. If the parametric equations for your line are L(t)=L0+t*D, the t that gives the intersection could be obtained as,
t_intersection = fzero(@(t) objective(t,L0,D,fitobj), t0)
function difference=objective(t,L0,D,fitobj)
L=L0+t*D;
x=L(1); y=L(2); z=L(3);
difference = z-fitobj(x,y);
end
0 Commenti
Vedere anche
Categorie
Scopri di più su Interpolation in Help Center e File Exchange
Prodotti
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!