Skip to main content
added 561 characters in body
Source Link
george2079
  • 39.3k
  • 1
  • 45
  • 115

Construct an interpolation function, take its derivative (which results in a new interpolation function), then plot the zero contour of that:

data = Flatten[ Table[{x, y, x - (x/2 + y - 2/3)^2}, {x, 0, 1, .01}, {y, 0, 1, .01}], 1]; int = Interpolation[data]; dy = D[int[x, y], y] Show[{ ContourPlot[int[x, y], {x, 0, 1}, {y, 0, 1}], ContourPlot[dy, {x, 0, 1}, {y, 0, 1}, Contours -> {0}, ContourShading -> False]}] 

enter image description here

if you need specific points on the contours, extract that line and interpolate:

c = Interpolation[{int[Sequence @@ ##], ##} & /@ (First@ Cases[Normal@ ContourPlot[dy, {x, 0, 1}, {y, 0, 1}, Contours -> {0}, ContourShading -> False] , Line[pts_] :> pts , Infinity])]; Show[{ ContourPlot[int[x, y], {x, 0, 1}, {y, 0, 1}, Epilog -> {Red, PointSize[.025], Point[Table[c[v], {v, 0, 1, .2}]]}]}] 

enter image description here

note this is a little different input example than the other answer.

Construct an interpolation function, take its derivative (which results in a new interpolation function), then plot the zero contour of that:

data = Flatten[ Table[{x, y, x - (x/2 + y - 2/3)^2}, {x, 0, 1, .01}, {y, 0, 1, .01}], 1]; int = Interpolation[data]; dy = D[int[x, y], y] Show[{ ContourPlot[int[x, y], {x, 0, 1}, {y, 0, 1}], ContourPlot[dy, {x, 0, 1}, {y, 0, 1}, Contours -> {0}, ContourShading -> False]}] 

enter image description here

note this is a little different input example than the other answer.

Construct an interpolation function, take its derivative (which results in a new interpolation function), then plot the zero contour of that:

data = Flatten[ Table[{x, y, x - (x/2 + y - 2/3)^2}, {x, 0, 1, .01}, {y, 0, 1, .01}], 1]; int = Interpolation[data]; dy = D[int[x, y], y] Show[{ ContourPlot[int[x, y], {x, 0, 1}, {y, 0, 1}], ContourPlot[dy, {x, 0, 1}, {y, 0, 1}, Contours -> {0}, ContourShading -> False]}] 

enter image description here

if you need specific points on the contours, extract that line and interpolate:

c = Interpolation[{int[Sequence @@ ##], ##} & /@ (First@ Cases[Normal@ ContourPlot[dy, {x, 0, 1}, {y, 0, 1}, Contours -> {0}, ContourShading -> False] , Line[pts_] :> pts , Infinity])]; Show[{ ContourPlot[int[x, y], {x, 0, 1}, {y, 0, 1}, Epilog -> {Red, PointSize[.025], Point[Table[c[v], {v, 0, 1, .2}]]}]}] 

enter image description here

note this is a little different input example than the other answer.

Source Link
george2079
  • 39.3k
  • 1
  • 45
  • 115

Construct an interpolation function, take its derivative (which results in a new interpolation function), then plot the zero contour of that:

data = Flatten[ Table[{x, y, x - (x/2 + y - 2/3)^2}, {x, 0, 1, .01}, {y, 0, 1, .01}], 1]; int = Interpolation[data]; dy = D[int[x, y], y] Show[{ ContourPlot[int[x, y], {x, 0, 1}, {y, 0, 1}], ContourPlot[dy, {x, 0, 1}, {y, 0, 1}, Contours -> {0}, ContourShading -> False]}] 

enter image description here

note this is a little different input example than the other answer.