8

This old answer by @Silvia uses Mesh to find intersections of curves. Unfortunately, it doesn't seem to work in v13.2. For example (based on @JasonB's comment to that answer):

Clear[f, g]
f[x_, y_] := -Cos[y] + 2 y Cos[y^2] Cos[2 x];
g[x_, y_] := -Sin[x] + 2 Sin[y^2] Sin[2 x];

ContourPlot[{f[x, y] == 0, g[x, y] == 0}, {x, -7/2, 4}, {y, -9/5, 21/5}, MeshFunctions -> {f[#1, #2] - g[#1, #2] &}, Mesh -> {{0}}, MeshStyle -> Directive[Red, PointSize[Large]]]

enter image description here

There should be red points at the intersections. Any thoughts on how to get this working? What changed?

Chris K
  • 20,207
  • 3
  • 39
  • 74

1 Answers1

12

We can use two MeshFunctions {f[#1, #2] &, f[#1, #2] - g[#1, #2] &}

ContourPlot[{f[x, y] == 0, g[x, y] == 0}, {x, -7/2, 4}, {y, -9/5, 
  21/5}, MeshFunctions -> {f[#1, #2] &, f[#1, #2] - g[#1, #2] &}, 
 Mesh -> {{0}}, MeshStyle -> Directive[Red, PointSize[Large]]]

enter image description here

cvgmt
  • 72,231
  • 4
  • 75
  • 133