Contour plot along predefined surface

1 view (last 30 days)
Floris
Floris on 29 Jun 2011
Commented: Bruno Luong on 19 Oct 2019
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 Comment
Bruno Luong
Bruno Luong on 19 Oct 2019
"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

Sign in to comment.

Answers (1)

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

Categories

Find more on Graphics Performance in Help Center and File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!