how to find the intersection points of two 3d surfaces
27 views (last 30 days)
Show older comments
i have one 3d function plot
function = 2.0346941376982715` (0.33000000000000007` - 0.5` V) (1/Lambda)^0.9523809523809523` where {Lambda, 1, 5}, {V, -5, 5}
and one 3d data plot of some data
my question is how can i find the intersection points of these two 3d plots
0 Comments
Answers (1)
Star Strider
on 11 May 2022
Try this —
fcn = @(Lambda,V) [2.0346941376982715 + (0.33000000000000007 - 0.5 * V); (1./Lambda).^0.9523809523809523];
% where {Lambda, 1, 5}, {V, -5, 5}
[Lm,Vm] = ndgrid(1:5, -5:5);
fv = fcn(Lm,Vm);
fv1 = fv(1:5,:);
fv2 = fv((1:5)+5,:);
intsx = fv1 - fv2;
figure
[c,h] = contour3(Lm,Vm,intsx,[0 0], '-r');
xlabel('\Lambda')
ylabel('V')
title('Intersection Contour')
view(-120,30)
F = scatteredInterpolant(Lm(:),Vm(:),fv1(:));
Fisx = F(c(1,2:end),c(2,2:end));
figure
surf(Lm, Vm, fv1, 'FaceAlpha',0.8)
hold on
surf(Lm, Vm, fv2, 'FaceAlpha',0.5)
plot3(c(1,2:end),c(2,2:end),Fisx, '-r', 'LineWidth',8)
hold off
grid on
xlabel('\Lambda')
ylabel('V')
text(1,-5,1,'\Lambda Surface')
text(5,-5,5,'V Surface')
colormap(turbo)
view(-130,30)
This uses the (x,y) data provided by the contour3 function and the scatteredInterpolant function to calculate the z coordinate of the intersection, and plots the result.
.
4 Comments
Star Strider
on 11 May 2022
This is useless to me.
I cannot do anything with images of data. I need the actual data (preferably as a text file, since I cannot work with .mat files with the online Run feature).
I will also need an explanation of what the data are, since this makes no obvious sense. It also contains a strange sort of left single quote (`) that will have to be removed in order to use the data.
If these are the point data, what plane is it to intersect? The original ‘function’ makes no obvious sense either, because I have no idea how to intepret it in the context of the data. (I created two functions from it in the absence of any explanation as to exactly what it is supposed to do.) It also contains the strange (`) that I removed manually.
All of these issues need to be clarified.
.
See Also
Categories
Find more on Labels and Annotations in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

