Contour plot along predefined surface

1 次查看(过去 30 天)
Floris
Floris 2011-6-29
评论: Bruno Luong 2019-10-19
Hi,
I have 3D-data, with Z = f(x,y) in numerical format consistent with meshgrid.
I would like to make a contourplot of this surface along a given plane, which is not parallel to the Z-axis. I also want to get the X,Y-values of the intersection of this inclined plane and the surface Z in a matrix as output.
To get the idea, it's basically the same as the function C = contourc(x,y,Z,v) does, but contourc can apparently only handle elevations parallel with the Z-plane.
Of course, I can just rotate all the data so that its new Z-axis is perpendicular to the surface I wish to make the contour projections on (that's quite easy), but it seems too high computational effort.
Any help is appreciated.
  1 个评论
Bruno Luong
Bruno Luong 2019-10-19
"Of course, I can just rotate all the data so that its new Z-axis is perpendicular to the surface I wish to make the contour projections on (that's quite easy), but it seems too high computational effort."
You don't need to rotate the (x,y,z), just substract by the plane equation (a**x+b*y)
zz = z - (a*x+b*y)
do the concour on zz, call it
zz(xx,yy) = cst value
then recover
z = cst + a*xx + b*yy

请先登录,再进行评论。

回答(1 个)

Scott Booth
Scott Booth 2019-10-19
You could loop through the data to collect the points of intersection and then graph them with the plot3 command.

类别

Help CenterFile Exchange 中查找有关 Graphics Performance 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by