What is the best and quick way to find the intersections points set of two 3d surfaces?

6 visualizaciones (últimos 30 días)
Hi,
I am looking for the easiest best and quick way to find the intersections points of two surfaces in which the points for each curve be reported separately. As an example here there are two surfaces defined in specific domains which have two intersections. I am looking for the points on each one of these two intersection curves in seperated groups. e.g.
Curve 1:
[ x0 y0; x1 y1; x2 y2;...; xn yn]
Curve 2:
[ x0 y0; x1 y1; x2 y2;...; xn yn]
syms x y
f = (x-1)*exp(-y^3-x^2);
g = .5-sqrt(x*exp(-x^2-y^2));
ezsurf(f,[0,2],[-2,2]);
hold on
ezsurf(g,[0,2],[-2,2]);
  2 comentarios
Torsten
Torsten el 6 de Sept. de 2022
f = @(x,y)(x-1).*exp(-y.^3-x.^2);
g = @(x,y) 0.5-sqrt(x.*exp(-x.^2-y.^2));
h = @(x,y) f(x,y)-g(x,y);
fimplicit(h)
Mehdi
Mehdi el 7 de Sept. de 2022
Editada: Mehdi el 7 de Sept. de 2022
As I insisted in my question I am looking for a closed method that only reports the points of each curve separately. Your suggested method just plotted the f-g which is useless for me. In Maple there is a plots:-implicitplot command which groups the data of each curve seperately without plotting something. I am looking for similar command in Matlab, if any.

Iniciar sesión para comentar.

Respuesta aceptada

Matt J
Matt J el 7 de Sept. de 2022
Editada: Matt J el 8 de Sept. de 2022
You can to download this FEX submission,
f = @(x,y)(x-1).*exp(-y.^3-x.^2);
g = @(x,y) 0.5-sqrt(x.*exp(-x.^2-y.^2));
h = @(x,y) real(f(x,y)-g(x,y));
[X,Y]=deal(linspace(-6,6,1000));
[~,result]=getContourLineCoordinates( contourc(X,Y,h(X,Y'),[0,0]) )
result = 1×2 cell array
{996×2 double} {327×2 double}
  19 comentarios
Mehdi
Mehdi el 17 de Sept. de 2022
Editada: Mehdi el 17 de Sept. de 2022
"Operator '+' is not supported for operands of type 'function_handle'" error occurs before the calculation of ZZ. How to get rid of this error first?

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Logical en Help Center y File Exchange.

Productos


Versión

R2021b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by