3
$\begingroup$
Plot[{Tan[x], x Sin[x]}, {x, -8, 8}, MeshFunctions -> {Tan[#] - # 
Sin[#] &}, Mesh -> {{0.0}}, MeshStyle -> Directive[Red, 
PointSize[Large]]]

Just as the picture shows, there are some incorrect points around the intersection point.

I want to put a red point on the lines' intersection, but it does't work.

$\endgroup$
0

1 Answer 1

3
$\begingroup$

When using MeshFunctions, it is often a good idea to reformulate your functions so that it is free of poles or other singularities:

Plot[{Tan[x], x Sin[x]}, {x, -8, 8}, 
     MeshFunctions -> {Sin[#] - # Sin[2 #]/2 &}, Mesh -> {{0}}, 
     MeshStyle -> Directive[Red, PointSize[Large]]]

intersections

Similar principles apply to the use of e.g. FindRoot[] for finding intersections.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.